I/O error on Linux: cannot remove directory as root
Solution 1:
I suspect filesystem corruption here. As this is likely to be your root filesystem you won't be able to do a full fsck
while the system is live, so do sudo shutdown -r -F now
which should shutdown and reboot (the -r
) forcing a run of fsck
(the -F
) as the system comes back up (at a point where issues found can be more safely fixed). You might want to update your backups first, if only for the sake of paranoia (in case something is seriously wrong and the machine won't reboot cleanly).
It could also be a file locking issue, though I would expect a different error message in that case. To see what processes are actively usng those files you can run lsof | grep locale
.
Solution 2:
Four hours later I found the solution to my problem:
- I rebooted the PC and in the boot menu I started an instance of the Ubuntu Recovery menu-item.
-
I opened a terminal session as root and was able to delete the direcory with the command:
rmdir ".gvfs"
No error message came back.
- I checked the removal with another
ls -al
command. The directory file was no longer in the listing. - I rebooted the PC and saw that the result was perfect. The unwanted, uncontrollable file on the desktop was not there anymore. Problem solved.