rm -rf xxx遇到device or resource busy

删除数据遇到报错信息:

异常信息:

[root@kVM12345679-0 root]# rm -rf /mnt/*
rm: cannot remove ‘/mnt/centos7-build-repo_2021/root/dev/shm’: Device or resource busy
rm: cannot remove ‘/mnt/centos7-build-repo_2021/root/dev/pts/ptmx’: Operation not permitted
rm: cannot remove ‘/mnt/centos7-build-repo_2021/root/proc’: Device or resource busy
rm: cannot remove ‘/mnt/centos7-build-repo_2021/root/sys’: Device or resource busy
rm: cannot remove ‘/mnt/centos7-build-repo_2021-bootstrap/root/mnt/centos7-build-repo_2021/root’: Device or resource busy
rm: cannot remove ‘/mnt/centos7-build-repo_i686_ppppppppppppppp-bootstrap/root/mnt/centos7-build-repo_i686_ppppppppppppppp/root’: Device or resource busy

删除多次失败

查找原因:

1)查看是否有进程使用/mnt

在这里插入图片描述

2)查看是否被mount了:

df -h
在这里插入图片描述
rm -rf /mnt/*
在这里插入图片描述
cat /proc/mounts | grep “/mnt”
在这里插入图片描述
最后:分别umount掉就可以删除了

fuser -mv -k /dev/vdb1
umount /dev/vdb1
wipefs -a -f /dev/vdb
parted -s /dev/vdb mklabel gpt mkpart primary 0G 40G
mkfs.ext4 -c /dev/vdb1 -F
mount /dev/vdb1 /disk/mysqldata
mount

猜你喜欢

转载自blog.csdn.net/weixin_43010385/article/details/113307174
今日推荐