Solaris: unmounting a filesystem with umount

Contributor Icon Contributed by qmchenry Date Icon November 27, 2005  
Tag Icon Tagged: Solaris system administration

Most filesystem mounting and unmounting is automated for a system at boot or shutdown, but there are times during system maintenance and working with NFS shares, for example, when manually unmounting a filesystem is important.


A filesystem in Solaris can be referenced by its device name (like /dev/dsk/c0t0d0s0) or by the mount point in the filesystem (like /usr or /export/home). The umount command can accept either reference as the target to unmount. Given the device /dev/dsk/c1t2d3s4 mounted on /mnt, umount could be called in two ways:

umount /dev/dsk/c1t2d3s4
umount /mnt

The latter usage is generally simpler to use and less prone to errors (typos or not knowing which device is mounted where).

The umount command, by default, will not unmount a filesytem that is busy (a program with an open file or a user’s current working directory in the mounted filesystem). If a filesystem fails to unmount, the best course of action is to use fuser to determine the processes using the filesystem and to safely end them. If you are certain that nothing important is running (and particularly that no important files are open), you can try to forcibly unmount the filesystem with the -f option:

umount -f /mnt

Previous recipe | Next recipe |
 
blog comments powered by Disqus