Linux umount Command
The Linux umount (short for unmount) command is used to unmount file systems.
umount can unmount the file system currently mounted on a Linux directory.
Syntax
umount [-ahnrvV][-t <file system type>][file system]
Parameters:
-a Unmount all file systems listed in /etc/mtab.
-h Display help.
-n Do not write the unmount information to /etc/mtab.
-r If unmounting fails, attempt to remount the file system as read-only.
-t<file system type> Only unmount the specified file system type.
-v Display detailed information while executing.
-V Display version information.
[file system] In addition to directly specifying the file system, you can also use the device name or mount point to represent the file system.
Examples
The following two commands unmount the file system using the device name and mount point, respectively, while outputting detailed information:
# umount -v /dev/sda1 Unmount by device name
/dev/sda1 umounted
# umount -v /mnt/mymount/ Unmount by mount point
/tmp/diskboot.img umounted
If the device is busy, the unmount operation will fail. A common reason for unmount failure is that the current directory of an open shell is within the mount point:
# umount -v /mnt/mymount/
umount: /mnt/mymount: device is busy
umount: /mnt/mymount: device is busy