文章目录
删除数据遇到报错信息:
异常信息:
[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