Monday, November 16, 2009

PERFORM MOUNT AND UNMOUNT

In order to access any file system, it is first necessary to mount it.we can determine which file system are currently mounted by using mount or df command.
How Mounting file system automatically?
#cat /etc/vfstab file lists all the file systems to be automatically mounted at system boot time,with the exception of the /etc/mnttab and /var/run file systems.

File format,seven field per line entry.
1) device to mount :->/dev/dsk/c0t1d0s0 or /home
2) device to fsck :--> raw or character device checked by the fsck.
3) mount point :--> mount point
4) Fs type :--> type of file system to be mounted.
5) fsck pass :--> when the field contain a value greater than zero (0),the file system alwayz check.
6) mount at boot :--> yes to enable the, mountall command to mount the file system at boot time. No to prevent a file system mount at boot time.
7) mount option :--> A comma-separated list of option passed to the mount command. - dash indicate the use of default mount option.
# /etc/mnttab File
mntfs file system that provides read-only information directly from the kernal about mounted file systems on the local host.each time a file system is mounted,the mount command adds an entry to this file.whenever a file system is unmounted,its entry is removed form /etc/mnttab.
Mount File system manually.
#mount /dev/dsk/c0t1d0s1 /home
the default option of mount command. RW,setuid,intr/nointr,logging,largfile,xattr
using mount command with option....eg.
#mount -o ro,nosuid,nolargefile,notime /dev/dsk/c0t1d0s1 /home

Mount All file system manually.
The /etc/vfstab file is read by the /usr/sbin/mountall command during the system boot sequence and mount all file systems that have a yes in the mount at boot field.
#mountall
To mount only local file system listed in /etc/vfstab
#mountall -l
Perform Unmount
#umonut /home or /umonut /dev/dsk/c0t1d0s1
Perform unmount all file systems.
#umountall -l (-l for only local file system)

Unmount Busy file system. use following command to identify which process need to be terminated.
#fuser -cu mountpoint
Kill all process
#fuser -ck mountpoint
verify there are no process accessing the file system
#fuser -c mountpoint
unmount file systems.
#umount mountpoint
if you dont want to chek and forcfully unmount then use this option
#umount -f mountpoint
For mount cdrom specfiy hsfs file system.
#mount -F hsfs -o ro /dev/dsk/c0t6d0s0 /cdrom
To restrict access cd-rom #/etc/init.d/volmgt stop

No comments:

Post a Comment