Linux umount Command
The Linux umount (short for unmount) command is used to unmount file systems.
umount can unmount file systems currently mounted in the Linux directory tree.
Syntax
umount [-ahnrvV][-t <文件系统类型>][文件系统]
Parameters:
- -a Unmount all file systems recorded in /etc/mtab.
- -h Display help.
- -n Do not write information to /etc/mtab when unmounting.
- -r If unmounting fails, try remounting the file system as read-only.
- -t
Unmount only the file system specified in the option. - -v Display detailed information during execution.
- -V Display version information.
- [file system] In addition to specifying the file system directly, you can also use a device name or mount point to indicate the file system.
Example
The following two commands unmount a file system by device name and by mount point respectively, while printing 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, unmounting fails. A common cause of failure is that an open shell has its current directory inside a directory of the mount point:
# umount -v /mnt/mymount/
umount: /mnt/mymount: device is busy
umount: /mnt/mymount: device is busy
Linux Command Reference