unable to delete file - rm: cannot remove Input/output error
Solution 1
Looks like the filesystem has some errors on it. Do full scandisk /checkdisk from windows. (scan disk for errors)
Solution 2
The same circumstance I met. I am pretty sure I am going to delete the directory. So I try to use rm -rf XXX
and also Shift + Delete
to remove but both failed because of the same error. Interestingly, I fixed it by right clicking the directory Move to Trash
and then Empty Trash
. Hope works for you too.
Solution 3
If it is an NTFS or FAT file system and you don't have access to Windows just copy the files that you want to keep from the USB drive onto your hard drive. Then format the USB drive again using GPARTED or similar partition manager to NTFS or FAT. Followed by copying all the files back onto the USB drive. Worked for me.
Solution 4
A workaround that thankfully worked for me was to plug the drive into a Windows system and delete the offending files and folders using Shift + Delete (immediate delete without Recycle Bin).
After that, the issue seemed to be resolved when the drive was returned to Ubuntu.
Solution 5
I'm on PopOS. It happened to me when I unplugged the external disk before letting the OS flush. I could fix this issue by opening the GUI file manager -> right-click -> delete the parent folder. This time GUI was smarter.
unknown_boundaries
Updated on September 18, 2022Comments
-
unknown_boundaries over 1 year
Some file is in my NTFS file system which I can't delete. It's giving this error:
rm: cannot remove `zigBqC04': Input/output error
Any other files also could not be copied in that folder and showing error message as:
Error opening file 'file-path': Input/output error
Any solution.
-
unknown_boundaries almost 11 yearsI also tried as a root but still can't.
-
Csabi Vidó almost 11 yearsThat's probably the best one can do without damaging the proprietary filesystem or replacing the filesystem.
-
Sarah Szabo over 5 years@staticd As of 2019, is this still the best solution? I'm using the latest version of KDE, and am more interested in a *buntu specific solution.
-
parthagar over 4 yearsThanks, worked for me too. Looks like this sort of delete only deletes the information of the directory from the partition table and
rm
tries to delete by overwriting the sectors -
parsa2820 over 4 yearsworked for me too. such a odd solution!!! :)
-
Klesun over 4 years
'scandisk' is not recognized as internal or external command, operable program or batch file
did you meanCHKDSK
perhaps? -
ThePhi over 4 yearsYeah, I'd like to know why this workaround is working also...
-
cipricus about 4 yearsWindows checkdisk has the bad habit of deleting/hiding files and folders that seem erroneous in Windows but not in Linux
-
cipricus about 4 yearsnot working in my case
-
PatrickT almost 4 yearsitem was moved to trash, but cannot empty the trash...
-
nirala about 3 yearsYou sir are gnius i.imgflip.com/v0su9.jpg
-
Pavel Komarov almost 3 yearsDoesn't work if the external drive is way bigger than any other drive I've got.
-
darksoulsong over 2 yearsShift + Delete did the trick, where rm -rf filename failed. Thank you.
-
ThunderBird over 2 yearsPop OS, you say?
-
Lajos over 2 years