Cannot Access File: Input/output Error

Home » CentOS » Cannot Access File: Input/output Error
CentOS 3 Comments

I have a file on a backup usb drive that I get the following error:

# ls -ls P*
ls: cannot access Power usage.xls: Input/output error

How can I delete this file so that the nightly backup will write out the current version to the backup drive?

I tried:

# rm -f Power\ usage.xls rm: cannot remove `Power usage.xls’: Input/output error

Which you can see did not work.

thanks

3 thoughts on - Cannot Access File: Input/output Error

  • I have a file on a backup usb drive that I get the following error:

    # ls -ls P*
    ls: cannot access Power usage.xls: Input/output error

    How can I delete this file so that the nightly backup will write out the current version to the backup drive?

    I tried:

    # rm -f Power\ usage.xls rm: cannot remove `Power usage.xls’: Input/output error

    Which you can see did not work.

    thanks

    _~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    See if OpenOffice or LibreOffice has the file open. The temp file name should have tilde in front of it. For example, ~Power usage.xls. Delete that file and that may resolve the input/output error.

    Best regards,

    James

  • You mention this is a USB drive. Input/output error means something is wrong. Possibly seriously.

    The blkid command should tell you if this is a FAT32 file system or some flavor of file system. It will also tell you the device being mounted. Eg. /dev/sdc1

    If it is FAT32, you would want to unmount it and plug it into a Windows box and run chkdsk or scandsk on it. If it has been formatted to a Linux type file system, unmount it and use fsck to scan the disk for errors with a command similar to “fsck /dev/sdc1”. Again blkid or “df -k -l” will tell you the device name. Make sure the device is unmounted when you run fsck or bad things will happen to your data.

    You might also want to try “smartctl -a /dev/sdc”
    This will give you warnings if the disk is beginning to fail. Again, I am using /dev/sdc as an example.

  • also, dmesg | grep sdc

    to see what physical errors were logged. (replacing sdc with whatever the physical device name is, without any partition number).