mount 和 umount

最近有个需要需要给某个目录扩容,想到的办法是通过mount的方式挂载新的磁盘;
umount 时候会出现:

umount -v /dev/xvdc1

umount:   /mnt: device is busy.
        (In some cases useful info about processes that use
         the device is found by lsof(8) or fuser(1))

可以通过以下命令查看占用情况:

lsof | grep /mnt

bash       4258             root  cwd       DIR             202,33      4096    5242886 /mnt
lsof       9014             root  cwd       DIR             202,33      4096    5242886 /mnt
grep       9015             root  cwd       DIR             202,33      4096    5242886 /mnt
lsof       9016             root  cwd       DIR             202,33      4096    5242886 /mnt/data

此时可以通过以下命令做延时卸载:

umount -vl /dev/xvdc1

当需要挂载时,先将原挂载点里的数据导出并将所有的依赖于此盘的所有应用程序停止
此时执行

mount /dev/xvdc1 /mnt

你可能感兴趣的:(mount 和 umount)