Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Files with I/O Errors preventing access to full folders?

  1. #1
    Join Date
    Feb 2013
    Beans
    24

    Question Files with I/O Errors preventing access to full folders?

    So here's the story: I had a hard drive using Win 7 fail on me recently. I was able to salvage my Documents before it failed completely but my Pictures are still stuck on there. As of now, i cannot boot from my HDD, so I burned Xubuntu 12.10 to a CD and booted from there.

    When trying to move the files to an external hard drive, i receive the error "Error when getting information for file '/media/...xxx.mp3' (or whatever the file happens to be) and it's detailed as an "Input/output error."

    There's no doubt that this is due to bad sectors on the disk. When commanding dmesg, i receive:
    Code:
    end_request: I/O error, dev sda, sector 50748707
    Buffer I/O error on device sda3, logical block 2493348
    ata1: EH complete
    Thing is, these bad sectors are also preventing me from opening folders. If i try to open a folder with a bad document directly in it (not in a subfolder), an error message displays "Failed to open directory "Folder" and it's because of the bad file.

    This is preventing me from viewing all the GOOD files. I'm not too worried about these bad files individually, but might there be a way that i can open the folder without putting on the other files at risk?

    If there's anymore information you need, let me know. My vocabulary with this stuff is pretty limited.

  2. #2
    Join Date
    Feb 2013
    Beans
    Hidden!

    Re: Files with I/O Errors preventing access to full folders?

    Do command-line tools from the ntfsprogs suite work on your Windows drive? I mean, can you browse those folders with ntfsls and see the contents of files from there with ntfscat?
    Last edited by schragge; February 17th, 2013 at 12:54 AM.

  3. #3
    Join Date
    Feb 2013
    Beans
    24

    Re: Files with I/O Errors preventing access to full folders?

    I may be doing this wrong, but I can write click the folder and click "Open Terminal Here."

    This is what is displayed, commanded, and returned:

    Code:
    xubuntu@xubuntu:/media/xubuntu/OS/Users/Username/Music/Album$ ntfsls -a
    *mp3
    NTFS signature is missing. Failed to mount 'song.mp3': Invalid argument
    The device '10 Wasteland.mp3' doesn't ave a valid NTFS.
    Maybe you selected the wrong device? Or the whole disk instead of a
    partition (e.g. /dev/hda, not /dev/hda1)? Or the other way around?
    Like i said, i'm very illiterate when it comes to this, so I may be doing it wrong.
    Also, if it's done in a folder with subfolders, this will return:

    Code:
    Usage: ntfsls [options] device
    
    -a, --all Display all files -F, --classify Display classification...

    Etc..

  4. #4
    Join Date
    Feb 2013
    Beans
    Hidden!

    Re: Files with I/O Errors preventing access to full folders?

    Yes, you're doing it wrong. You should specify device as argument for ntfsls. To get the device name of your Windows drive, try
    Code:
    findmnt -no source /media/xubuntu/OS
    That should be something like /dev/sda1. When you know the device name, do
    Code:
    ntfsls -p Users/Username/Music/Album /dev/sda1
    Update.
    No need to go to the folder in file manager. You can simply launch the terminal (Ctrl+Alt+t) and issue the commands. Your Windows drive can even stay unmounted.
    Last edited by schragge; February 17th, 2013 at 03:37 AM.

  5. #5
    Join Date
    Feb 2013
    Beans
    24

    Re: Files with I/O Errors preventing access to full folders?

    Alright, so these are the results...

    Code:
    findmnt -no source /media/xubuntu/OS
    /dev/sda3
    Code:
    ntfsls -p Users/Username/Music /dev/sda3
    Access is denied because the NTFS volume is already exclusively opened.
    The volume may already be mounted, or another software may use it which 
    could be identified for example by the help for the 'fuser' command.
    You can use force option to avoid this check, but this is not recommended
    and may lead to data corruption.
    I thank you ahead of time for your patience with me.

  6. #6
    Join Date
    Feb 2013
    Beans
    Hidden!

    Re: Files with I/O Errors preventing access to full folders?

    I never used a LiveCD for any Ubuntu flavor, thus I'm not sure how it works. I guess it mounts your Windows drive when you click on it in the file manager. Then don't do it.

    You also can try the --force option of ntfsls, it should be safe because ntfsls doesn't change anything on the drive.
    Code:
    ntfsls -fp Users/Username/Music /dev/sda3

  7. #7
    Join Date
    Feb 2013
    Beans
    24

    Re: Files with I/O Errors preventing access to full folders?

    I attempted to force it but i got...

    Code:
    Forced to continue.
    Error opening '/dev/sda3': Permission denied
    Failed to mount '/dev/sda3': Permission denied

  8. #8
    Join Date
    Mar 2010
    Location
    India
    Beans
    8,175
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Files with I/O Errors preventing access to full folders?

    Since your disk contains bad sectors, which may get worse with each attempt to access files, I suggest you create a partition image first using testdisk.

    You can install and run it from the live session, and use it to store the image on an external drive. Later you can use the same image with testdisk/photorec to recover files from it. To install -
    Code:
    sudo apt-get install testdisk
    On a live session, you may have to run apt-get update before running above, while you are connected to internet.

    To run it-
    Code:
    sudo testdisk
    The image option is under 'Advanced' option of testdisk.

    Testdisk Image creation guide - http://www.cgsecurity.org/wiki/Image_Creation

    PS:
    By the way, you need to use 'sudo' with ntfsls command to get exclusive lock to the partition. But I don't think it would do anything more than what thunar (the file manager in xubuntu) is already doing for you - that is - listing the directory/partition contents as much as possible.

    I don't have extensive knowledge about these file managers, but I do know that they use the same or better utilities in the background to give you access to certain filesystems.

    So if normal terminal commands can't access the files, then ntfsprogs commands won't either.

    In any case, it is best that you create an image, then you can safely try whatever you want.
    Varun
    Help others by marking threads as [SOLVED], if they are. (See how)
    Wireless Script | Use Code Tags
    Am I not replying your post? This is why.

  9. #9
    Join Date
    Feb 2013
    Beans
    24

    Re: Files with I/O Errors preventing access to full folders?

    The link you posted doesn't seem to be available for me on either of my computers.. Although i haven't been able to get wireless working on the laptop running Xubuntu, i was able to install testdisk using an ethernet cable.

    Code:
    Select a media:
    >Disk /dev/sda - 320 GB / 298 GiB - ST9320325AS
    >Disk /dev/sr0 - 726 MB /693 MiB (RO) - Optiarc DVD+/-RW AD-7700H
    I'm still trying to get that link you posted to load...
    How do i know if the listed disks have the correct size?

    EDIT: I was able to load the cached version of the link you posted. I was able search for partitions and this is what i received:

    Code:
    Disk /dev/sda - 320 GB / 298 GiB - CHS 38914 255 63
    
         Partition                  Start        End    Size in sectors
    
     1 * FAT16 >32M               0   1  1     4 254 60      80259 [DellUtility]
     2 P HPFS - NTFS              5  25 21  1917  84 23   30720000 [RECOVERY]
     3 P HPFS - NTFS           1917  84 24 38913  48 31  594338480 [OS]
    
    
     [  Quit  ] >[Deeper Search]  [ Write  ]
                              Try to find more partitions
    None of these are listed as specific partitions, but am i okay to Write?
    Last edited by SineSpe; February 24th, 2013 at 01:36 AM.

  10. #10
    Join Date
    Mar 2010
    Location
    India
    Beans
    8,175
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Files with I/O Errors preventing access to full folders?

    Yes, the server at cgsecurity was down the moment I posted the link, but I was confident with the link so posted it anyway. It is working now, sorry for any inconvenience.

    However, you do not need to do this-
    Quote Originally Posted by SineSpe View Post
    None of these are listed as specific partitions, but am i okay to Write?
    That option is meant for recovering lost partitions, while yours are already accessible.

    You have to use testdisk only for image creation, and later, if other attempts fail, use photorec which is part of the same testdisk package to recover files.

    So precisely, I referred testdisk only for imaging - to be extra safe. Let me know once the image is created, or if you need help with that.

    To just copy the data whrever possible, there are many tools, of which "safecopy" (commandline utility) seems most straightforward to me. But I haven't ever tried it myself, so can't say how reliable it really is.
    Varun
    Help others by marking threads as [SOLVED], if they are. (See how)
    Wireless Script | Use Code Tags
    Am I not replying your post? This is why.

Page 1 of 2 12 LastLast

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
  •