-1

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?

aman_novice
  • 1,027
  • 3
  • 13
  • 31

1 Answers1

1

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 ps and mount output 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 -rf did not damage the host installation.)

Florian Weimer
  • 32,022
  • 3
  • 48
  • 92