由于Linux硬盘移除后没有将挂载的目录没有移除,后续使用umoun提示tumount: /databack: target is busy.
[root@VM-12-15-centos ~]# umount /databack
umount: /databack: target is busy.
这种情况是有进程在使用导致的,使用
fuser #查询使用进程信息
fuser
No process specification given
Usage: fuser [-fIMuvw] [-a|-s] [-4|-6] [-c|-m|-n SPACE]
[-k [-i] [-SIGNAL]] NAME...
fuser -l
fuser -V
Show which processes use the named files, sockets, or filesystems.
-a,--all display unused files too
-i,--interactive ask before killing (ignored without -k)
-I,--inode use always inodes to compare files
-k,--kill kill processes accessing the named file
-l,--list-signals list available signal names
-m,--mount show all processes using the named filesystems or
block device
-M,--ismountpoint fulfill request only if NAME is a mount point
-n,--namespace SPACE search in this name space (file, udp, or tcp)
-s,--silent silent operation
-SIGNAL send this signal instead of SIGKILL
-u,--user display user IDs
-v,--verbose verbose output
-w,--writeonly kill only processes with write access
-V,--version display version information
-4,--ipv4 search IPv4 sockets only
-6,--ipv6 search IPv6 sockets only
- reset options
udp/tcp names: [local_port][,[rmt_host][,[rmt_port]]]
[root@VM-12-15-centos ~]# fuser -mv /databack/
USER PID ACCESS COMMAND
/databack: root kernel mount /databack
root 95595 ..c.. mysqld_safe
mysql 95766 F.c.. mysqld
[root@VM-12-15-centos ~]#
- 使用-km /kv参数将进程杀掉
[root@VM-12-15-centos ~]# fuser -kv /databack/
USER PID ACCESS COMMAND
/databack: root kernel mount /databack
[root@VM-12-15-centos ~]# fuser -km /databack
/databack: 95595c 95766c
[root@VM-12-15-centos ~]#
[root@VM-12-15-centos ~]# fuser -km /databack
- 在使用umount再去操作就可以了,再使用df -TH查询磁盘情况已经卸载掉了
[root@VM-12-15-centos ~]# umount /databack
[root@VM-12-15-centos ~]#