Linux常用命令-umount

命令

umount

描述

unmount file systems
取消挂载

用法

1
2
3
umount [-hV]
umount -a [options]
umount [options] <source> | <directory>

选项

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Options:
-a, --all 卸载所有文件系统,慎用
-A, --all-targets unmount all mountpoins for the given device in the current namespace
-c, --no-canonicalize don't canonicalize paths
-d, --detach-loop if mounted loop device, also free this loop device
--fake dry run; skip the umount(2) syscall
-f, --force 强制卸载,可用于NFS挂载异常时使用
-i, --internal-only don't call the umount.<type> helpers
-n, --no-mtab don't write to /etc/mtab
-l, --lazy detach the filesystem now, and cleanup all later
-O, --test-opts <list> limit the set of filesystems (use with -a)
-R, --recursive recursively unmount a target with all its children
-r, --read-only 如果卸载失败,则尝试重新以只读方式挂载
-t, --types <list> limit the set of filesystem types
-v, --verbose 显示详情

注意

示例

1
2
3
4
5
6
7
8
$ mount | grep /mnt
/dev/sdb1 on /mnt/temp type xfs (rw,relatime,attr2,inode64,noquota)
# 指定挂载点
$ umount /mnt/temp
$ mount -a
# 或者指定块设备
$ umount -v /dev/sdb1
umount: /mnt/temp (/dev/sdb1) unmounted