ls: cannot access *** Input/output error

Project:Linux software
Category:bug report
Related pages:#29: filesystem :-:-: #65: Troubleshooting a failing hard drive

I have an external USB drive. I can mount it and browse some of its directories.

However, when I try to browse a specific directory, I get:

ls: cannot access *** Input/output error



Related pages:+29: filesystem





Reboot with force fsck to check your filesystems
shutdown -F -r now



(Probably) the filesystem is corrupted.
I would copy/clone the the whole partition (using eg. dd) just to make data safe (don't forget to unmount the partition first).
Then you can experiment with one of the copies to recover the files and fix filesystem; try to run fsck, or this might help as well:
(photorec, testdisk)


with USB unless you have gone out of your way to write another file
system over the one you have then your friend is a little tool called


as long as it is not mounted

dosfsck /dev/sd.....

you change the dots for real life partition things

warning backup the rest of the key first - if it breaks you get to keep
all the pieces :-/


If you check the /var/log/messages and /var/log/dmesg you may find warnings re your disk.


Your harddrive may be failing. I would recommend backing up everything that is important just in case. If you are running Karmic, there is a utility called palimpsest which will check the SMART status of the drive and let you know if there are any bad sectors on the disk. System-->Administration-->Disk Utility is where it is located. You can also run the drive test utility made by the harddrive manufacturer (should be a free download from their website).




I couldn't find in Ubuntu , Debian and TLDP documentation anything about disk failure...


Installing smartmontools installed postfix as well, which I am sure I didn't configure properly when I was asked:

 # apt-get install smartmontools
Reading package lists... Done                                          
Building dependency tree                                               
Reading state information... Done                                      
The following extra packages will be installed:                        
  bsd-mailx mailx postfix                                              
Suggested packages:                                                    
  procmail postfix-mysql postfix-pgsql postfix-ldap postfix-pcre sasl2-bin resolvconf postfix-cdb
The following NEW packages will be installed:                                                    
  bsd-mailx mailx postfix smartmontools                                                          
0 upgraded, 4 newly installed, 0 to remove and 8 not upgraded.                                   
Need to get 1,891kB of archives.                                                                 
After this operation, 4,735kB of additional disk space will be used.                             
Do you want to continue [Y/n]? y                                                                 
Get:1 karmic/main postfix 2.6.5-3 [1,380kB]                         
Get:2 karmic/main bsd-mailx 8.1.2-0.20081101cvs-2ubuntu1 [166kB]    
Get:3 karmic/main mailx 1:20081101-2ubuntu1 [8,516B]                
Get:4 karmic/main smartmontools 5.38-3ubuntu2 [336kB]               
Fetched 1,891kB in 6s (299kB/s)                                                                                           
Preconfiguring packages ...                                                                                               
Selecting previously deselected package postfix.                                                                          
(Reading database ... 320225 files and directories currently installed.)                                                  
Unpacking postfix (from .../postfix_2.6.5-3_amd64.deb) ...                                                                
Selecting previously deselected package bsd-mailx.                                                                        
Unpacking bsd-mailx (from .../bsd-mailx_8.1.2-0.20081101cvs-2ubuntu1_amd64.deb) ...                                       
Selecting previously deselected package mailx.                                                                            
Unpacking mailx (from .../mailx_1%3a20081101-2ubuntu1_all.deb) ...                                                        
Selecting previously deselected package smartmontools.                                                                    
Unpacking smartmontools (from .../smartmontools_5.38-3ubuntu2_amd64.deb) ...                                              
Processing triggers for ureadahead ...                                                                                    
ureadahead will be reprofiled on next reboot                                                                              
Processing triggers for ufw ...                                                                                           
Processing triggers for man-db ...                                                                                        
Processing triggers for doc-base ...                                                                                      
Processing 1 added doc-base file(s)...                                                                                    
Registering documents with scrollkeeper...                                                                                
Setting up postfix (2.6.5-3) ...                                                                                          
Adding group `postfix' (GID 122) ...
Adding system user `postfix' (UID 114) ...
Adding new user `postfix' (UID 114) with group `postfix' ...
Not creating home directory `/var/spool/postfix'.
Creating /etc/postfix/
Adding tcp map entry to /etc/postfix/
Adding group `postdrop' (GID 123) ...
setting myhostname: Augustin
setting alias maps
setting alias database
mailname is not a fully qualified domain name.  Not changing /etc/mailname.
setting destinations: Augustin, localhost.localdomain, , localhost
setting relayhost:
setting mynetworks: [::ffff:]/104 [::1]/128
setting mailbox_size_limit: 0
setting recipient_delimiter: +
setting inet_interfaces: all
/etc/aliases does not exist, creating it.
WARNING: /etc/aliases exists, but does not have a root alias.

Postfix is now set up with a default configuration.  If you need to make
changes, edit
/etc/postfix/ (and others) as needed.  To view Postfix configuration
values, see postconf(1).

After modifying, be sure to run '/etc/init.d/postfix reload'.

Running newaliases
 * Stopping Postfix Mail Transport Agent postfix                                                                    [ OK ]
 * Starting Postfix Mail Transport Agent postfix                                                                    [ OK ]

Setting up bsd-mailx (8.1.2-0.20081101cvs-2ubuntu1) ...
update-alternatives: using /usr/bin/bsd-mailx to provide /usr/bin/mailx (mailx) in auto mode.

Setting up mailx (1:20081101-2ubuntu1) ...
Setting up smartmontools (5.38-3ubuntu2) ...

Processing triggers for libc-bin ...
ldconfig deferred processing now taking place


# e2fsck /dev/sdc1
e2fsck 1.41.9 (22-Aug-2009)
/dev/sdc1 contains a file system with errors, check forced.
Pass 1: Checking inodes, blocks, and sizes
Error reading block 162824194 (Attempt to read block from filesystem resulted in short read) while getting next inode from scan.  Ignore error<y>?

What am I supposed to answer? What is safe? What difference does it make?
man e2fsck didn't help much.


KDE Partition Manager 1.1 gains support for reading, analyzing and reporting the SMART status of disks. SMART (sometimes also written as S.M.A.R.T.) is an acronym for “Self-Monitoring, Analysis, and Reporting Technology”. In plain English it is a monitoring system for hard drives and its intention is to give the computer user a chance to take action before an impending hard drive failure — the action being to copy his data to another disk, of course.