我在RHEL上安装了Docker EE。现在当我需要卸载时,根据the Docs上的说明,我需要运行sudo rm -rf /var/lib/docker
。
然而,这给了我以下错误:
rm: cannot remove ‘/var/lib/docker/plugins/11d2935e42e055dda59b62977de0c00bb18d820c6eccdff964f232276a6e7cd7/rootfs/dev’: Device or resource busy
rm: cannot remove ‘/var/lib/docker/plugins/11d2935e42e055dda59b62977de0c00bb18d820c6eccdff964f232276a6e7cd7/rootfs/etc/resolv.conf’: Device or resource busy
rm: cannot remove ‘/var/lib/docker/plugins/11d2935e42e055dda59b62977de0c00bb18d820c6eccdff964f232276a6e7cd7/rootfs/etc/hosts’: Device or resource busy
rm: cannot remove ‘/var/lib/docker/plugins/11d2935e42e055dda59b62977de0c00bb18d820c6eccdff964f232276a6e7cd7/rootfs/proc’: Device or resource busy
rm: cannot remove ‘/var/lib/docker/plugins/11d2935e42e055dda59b62977de0c00bb18d820c6eccdff964f232276a6e7cd7/rootfs/run/docker’: Device or resource busy
rm: cannot remove ‘/var/lib/docker/plugins/11d2935e42e055dda59b62977de0c00bb18d820c6eccdff964f232276a6e7cd7/rootfs/sys’: Device or resource busy
rm: cannot remove ‘/var/lib/docker/devicemapper’: Device or resource busy
我应该如何完全删除这些文件?
答案 0 :(得分:1)
显然,仍然有活动的坐骑,甚至可能是一个正在运行的容器。摆脱它们的最简单方法是重启机器。否则,您将仔细查看ps
和mount
输出以确定正在运行的内容和已安装的内容,并终止这些进程并卸载文件系统。
(如果有一个绑定挂载,你很幸运rm -rf
没有损坏主机安装。)