Ls cannot access input output error

Hey guys!

Hey guys!

I get «input/output error» when trying to remove some folders from external hard drive (ntfs).

ls -lart
ls: cannot access 'Dan Kenned6 - Are You A Marketing and Sales Clod Or A Sophisticate': No such file or directory
ls: cannot access 'Dan Kenned5 - Copywriting Mastery and Sales Thinking Boot Camp': No such file or directory
ls: cannot access 'Da5 Kennedy - DNA Game Changer': No such file or directory
ls: cannot access 'Da5 Kennedy - How to get what you want': No such file or directory
total 112
d????????? ? ?  ?         ?            ? 'Dan Kenned6 - Are You A Marketing and Sales Clod Or A Sophisticate'
d????????? ? ?  ?         ?            ? 'Dan Kenned5 - Copywriting Mastery and Sales Thinking Boot Camp'
d????????? ? ?  ?         ?            ? 'Da5 Kennedy - How to get what you want'
d????????? ? ?  ?         ?            ? 'Da5 Kennedy - DNA Game Changer'
drwxrwxrwx 1 vb users  4096 Oct 27 15:49 'Dan Kennedy - archive'
drwxrwxrwx 1 vb users  4096 Oct 27 15:49 'Dan Kennedy - Copywriting Seminar-In-A-Box'
drwxrwxrwx 1 vb users  4096 Oct 27 15:49 'Dan Kennedy - Customer appreciation'
drwxrwxrwx 1 vb users  4096 Oct 27 17:58 'Dan Kennedy - How To Automatically Master New Skills'
drwxrwxrwx 1 vb users  4096 Oct 27 18:02 'Dan Kennedy - Advanced Coaching and Consulting High Fee Bootcamp'
drwxrwxrwx 1 vb users  4096 Oct 27 19:42 'Dan Kennedy - Consulting Manuals'
drwxrwxrwx 1 vb users     0 Oct 27 19:42 'Dan Kennedy - High Fee Consulting Bootcamp-PDFs'
drwxrwxrwx 1 vb users  4096 Oct 27 19:44 'Dan Kennedy - Business Building'
drwxrwxrwx 1 vb users 28672 Oct 27 20:39  .
drwxrwxrwx 1 vb users 57344 Oct 27 20:42  ..
sudo fdisk -l
[sudo] password for vb: 
Disk /dev/sda: 465.8 GiB, 500107862016 bytes, 976773168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0x0005a151

Device     Boot     Start       End   Sectors   Size Id Type
/dev/sda1  *         2048  33320959  33318912  15.9G 83 Linux
/dev/sda2        33320960 399439871 366118912 174.6G  7 HPFS/NTFS/exFAT
/dev/sda3       399439872 446341119  46901248  22.4G  7 HPFS/NTFS/exFAT
/dev/sda4       446341120 976773119 530432000   253G 83 Linux




Disk /dev/sdc: 931.5 GiB, 1000204885504 bytes, 1953525167 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 33553920 bytes
Disklabel type: dos
Disk identifier: 0xa70107e7

Device     Boot      Start        End   Sectors   Size Id Type
/dev/sdc1               64    1966079   1966016   960M  7 HPFS/NTFS/exFAT
/dev/sdc2          1966080  659374079 657408000 313.5G  7 HPFS/NTFS/exFAT
/dev/sdc3        659374080 1308590079 649216000 309.6G  7 HPFS/NTFS/exFAT
/dev/sdc4       1308590080 1953523711 644933632 307.5G  7 HPFS/NTFS/exFAT
sudo fsck /dev/sdc3
fsck from util-linux 2.30.2
sudo smartctl --info /dev/sdc3 | grep 'SMART support is:'
SMART support is:     Available - device has SMART capability.
SMART support is:     Disabled
sudo smartctl  --smart=on /dev/sdc3
smartctl 6.5 2016-05-07 r4318 [x86_64-linux-4.12.14-1-ck-ivybridge] (local build)
Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF ENABLE/DISABLE COMMANDS SECTION ===
Informational Exceptions (SMART) disabled
Temperature warning disabled

I can copy and paste files to and from the partition.

How to delete these folders? Any suggestions?

Thanks in advance!

Edit

sudo smartctl  -H /dev/sdc3
[sudo] password for vb: 
smartctl 6.5 2016-05-07 r4318 [x86_64-linux-4.12.14-1-ck-ivybridge] (local build)
Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF READ SMART DATA SECTION ===
SMART Health Status: OK

Last edited by amaro (2017-10-28 07:25:01)

My system raised the I/O error when I tried to use ‘ls’ on a mounted hard disk.

I am using

hadoop@hbase1:/hddata$ uname -a
Linux hbase1 3.8.0-29-generic #42~precise1-Ubuntu SMP Wed Aug 14 16:19:23 UTC 2013 x86_64    x86_64 x86_64 GNU/Linux

hadoop@hbase1:/hddata$ df
Filesystem                      1K-blocks       Used Available Use% Mounted on
/dev/mapper/hbase2--vg-root     468028968    2715496 441532304   1% /
udev                              6081916          4   6081912   1% /dev
tmpfs                             2436652        336   2436316   1% /run
none                                 5120          0      5120   0% /run/lock
none                              6091620          0   6091620   0% /run/shm
/dev/sda1                      1922727280  867279740 957771940  48% /hddata
/dev/sdb1                          233191      27854    192896  13% /boot
10.18.103.101:/data/marketdata 1883265024 1644255232 143344640  92% /srv/data/marketdatah

The last several lines of dmesg

hadoop@hbase1:/hddata$ dmesg | tail
[316263.280056] EXT4-fs (sda1): previous I/O error to superblock detected
[316263.281326] sd 0:0:0:0: [sda] Unhandled error code
[316263.281329] sd 0:0:0:0: [sda]
[316263.281330] Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK
[316263.281332] sd 0:0:0:0: [sda] CDB:
[316263.281334] Write(10): 2a 00 00 00 00 3f 00 00 08 00
[316263.281342] end_request: I/O error, dev sda, sector 63
[316263.282584] Buffer I/O error on device sda1, logical block 0
[316263.283799] lost page write due to I/O error on sda1
[316263.283842] EXT4-fs error (device sda1): ext4_find_entry:1270: inode #2: comm bash: reading directory lblock 0

tshepang's user avatar

tshepang

11.9k21 gold badges90 silver badges134 bronze badges

asked Sep 16, 2013 at 2:56

Vimos's user avatar

Buffer I/O error on device sda1, logical block 0

This sort of thing is indicative of an impending hardware failure. I’d do what you can to back up everything you need to somewhere else and replace the drive before it fails irreparably.

answered Sep 16, 2013 at 3:19

Robin Sheat's user avatar

Input/output error when accesing a directory

Hi

I have a directory «foo» on a NTFS partition of my hard drive, which i created a couple of days ago.
After creation it worked fine and i put some files in it, but the day after i get the following error:

me@mymachine:/media/disk1$ ls -l foo
ls: cannot access foo: Input/output error

me@mymachine:/media/disk1$ ls -l
ls: cannot access foo: Input/output error
total 101
d????????? ? ? ? ? ? foo
(+ a succesful listing of other files and directories)

I get the Input/output error no matter what i try to do to the directory (rm, mv, cd, etc.), and no matter which privileges i have.

I read some threads suggesting that it is a hardware problem. I tried running ntfsfix on the partition:

me@mymachine:~$ sudo ntfsfix /dev/sda3
Mounting volume… OK
Processing of $MFT and $MFTMirr completed successfully.
NTFS volume version is 3.1.
NTFS partition /dev/sda3 was processed successfully.

I have also run the short and the long SMART test from the disk utility, resulting in the overall assessment: Disk is healthy.

It would be nice to know how to recover the data in the directory, but i have backup so that part is not crucial. I could also reformat the whole drive to ext4, which I eventually would have done in any case. Or i could just ignore the defective folder which does not harm anyone.
However if this problem is the first warning of a failing drive, I would rather get a new drive now, before some more important data suddenly disappear.

My question is now, what course of action i should take.
Is there any other diagnostics that i could try? Is it a soft- or hardware related issue. Should I begin looking for a new hard drive?


Arrow Re: Input/output error when accesing a directory

That most definitely seems like a bad hard drive.

Of course a hardware problem elsewhere could also cause data/file system corruption. Do you have reason to suspect it could be anything else? Upgraded your CPU or RAM lately?

Eternally confused.


Re: Input/output error when accesing a directory

Thanks for the reply.
Nope, no hardware changes. I’ve been running Hardy to Karmic on unchanged hardware without problems of this kind before.
I guess I should look into changing the disk. However it would be nice to be able to verify that the hardware is to blame.


Re: Input/output error when accesing a directory

Quote Originally Posted by tjoff
View Post

Thanks for the reply.
Nope, no hardware changes. I’ve been running Hardy to Karmic on unchanged hardware without problems of this kind before.
I guess I should look into changing the disk. However it would be nice to be able to verify that the hardware is to blame.

You answered your own question. Try a Karmic.live CD and see if the problem still occurs.

I try to treat the cause, not the symptom. I avoid the terminal in instructions, unless it’s easier or necessary. My instructions will work within the Ubuntu system, instead of breaking or subverting it. Those are the three guarantees to the helpee.


Re: Input/output error when accesing a directory

Thank you for taking the time to answer me.

Regarding booting from a live-CD:

I tried it, the problem persists.
I still wonder however, what I have proved by booting from the live CD.
How should I be able to distinguish between a corrupted filesystem (in which case the problem can be solved by reformatting the drive), and a physically failing hard drive (in which case the solution is to exchange the drive)?

I was hoping to be able to make some kind of diagnostics for the hard drive, which could give me a more verbose error message than «Input/output error», and indicate the what causes the error.
I did all the tests from the disk utility tool, and none indicate any problems.

A definite proof or disproof that the hardware is failing would, apart from assuring myself that it is necessary to change the drive, come in handy as there is still a valid guarantee on the computer.


Re: Input/output error when accesing a directory

I tried to boot with windows xp, and chkdsk or whatever it is called found the errors and deleted the corrupted directory.
In ubuntu i no longer have any indication of the problem. I guess it was a software problem after all, and that ntfsfix was not able to fix the ntfs.


Re: Input/output error when accesing a directory

huhuhu,
me also encountered the same thing as yours, tjoff.

the case in me is that,
my ftp mounted directory seems can not accept
some files after cp operation… Geeez…


Has anyone seen this before? I’ve got a raid 5 mounted on my server and for whatever reason it started showing this:

jason@box2:/mnt/raid1/cra$ ls -alh
ls: cannot access e6eacc985fea729b2d5bc74078632738: Input/output error
ls: cannot access 257ad35ee0b12a714530c30dccf9210f: Input/output error
total 0
drwxr-xr-x 5 root root 123 2009-08-19 16:33 .
drwxr-xr-x 3 root root  16 2009-08-14 17:15 ..
?????????? ? ?    ?      ?                ? 257ad35ee0b12a714530c30dccf9210f
drwxr-xr-x 3 root root  57 2009-08-19 16:58 9c89a78e93ae6738e01136db9153361b
?????????? ? ?    ?      ?                ? e6eacc985fea729b2d5bc74078632738

The md5 strings are actual directory names and not part of the error. The question marks are odd, and any directory with a question mark throws an io error when you attempt to use/delete/etc it.

I was unable to umount the drive due to «busy». Rebooting the server «fixed» it but it was throwing some raid errors on shutdown. I have configured two raid 5 arrays and both started doing this on random files. Both are using the following config:

mkfs.xfs -l size=128m -d agcount=32
mount -t xfs -o noatime,logbufs=8

Nothing too fancy, but part of an optimized config for this box. We’re not partitioning the drives and that was suggested as a possible issue. Could this be the culprit?

asked Sep 15, 2009 at 17:31

1

I had a similar problem because my directory had read (r) but not execute (x) rights.
My directory listing showed:

myname@srv:/home$ ls -l service/mail/
ls: cannot access service/mail/001_SERVICE INBOX: Permission denied
total 0
-????????? ? ? ? ?                ? 001_SERVICE INBOX
d????????? ? ? ? ?                ? 01_CURRENT SERVICE

The mail directory had the r bit set, but not the x that you need for listing or search and access.
Doing sudo chmod -R g+x mail solved this problem.

nickb's user avatar

nickb

1531 silver badge9 bronze badges

answered Dec 31, 2010 at 13:35

user65174's user avatar

user65174user65174

7215 silver badges2 bronze badges

2

The answers mentioning the read, but not execute or stat() are correct. But there is a common cause of this (other than corruption) that’s bitten me a few times and would match your question with the IO errors nicely. If you improperly mount a filesystem, the mount point of that filesystem may show up with question marks. If you’re seeing these where you’ve just tried mounting a new filesystem, try the following before worrying about corruption and fsck.

$ sudo umount /mnt/raid1/cra/257ad35ee0b12a714530c30dccf9210f
$ ls -alh /mnt/raid1/cra

You should see the 257ad35ee0b12a714530c30dccf9210f folder with permissions and attributes rather than question marks. If so, search for other options for your mount command or /etc/fstab file. If not, perhaps it is time to read the other answers, backup what you can, and run a fsck.

answered Mar 30, 2016 at 1:38

mightypile's user avatar

mightypilemightypile

2692 silver badges6 bronze badges

2

The question marks in the ls output just indicate that it could not stat() the directory entry. You can also see those if you ls a directory for which you have r(ead) but not x (search) permission. However in that case it would not report I/O error.

In your case it looks like there is a disk error or possibly filesystem corruption. /var/log/messages or dmesg is likely to reveal further details.

answered Sep 15, 2009 at 18:50

mark4o's user avatar

mark4omark4o

2941 silver badge6 bronze badges

Take a backup as soon as humanly possible, if only so that if you mess it up further while trying to repair any potential damage you can go back to the original less-broken state.
After backing up, you might run fsck to see if it thinks there’s any problems.

answered Sep 15, 2009 at 17:42

Steven Schlansker's user avatar

1

We had a server with a corrupted filesystem (reiserfs) and it generated directory entries with question marks for all the attributes except the filename. In our case, the filenames were unaffected.

Also, the free space was being reported incorrectly. Using du -sh /* we could only account for about 30G, but the drive was being reported as over 200G in use.

Rebooting the server with shutdown -rF now to force a file-system check did not work. I had to reboot into single-user mode and run:

fsck.reiserfs --rebuild-tree /dev/sda3

This almost worked. It got through a few passes, then locked up. Had to reinstall the OS.

Maintain your backups!

answered Nov 19, 2010 at 20:11

I’ve also seen this when running autofs but autofs can’t mount the directory. So then to figure out why it couldn’t mount the directory I disabled autofs and tried to mount the directory manually (this also allowed me to delete the directory). I tried mounting the directory manually and found that there was a permissions error. After fixing that, the directory returned to normal again.

answered Apr 24, 2013 at 19:56

Pace's user avatar

PacePace

2352 silver badges11 bronze badges

0

Watch out for other running processes on the server for example rsync

[root@server upload]# ls -la
ls: cannot access .3bfb3dc5-cb55-435f-8e23-2afcab2c6873_image4993891600240007749.jpg.bV6VTV: No such file or directory
total 194496
drwxr-x--- 2 gx apache    1382 Jan 11 10:36 .
drwxr-x--- 3 gx apache       3 Jan 11 10:29 ..
-rw-r--r-- 1 gx apache   94850 Dec 10  2015 37d355b9-210d-45df-8061-968ea5cb9f31_mob.jpg
...
-rw-r--r-- 1 gx apache   10864 Jul 24  2015 3bfb23bf-8ff5-4603-aa57-9b23ca498e2c_internet.png
-rw-r--r-- 1 gx apache   10864 Jul 24  2015 .3bfb23bf-8ff5-4603-aa57-9b23ca498e2c_internet.png.nHmIPk
-????????? ? ?  ?            ?            ? .3bfb3dc5-cb65-435f-8e23-2agcab2c6873_image4993891600240007749.jpg.bV6VTV

It generates temporary files that get created and dropped fast which will cause errors if you try to call other simple file management commands like rm, mv etc.

answered Jan 11, 2017 at 9:47

Marton Tatai's user avatar

Just to give a different perspective — I had this when I was programatically generating directories from a list directories in a file (in ruby).

Of course the line from the file came through as a string with a n on the end — which looked good and seemed to work. However as I started creating directories rather than being chomped it ended up creating two of each directory: /whatiwanted and /whatiwanted?.

answered Nov 9, 2015 at 14:42

Luke Pearce's user avatar

I sometimes see this as a transient error when an NFS server is heavily overloaded.

The OP asked about RAID but several answers mention NFS, and in fact that was the search that brought me here.

answered Sep 14, 2016 at 18:51

arp's user avatar

I have a WD 1 TB hard disk. Recently in some folders on the disk I began to observe pictures, similar to the following:

ls: cannot access 'dataset.py': Input/output error
ls: cannot access 'vgg.py': Input/output error
total 198728
drwxrwxrwx 1 master master      4096 Jul 21 17:23 ./
drwxrwxrwx 1 master master      4096 Aug 14 19:35 ../
drwxrwxrwx 1 master master      4096 Jun  9 10:11 data/
-????????? ? ?      ?              ?            ? dataset.py

I want to remove files like ‘dataset.py’ and backup data, with final step being disk formatting.

How to remove these malicious files?

asked Aug 15, 2020 at 7:23

mktplus's user avatar

4

Use smartmontools to doubleck your drive health. When having reallocated sectors or pending sectors p.e. duplicate the drive onto a healthy one.

On the duplicate have your file system verify its content completely.
If you have unreadable sectors, the file system will mark the clusters these sectors are located in.

You won’t have physical sector errors on the target drive anymore but you will loose the content of broken sectors on your source drive.

Then run run checkdsk Z: /f /r /x where Z denotes your drive letter on your target drive.

answered Aug 15, 2020 at 18:13

r2d3's user avatar

r2d3r2d3

2,4611 gold badge7 silver badges19 bronze badges

2

Read about mount/umount

In my case directory had be unmount, to be deleted itself or its subdirectories/files

sudo umount -f /media/sami/OS WIN7

Then simply sudo rm -rf sami/OS WIN7 worked for me

answered Jul 21, 2022 at 13:50

Sami's user avatar

SamiSami

1116 bronze badges

Понравилась статья? Поделить с друзьями:

Читайте также:

  • Low heat error xerox 3215
  • Lotus script on error
  • Lotro game error 128
  • Lost connection to mysql server at reading initial communication packet system error 104
  • Lost connection to mysql server at handshake reading initial communication packet system error 11

  • 0 0 голоса
    Рейтинг статьи
    Подписаться
    Уведомить о
    guest

    0 комментариев
    Старые
    Новые Популярные
    Межтекстовые Отзывы
    Посмотреть все комментарии