I/O error on Linux: cannot remove directory as root

8

1

ubuntu@ubuntu:/usr/lib/locale$ sudo rm -R nl_NL.utf8
rm: cannot remove directory `nl_NL.utf8': Input/output error

I'm having problems deleting a seemingly corrupted directory to allow for a reconfiguration of this locale, but the OS doesn't let me do it. Why?

Pieter

Posted 2010-02-21T16:44:05.997

Reputation: 676

2I fixed it by doing chkdsk /f from windows. – Rohan Khude – 2018-08-26T19:45:02.347

Answers

15

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.

David Spillett

Posted 2010-02-21T16:44:05.997

Reputation: 22 424

3

Four hours later I found the solution to my problem:

  1. I rebooted the PC and in the boot menu I started an instance of the Ubuntu Recovery menu-item.
  2. I opened a terminal session as root and was able to delete the direcory with the command:

    rmdir ".gvfs"
    

    No error message came back.

  3. I checked the removal with another ls -al command. The directory file was no longer in the listing.
  4. I rebooted the PC and saw that the result was perfect. The unwanted, uncontrollable file on the desktop was not there anymore. Problem solved.

Paul

Posted 2010-02-21T16:44:05.997

Reputation: 31

1

I had a similar problem and while I performed the FSCK I was prompted :

Entry 'file.dat' in /Folder (7782401) has deleted/unused inode 9519105. Clear? yes

This solved my problem.

Mudder

Posted 2010-02-21T16:44:05.997

Reputation: 11

0

I had similar problem and I managed to solve it through Gparted software

  1. launch Gparted application from the main menu
  2. from the main menu, select /dev/sdc device
  3. click on partitions and click on unmount, click on Apply
  4. click on delete to remove the corrupted partion, click on Apply
  5. click on New for recreating the partition and choose its type eg: (ext4, fat, or ntfs)
  6. enter a new label name for the new partition, click on Apply
  7. wait till it finishes

charly

Posted 2010-02-21T16:44:05.997

Reputation: 1

1that will delete all data on the partition – Suici Doga – 2017-08-07T13:43:26.253