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.
Thomas Ward♦
70.4k29 gold badges172 silver badges236 bronze badges
asked Jul 27, 2013 at 15:54
2
I had the same issue, and I wanted to delete the directory. So I tried to use rm -rf XXX
and also Shift + Delete
to remove but both failed because of the same error.
I was able to delete the directory by right clicking the directory, choosing Move to Trash
and then Empty Trash
.
Esther
2,8099 silver badges20 bronze badges
answered Feb 22, 2019 at 7:04
7
Looks like the filesystem has some errors on it. Do full scandisk /checkdisk from windows.
(scan disk for errors)
answered Jul 28, 2013 at 10:03
staticdstaticd
2,8352 gold badges15 silver badges19 bronze badges
4
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.
answered Sep 3, 2017 at 18:13
1
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.
answered Dec 18, 2018 at 4:55
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.
answered Oct 26, 2021 at 21:22
LajosLajos
1113 bronze badges
2
may need to be logged in a root to do this. If so, type:
sudo su
in to Terminal and navigate with terminal to where zigBqC04
is and rm <filename>
to remove files or rmdir <dir>
to delete folders replace <—> with the file or folder name. Wild cards ( & ?) can be used.*
answered Jul 27, 2013 at 16:03
SimplySimonSimplySimon
4,7758 gold badges33 silver badges52 bronze badges
1
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.
Thomas Ward♦
70.4k29 gold badges172 silver badges236 bronze badges
asked Jul 27, 2013 at 15:54
2
I had the same issue, and I wanted to delete the directory. So I tried to use rm -rf XXX
and also Shift + Delete
to remove but both failed because of the same error.
I was able to delete the directory by right clicking the directory, choosing Move to Trash
and then Empty Trash
.
Esther
2,8099 silver badges20 bronze badges
answered Feb 22, 2019 at 7:04
7
Looks like the filesystem has some errors on it. Do full scandisk /checkdisk from windows.
(scan disk for errors)
answered Jul 28, 2013 at 10:03
staticdstaticd
2,8352 gold badges15 silver badges19 bronze badges
4
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.
answered Sep 3, 2017 at 18:13
1
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.
answered Dec 18, 2018 at 4:55
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.
answered Oct 26, 2021 at 21:22
LajosLajos
1113 bronze badges
2
may need to be logged in a root to do this. If so, type:
sudo su
in to Terminal and navigate with terminal to where zigBqC04
is and rm <filename>
to remove files or rmdir <dir>
to delete folders replace <—> with the file or folder name. Wild cards ( & ?) can be used.*
answered Jul 27, 2013 at 16:03
SimplySimonSimplySimon
4,7758 gold badges33 silver badges52 bronze badges
1
- Forum
- The Ubuntu Forum Community
- Ubuntu Official Flavours Support
- General Help
- [ubuntu] rm cannot remove file: Input/output error
-
rm cannot remove file: Input/output error
Hi all,
I have TimeVault as backup system, but recently it is giving me errors that it can’t remove a snapshot directory. When I go into the offending directory, there is indeed a hidden file that i can’t remove.
Code:
$ ls -al ls: cannot access .IMG_8854.JPG.yyDFPb: Input/output error total 20 drwxrwxrwx 1 root root 8192 2009-04-17 12:01 . drwxrwxrwx 1 root root 12288 2009-04-17 12:01 .. -????????? ? ? ? ? ? .IMG_8854.JPG.yyDFPb $ sudo rm -f .IMG_8854.JPG.yyDFPb [sudo] password for jeroen: rm: cannot remove `.IMG_8854.JPG.yyDFPb': Input/output error
How do I go about removing this file?
Thanks in advance.
-
Re: rm cannot remove file: Input/output error
can you remove the directory «rm -fr» ?
what is the output ofM Abu Rahmeh
��so long as I get somewhere,� Alice added as an explanation.
�Oh, you�re sure to do that,� said the Cat, �if you only walk long enough.�
-
Re: rm cannot remove file: Input/output error
Originally Posted by mkrahmeh
can you remove the directory «rm -fr» ?
No:
Code:
$ cd .. $ sudo rm -rf 2009_04_04_verjaardag_Katrien/ [sudo] password for jeroen: rm: cannot remove `2009_04_04_verjaardag_Katrien/.IMG_8854.JPG.yyDFPb': Input/output error
-
Re: rm cannot remove file: Input/output error
uhh..forget about the echo thing (hate man pages that do not explain there exit codes)..
first, am afraid that the file is being accessed by other process (the timevault maybe) so try shutting it down
what is the output of
second, try to cd into the directory, and issue the find command to look for the file
Code:
find ./ -name file_name
then post back the echo’s output
try a couple of commands on the file, like find, cat, chown…..
and look for any abnormalities, post back if you find anything
if nothing found, we may consult with the system logs (dont know how that might help )M Abu Rahmeh
��so long as I get somewhere,� Alice added as an explanation.
�Oh, you�re sure to do that,� said the Cat, �if you only walk long enough.�
-
Re: rm cannot remove file: Input/output error
Input/output errors generally appear when you have hardware problems. Sounds like you might be getting bad sectors. I’d look into running some SMART tests and perhaps, if they start showing problems, getting a new drive.
-
Re: rm cannot remove file: Input/output error
Originally Posted by mkrahmeh
Code:
$ file .IMG_8854.JPG.yyDFPb .IMG_8854.JPG.yyDFPb: ERROR: cannot open `.IMG_8854.JPG.yyDFPb' (Input/output error)
Originally Posted by mkrahmeh
second, try to cd into the directory, and issue the find command to look for the file
Code:
find ./ -name file_name
then post back the echo’s output
Code:
$ find ./ -name .IMG_8854.JPG.yyDFPb ./.IMG_8854.JPG.yyDFPb $ echo $? 0
Originally Posted by mkrahmeh
try a couple of commands on the file, like find, cat, chown.
Code:
$ sudo chown jeroen:jeroen .IMG_8854.JPG.yyDFPb [sudo] password for jeroen: chown: cannot access `.IMG_8854.JPG.yyDFPb': Input/output error $ cat .IMG_8854.JPG.yyDFPb cat: .IMG_8854.JPG.yyDFPb: Input/output error $ hexedit .IMG_8854.JPG.yyDFPb hexedit: .IMG_8854.JPG.yyDFPb: Not a file.
Originally Posted by shad0w_walker
Input/output errors generally appear when you have hardware problems. Sounds like you might be getting bad sectors. I’d look into running some SMART tests and perhaps
After reading up on S.M.A.R.T., I installed smartmontools, but my 1 TB external hard drive fromLaCie (on which the onremovable file is) seems not supported.
Code:
$ sudo apt-get install smartmontools $ sudo fdisk -l Disk /dev/sda: 160.0 GB, 160041885696 bytes 255 heads, 63 sectors/track, 19457 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk identifier: 0x000341ad Device Boot Start End Blocks Id System /dev/sda1 * 1 18715 150328206 83 Linux /dev/sda2 18716 19457 5960115 5 Extended /dev/sda5 18716 19457 5960083+ 82 Linux swap / Solaris Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes 255 heads, 63 sectors/track, 121601 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk identifier: 0x454c112b Device Boot Start End Blocks Id System /dev/sdb1 * 1 121601 976760001 7 HPFS/NTFS $ sudo smartctl -i /dev/sdb1 smartctl version 5.38 [i686-pc-linux-gnu] Copyright (C) 2002-8 Bruce Allen Home page is http://smartmontools.sourceforge.net/ Device: SAMSUNG HD103UJ Version: Serial number: 152D20329000 Device type: disk Local Time is: Sun Apr 19 17:42:15 2009 CEST Device does not support SMART
The externalhard drive holds all my pictures and backups, so I that the drive doesn’t die on me. Any advice as to which other tools I could use?
Is there any other low level means by which I could remove that file?
Last edited by BioGeek; April 19th, 2009 at 05:04 PM.
-
Re: rm cannot remove file: Input/output error
It looks to me like there is some NTFS filesystem corruption on /dev/sdb1.
Perhaps install ntfsprogs and run ntfsfix:
Code:
sudo apt-get install ntfsprogs sudo ntfsfix /dev/sdb1
-
Re: rm cannot remove file: Input/output error
SMART is not supported on external devices. You’d need to take out the drive and mount it in your system. Corrupt NTFS filesystems will not spit out I/O errors. They will give a warning when mounting and will mount either read only or not at all unless forced.
Dispite it’s name, ntfsfix does not fix a NTFS filesystem, it simply clears the journal and tells it that all is well so that it can mount cleanly on linux. It is only to be used when you know there isn’t corruption on the system and you are just trying to plug and play a USB drive on a linux system.
-
Re: rm cannot remove file: Input/output error
Originally Posted by unutbu
It looks to me like there is some NTFS filesystem corruption on /dev/sdb1.
+1
try to check your filesystem. first you need to unmount the offending filesystem, then run the command
supposedly the filesystem is ext2 or ext3it might complain about the superblock, in this case:
Code:
dumpe2fs /dev/drive | grep -i superblock
in the output, take the number of the backup superblock, then repeat the check with -b flag
Code:
e2fsck -b number /dev/drive
i recommend consulting the man pages of e2fsck and dumpe2fs for more info. remember: unmount the file system b4 proceeding.
glM Abu Rahmeh
��so long as I get somewhere,� Alice added as an explanation.
�Oh, you�re sure to do that,� said the Cat, �if you only walk long enough.�
Tags for this Thread
Bookmarks
Bookmarks
Posting Permissions
On some servers I use rsnapshot as a backup method. It’s fast, easy to manage and reliable. But a backup a few days ago returned the following error in the daily backup log:
echo 5190 > /var/run/rsnapshot.pid
/bin/rm -rf /backup/rsnapshot/daily.9/
/bin/rm: cannot remove `/backup/rsnapshot/daily.9/localhost/home/mail/web98p1/Maildir/cur/1359872706S=12695,W=12855:2,S’: Input/output error
/bin/rm: cannot remove `/backup/rsnapshot/daily.9/localhost/home/mail/web98p8/Maildir/cur/1360095843S=4225,W=4321:2,S’: Input/output error
/bin/rm: cannot remove `/backup/rsnapshot/daily.9/localhost/var/www/web136/files/g2data/cache/entity/3/2′: Input/output error
—————————————————————————-
rsnapshot encountered an error! The program was invoked with these options:
/usr/bin/rsnapshot daily
[Backflash] This particular server suffered a disk defect in the past days and the raid recovery had some issues to resynchronize. I removed the defect disk out of the raid array and told the guys in the data center to replace the defect disk. And here’s comes the problem: They made a big mistake by making a short SMART test which resulted in no errors and decided, the disk was good and rebooted the server. As the server booted, the Kernel recognized two disks with each a raid configuration on them. But guess what? mdraid tells the kernel that these disks are not in the same raid (because I previously removed the defect disk, remember?).
So by accident, the kernel took the defect disk, created a weird new raid array (called md127) and mounted the filesystems on it while the good disk was just mounted as read-only block device. During a day or so the server was running like this until I realized what happened. I then hoped I could at least resynchronize the defect disk with the good disk, so the new data would be synchronized. But due to too many I/O errors from the bad disk (because the disk is bad, told ya!!) the raid recovery failed at around 20%. So some data was resynchronized, some not. Some probably even contain invalid data as the disk was going to die. After a lot of nightly effort I could restore the server to a more or less stable system, thanks to the help of a very good friend. But one question remained open: What did the failed raid recovery do to the good disk? [/Backflash]
Back to present. My guess is that the input/output errors on that filesystem originate from the failed raid rebuild where some corrupt data might have come from the defect disk. I tried to manually remove the daily.9 folder to see what would happen:
rm -r daily.9
rm: cannot remove `daily.9/localhost/home/mail/web98p1/Maildir/cur/1359872706,S=12695,W=12855:2,S’: Input/output error
rm: cannot remove `daily.9/localhost/home/mail/web98p8/Maildir/cur/1360095843,S=4225,W=4321:2,S’: Input/output error
rm: cannot remove `daily.9/localhost/var/www/web136/files/g2data/cache/entity/3/2′: Input/output error
Same issue. Let’s see if dmesg tells us something useful:
dmesg
[116836.420063] EXT4-fs error (device dm-5): ext4_lookup: deleted inode referenced: 24274320
[116842.656399] EXT4-fs error (device dm-5): ext4_lookup: deleted inode referenced: 24400033
[116842.574064] EXT4-fs error (device dm-5): ext4_lookup: deleted inode referenced: 24273584
The «fs error» tells it all. There’s some issues on that file system. Next step: File system check.
As this is the backup file system, separately mounted, I can unmount it and make the file system check while the server continues to do its job.
umount /backup
fsck.ext4 /dev/mapper/vg0-backup
e2fsck 1.41.12 (17-May-2010)
/dev/mapper/vg0-backup contains a file system with errors, check forced.
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Entry ‘1360095843,S=4225,W=4321:2,S’ in /rsnapshot/daily.9/localhost/home/mail/web98p8/Maildir/cur (8674221) has deleted/unused inode 24274320. Clear
? yes
Entry ‘2’ in /rsnapshot/daily.9/localhost/var/www/web136/files/g2data/cache/entity/3 (24400027) has deleted/unused inode 24400033. Clear
? yes
Entry ‘1359872706,S=12695,W=12855:2,S’ in /rsnapshot/daily.9/localhost/home/mail/web98p1/Maildir/cur (8671256) has deleted/unused inode 24273584. Clear
? yes
Heyyy.. these entries look familiar. Don’t they? So these files were referenced in an inode which does not exist anymore. To my luck this is an older backup and I can permit myself to clear the inodes from the file system. Well… what choice would I have anyway. The fsck continues:
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Inode 939825 ref count is 10, should be 9. Fix
? yes
Inode 939826 ref count is 10, should be 9. Fix? yes
Inode 939827 ref count is 10, should be 9. Fix? yes
Inode 939843 ref count is 10, should be 9. Fix? yes
On Pass 4 there came a lot of Inode ref count fix suggestions. Inode ref counts are nothing more than a count of hard links to a particular file. rsnapshot users know that rsnapshot works with hard links to save disk space with daily backups.
Pass 5: Checking group summary information
Block bitmap differences: -(97030728—97030731) -(97033838—97033839) -97529271
Fix? yes
Free blocks count wrong for group #2961 (3626, counted=3632).
Fix
? yes
Free blocks count wrong for group #2976 (8930, counted=8931).
Fix
? yes
Free blocks count wrong (50341877, counted=50341884).
Fix
? yes
Inode bitmap differences: -24273584 -24274320 -24400033
Fix
? yes
Free inodes count wrong for group #2963 (2017, counted=2019).
Fix
? yes
Free inodes count wrong for group #2978 (3021, counted=3022).
Fix
? yes
Directories count wrong for group #2978 (4051, counted=4050).
Fix
? yes
Free inodes count wrong (26902779, counted=26902782).
Fix
? yes
/dev/mapper/vg0-backup: ***** FILE SYSTEM WAS MODIFIED *****
/dev/mapper/vg0-backup: 5865218/32768000 files (0.1% non-contiguous), 80730116/131072000 blocks
Pass 5 fixed the count of free inodes and free blocks on the file system. Must also be an artifact from the failed raid recovery. That was the end of the fsck.
Another check to see if everything is alright now:
fsck.ext4 /dev/mapper/vg0-backup
e2fsck 1.41.12 (17-May-2010)
/dev/mapper/vg0-backup: clean, 5865218/32768000 files, 80730116/131072000 blocks
So the file system should now be clean. Falsely referenced inodes were deleted and rsnapshot should do its job correctly now. Let me check the rsnapshot logs:
echo 9385 > /var/run/rsnapshot.pid
/bin/rm -rf /backup/rsnapshot/daily.9/
mv /backup/rsnapshot/daily.8/ /backup/rsnapshot/daily.9/
[…]
Yep, rsnapshot continues its fine job once more. Over and out.
Add a comment
Show form to leave a comment
Comments (newest first)
Jake from wrote on Nov 27th, 2015:
Thank you for this well written walk through!
I’m using Red Hat Enterprise Linux Server release 7.2 (Maipo)
and have vgroup mount to folder is: /dev/mapper/vg_oradata-lv_oradata 886G 636G 206G 76% /bak
.
Now, In folder /bak have a some file cannot remove with info:
[root@bak bak]# ls -l
ls: cannot access data_t950234427_s4036_p2.rmanbkp: Input/output error
ls: cannot access data_t950499092_s4061_p9.rmanbkp: Input/output error
ls: cannot access data_t950493620_s4055_p1.rmanbkp: Input/output error
ls: cannot access data_t950529442_s4066_p1.rmanbkp: Input/output error
ls: cannot access data_t950499092_s4061_p7.rmanbkp: Input/output error
ls: cannot access data_t950499092_s4061_p10.rmanbkp: Input/output error
ls: cannot access data_t950499092_s4061_p6.rmanbkp: Input/output error
ls: cannot access data_t950499096_s4064_p12.rmanbkp: Input/output error
ls: cannot access data_t950499096_s4064_p10.rmanbkp: Input/output error
ls: cannot access data_t950513219_s4065_p1.rmanbkp: Input/output error
ls: cannot access data_t950493620_s4056_p1.rmanbkp: Input/output error
total 168166396
-????????? ? ? ? ? ? data_t950234427_s4036_p2.rmanbkp
-????????? ? ? ? ? ? data_t950493620_s4055_p1.rmanbkp
-????????? ? ? ? ? ? data_t950493620_s4056_p1.rmanbkp
-????????? ? ? ? ? ? data_t950499092_s4061_p10.rmanbkp
-????????? ? ? ? ? ? data_t950499092_s4061_p6.rmanbkp
-????????? ? ? ? ? ? data_t950499092_s4061_p7.rmanbkp
-????????? ? ? ? ? ? data_t950499092_s4061_p9.rmanbkp
-????????? ? ? ? ? ? data_t950499096_s4064_p10.rmanbkp
-????????? ? ? ? ? ? data_t950499096_s4064_p12.rmanbkp
-????????? ? ? ? ? ? data_t950513219_s4065_p1.rmanbkp
-????????? ? ? ? ? ? data_t950529442_s4066_p1.rmanbkp
When I cannot execute command rm -rf
its in folder:
[root@bak bak]# rm -rf data_t950234427_s4036_p2.rmanbkp
rm: cannot remove ‘data_t950234427_s4036_p2.rmanbkp’: Input/output error
What is the problem? Any help is highly appreciated.
- Печать
Страницы: [1] Вниз
Тема: Input/output error при попытке удаления (Прочитано 2807 раз)
0 Пользователей и 1 Гость просматривают эту тему.
warlock2
Возникла необходимость удалить каталог, сразу пишу:
sudo rm -Rf <мой каталог>
И получаю ошибку:
cannot remove `<путь к файлу>': Input/output error
Непонимаю в чем проблема, все права есть, может быть разве что проблемы с поверхностью диска…
Надеюсь на вашу помощь, папочка немало весит…
ploop
Может, файл занят другим процессом?
Кстати, кто знает, как это проверить?
Karl500
warlock2
ploop, могу попробовать в init 1, но это обычный каталог без исполняемых файлов.
Karl500, выполнил, и естественно файл не занят никаким процессом
Karl500
Тогда, боюсь, причина действительно в I/O Error… попробуйте проверить диск fsck (возможно, есть просто ошибки файловой системы). Только отмонтируйте его вначале. Если диск системный — shutdown -F -r now
warlock2
Karl500, диск не системный, я его отмонтировал, но сможет ли fsck проверить ntfs проверить? Дело в том, что это терабайтник почти забитый, а конвертировать файловую систему я пока не осмелился.
Karl500
А винды нет, которой этот диск можно проверить? Я бы все-таки доверил это «штатной» ОС…
ArtemZ
Забитый терабайтник с ntfs к тому же и с проблемами удаления файлов — скорей всего битые блоки. выложите куда-нибудь на pastebin.com вывод dmesg
SaVVa
диск сыпется?
sudo badblocks -v /dev/hda
может быть слот, плохой контакт…
ps
для ntfs наверное — Acronis?
warlock2
Karl500, Винды если не ошибаюсь же 2 месяца нет. Может быть найду где-нибудь диск с виндой, а там уже через дос проверю. Спасибо.
ArtemZ, вывод dmesg — dmesg
SaVVa, начал проверку, закончиться не очень скоро мягко говоря…сообщу о результате, спасибо, не знал такую команду.
SaVVa
надеюсь отмонтировать не забыл?
warlock2
SaVVa, я усомнился что не забыл, вроде и правильно сделал, диск был примонтирован) Отомнотировал — такая же скорость, все-таки 839 млн. блоков нужно проверить
SaVVa
лучше бы, конечно, сначала слоты проверить — из-за контактов могут быть i/o errors, а потом уже badbloks или fs
dmig
warlock2 я бы посоветовал не морочиться с проверками, а найти резервную ёмкость для копирования данных: другие харды, двд болванки — сам так «конвертил» разделы, плюс данные (если это не видео или музыка в mp3/ogg) можно пожать. затем просто отформатировать раздел в более приличную фс.
- Печать
Страницы: [1] Вверх