I installed Docker EE on RHEL. Now when I need to uninstall, as per the instructions on the Docs, i need to run sudo rm -rf /var/lib/docker.
This however gives me the following errors:
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
How should I go about completely removing these files?
Apparently, there are still active mounts, and perhaps even a running container. The easiest way to get rid of them would be to reboot the machine. Otherwise, you'll have too look carefully at
psandmountoutput to determine what's running and what's mounted, and terminate those processes and unmount the file systems.(If there is a bind mount in play, you are lucky that
rm -rfdid not damage the host installation.)