Function Description: Remove the file system.
Syntax:umount [-ahnrvv][-t < file system type >][file system]
Supplemental Note: Umount can dismount the file system currently attached to the Linux directory.
Parameters
-A dismount all file systems recorded in the/etc/mtab.
-h displays Help.
Do not save the information in the/etc/mtab file when-n dismount.
-R attempts to reseat the file system in a read-only manner if the removal cannot be successful.
-t< file System type > Remove only the file system specified in the option.
-V displays detailed information when executing.
-V Displays version information.
The file system can also represent the file system with a device name or a mount point, in addition to specifying the file system directly.
Use the Umount command to uninstall the file system. The file system can be umount with a device name or mount point, but it is best to uninstall it through a mount point to avoid confusion when using a binding mount (a device, multiple mount points). The following two commands uninstall the file system by device name and mount point respectively, with the output details:
1.# umount-v/dev/sda1 Uninstall via device name 2./DEV/SDA1 umounted 3.# umount-v/mnt/mymount/Uninstall via mount point 4./tmp/diskboot.img umounted
|
If the device is busy, uninstall fails. A common reason for uninstallation failures is that an open shell is currently in the directory of a mount point:
| # umount-v/mnt/mymount/umount:/mnt/mymount:device is busy umount:/mnt/mymount:device is busy |
Sometimes, the reason why the device is busy is not easy to find. When this happens, you can use Lsof to list the open files, and then search the list to find the mount point to unload:
| # Lsof | grep mymount find open files in mymount partitions bash 9341 Francois CWD DIR 8,1 1024 2/mnt/mymount |
The output from the above shows that the Mymount partition cannot be unloaded because the Francois is running a bash process with a PID of 9341.
Another way to handle system files being busy is to perform a deferred uninstall:
# umount-vl/mnt/mymount/Perform deferred Uninstall
|
Deferred unload (lazy unmount) immediately unloads the file system in the directory tree and clears all related resources until the device is no longer busy. You can also uninstall Removable Storage media by using the eject command. The following command uninstalls the CD and pops the CD:
| # eject /dev/cdrom Uninstall and eject cd |