从RHEL卸载Docker后,出现删除关联文件的问题

时间:2018-02-13 21:32:57

标签: docker rhel device-mapper

我在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

我应该如何完全删除这些文件?

1 个答案:

答案 0 :(得分:1)

显然,仍然有活动的坐骑,甚至可能是一个正在运行的容器。摆脱它们的最简单方法是重启机器。否则,您将仔细查看psmount输出以确定正在运行的内容和已安装的内容,并终止这些进程并卸载文件系统。

(如果有一个绑定挂载,你很幸运rm -rf没有损坏主机安装。)