Results 1 to 9 of 9

Thread: rm cannot remove file: Input/output error

  1. #1
    Join Date
    Jul 2006
    Location
    Antwerp, Belgium
    Beans
    27
    Distro
    Ubuntu 9.10 Karmic Koala

    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.

  2. #2
    Join Date
    Apr 2008
    Location
    /jordan.d
    Beans
    137

    Re: rm cannot remove file: Input/output error

    can you remove the directory "rm -fr" ?
    what is the output of
    Code:
    echo $?
    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.’

  3. #3
    Join Date
    Jul 2006
    Location
    Antwerp, Belgium
    Beans
    27
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: rm cannot remove file: Input/output error

    Quote Originally Posted by mkrahmeh View Post
    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

    what is the output of
    Code:
    echo $?
    Code:
    $ echo $?
    1

  4. #4
    Join Date
    Apr 2008
    Location
    /jordan.d
    Beans
    137

    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
    Code:
    file file_name
    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.’

  5. #5
    Join Date
    Jul 2006
    Beans
    890
    Distro
    Ubuntu 11.04 Natty Narwhal

    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.

  6. #6
    Join Date
    Jul 2006
    Location
    Antwerp, Belgium
    Beans
    27
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: rm cannot remove file: Input/output error

    Quote Originally Posted by mkrahmeh View Post
    what is the output of
    Code:
    file file_name

    Code:
    $ file .IMG_8854.JPG.yyDFPb 
    .IMG_8854.JPG.yyDFPb: ERROR: cannot open `.IMG_8854.JPG.yyDFPb' (Input/output error)

    Quote 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
    Quote 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.
    Quote 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.

  7. #7
    Join Date
    Mar 2008
    Beans
    4,714
    Distro
    Ubuntu 9.10 Karmic Koala

    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

  8. #8
    Join Date
    Jul 2006
    Beans
    890
    Distro
    Ubuntu 11.04 Natty Narwhal

    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.

  9. #9
    Join Date
    Apr 2008
    Location
    /jordan.d
    Beans
    137

    Re: rm cannot remove file: Input/output error

    Quote Originally Posted by unutbu View Post
    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
    Code:
    e2fsck /dev/drive
    supposedly the filesystem is ext2 or ext3

    it 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.
    gl
    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.’

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •