Performing Mount and unmount

To view which file systems are currently mounted

# mount
# more /etc/mnttab
# df -h           


Temporary mount

# mount /dev/dsk/c0d1s6 /directoryname


To mount a filesystem permanently


# vi /etc/vfstab

/dev/dsk/c0d1s6 /dev/rdsk/c0d1s6 /mountpoint    ufs 2   yes  -

:wq


Mount Options

syntax: mount -o option,option,... device_name mount_point

# mount -o ro,nosuid /dev/dsk/c0d1s6 /mountpoint
# mount -o noatime /dev/dsk/c0d1s6 /mountpoint
# mount -o nolargefiles /dev/dsk/c0d1s6 /mountpoint


# mountall     ==> to mount all file systems listed in /etc/vfstab file

# mountall -l     ==> to mount only local filesystems listed in /etc/vfstab file


Mounting Different Types of File Systems

# fstyp /dev/rdsk/c0d1s7     ==> to view a filesystem type

# mount -F hsfs -o ro /dev/dsk/c0d0s0 /cdrom    ==> to mount a CD-ROM


To mount a file system that resides on a diskette when the Volume Management (vold) services are stopped

# mkdir /pcfs
# mount -F pcfs /dev/diskette /pcfs


Unmounting File Systems


# umount /export/home        ==> unmount using directory mount point

# umount /dev/dsk/c0d1s7    ==> unmount using logicak disk device name

# umountall    ==> to unmount all filesystems listed in /etc/mnttab file

# umountall -l     ==> to unmount only local filesystems

The umountall unmounts all file systems specified in the vfstab file except
/ (root), /usr, /proc, /dev/fd, /var, /var/run, and /tmp.


Unmounting a Busy File System


# umount -f mountpoint    ==> to force unmount a filesystem


# fuser -cu mountpoint    ==> to list all processes accessing the filesystem

# fuser -ck mountpoint    ==> to kill all processes accessing the file system

# fuser -c mountpoint    ==> to verify if all processes are killed

# umount mountpoint


Restricting Access to Mounted Diskettes, CD-ROMs, or DVDs


# /etc/init.d/volmgt stop    ==> to stop Volume Management (vold) service

# /etc/init.d/volmgt start    ==> to start Volume Management service