Got Linux To Recognize Failing Drive but don't know how to use linux

Discussion in 'Hardware' started by becolt, Sep 30, 2012.

  1. becolt

    becolt Private E-2

    Hi -
    Been a tough week for my data. I have an external drive that windows won't recognize the file system on and I've tried a bunch of different routes, even a quick format (in order to later undelete) wouldn't complete successfully. Today I gave a second try to getting a Ubuntu cd to boot and recognize the drive and it did, I can see the folder structure and some of the files but nothing deeper than the main folders. Thought it would be a good opportunity to run testdisk to try and repair things so I can copy them over to a new drive but for the life of me I can't figure out how to run a simple program. I THINK the program file is testdisk_static, but double-clicking it does nothing. So lost. What I've read online makes me think I have to run programs from a command prompt, but I can't find out how to get there or what to do if I do.

    Also tried to figure out ddrescue to make a clone, but that was even worse.
     
  2. gvstn

    gvstn Private E-2

    I don't have a real answer to using Ubuntu so maybe someone else will answer.

    I was unable to get testdisk to install on ubuntu. I have been able to install it on Puppy Linux and it also is already installed on Parted Magic linux. If you have another blank CD, you could try one of those two Linux distros to use testdisk.

    But I am wondering why you can't access all your files on the external from the regular Ubuntu file manager. Are you saying you can get into the main folders and then there are files missing in them or that you can't get into the folders?
     
  3. gvstn

    gvstn Private E-2

    I now just figured out how to install testdisk on Ubuntu but it is rather convoluted.

    You have to edit /etc/apt/sources.list to add the two lines below to the end of the file.

    Code:
    deb http://us.archive.ubuntu.com/ubuntu/ precise universe
    deb http://us.archive.ubuntu.com/ubuntu/ precise-updates universe
    
    Then run the command to update the system with the new code:

    Code:
    sudo apt-get update
    Then run the command to iinstall testdisk:
    Code:
    sudo apt-get install testdisk 
    Then run testdisk or photorec using the command:

    sudo testdisk
    or
    sudo photorec

    If you want details on how to navigate those commands let me know.
     
  4. becolt

    becolt Private E-2

    It's strange, really. For a week and a half the disk had been showing up as "F: local disk" (inaccessible, needs formatting) then this afternoon on a whim I booted from the linux disk and there it was as Seagate FreeAgent. The main files and folders in the root were visible, as were the next level of folders/files - nothing below that. Tried copying to a new drive and some things copied but everything had a size of 0 bytes.
    (now after OP)
    Then I switched to windows and suddenly everything was there. I spent about 30 minutes copying what I could in between it suddenly not being recognized again. After a few moments it would pop back in and be ok to copy some things. Managed to get about 675Mb from one of the most important folders, took a dinner break, and now it's back to being recognized as Local Disk. Properties when it's in this state show up as raw, 0b free, 0b used.
    Starting to wonder if it's heat related, but who knows.
     
  5. gvstn

    gvstn Private E-2

    Rewriting the partition table with testdisk might help, but I am unsure. It is strange that it would go from recognized to unrecognized while still connected.

    One thing you could do is run testdisk from Windows. Since the HD itself is recognized testdisk can still be run even though Windows says it is RAW. Testdisk should see the files and may be able to let you copy them.

    I would use the copy function before doing anything with the partition table. I'm unfamiliar with Photorec but a quick look shows that it may be the program you actually want to use as it may be more straight forward for copying than testdisk. Try copying one of the files that came as 0 bytes and see if it copies as its true size.
     
  6. becolt

    becolt Private E-2

    Oh wow, well that proves to me it is in fact possible to do... stuff.
    Heh, my next sentence is either going to make you laugh or want to smack me, maybe both :)

    I have no idea where to edit anything in linux, with the exception of file and folder names. Then again, equally as bad: I couldn't find a place to run a command either.
    I wonder if the drive suddenly working(and then not working) was unrelated to the OS entirely.

     
  7. becolt

    becolt Private E-2

    Yeah in my attempts with Testdisk under windows I could get as far as finding the drive, but it would never find a partition table til today, then it couldn't find any files though. It's like the drive can't decide what it's doing.
    Forgot the step in between using ubuntu and windows: repeated "failed to write file f:\$mft" etc due to I/O error.
    I'll definitely have to look into photorec in the morning if the drive stays unrecognized.
    One bright spot is that what I WAS able to transfer represents the last 8 months of work doing sound design. Huge weight lifted off my shoulders with that one.
     
  8. gvstn

    gvstn Private E-2

    Hmm, interesting that testdisk didn't find any partitions; it usually does even when Windows doesn't.

    One other program you could try for data recpvery is PowerDataRecovery. This is an older version that is free if you tick the box for "I am a home user" when the program first starts.

    It takes quite a while, you might want to let it run overnight and see what it finds.

    I doubt testdisk under Ubuntu will be more effective but I'll give you the basics on installing testdisk (Be aware it will not remain installed between boots since you are running off of a CD. So it has to be reinstalled if you shutdown.)

    Editing the sources.list file can be done by opening the file manager and towards the bottom left is a link for "FileSystem" which will open the main Linux folders. Then navigate to etc and then apt folder. Rightclik the sources.list file and select edit. Copy/paste the two lines and Save the file.

    Opening Terminal will give you a command prompt. Click on the top icon on Ubuntu desktop (Dash Home is the name). Type in "terminal" and then click the terminal icon to oen a command prompt. You can copy and paste those other commands in there.
     
  9. gvstn

    gvstn Private E-2

    I just realized that using the file manager method to try to edit sources.list won't let you savve the changes. Instead start Terminal and use the following command to open the file in the text editor:

    Code:
    sudo gedit /etc/apt/sources.list
     
  10. becolt

    becolt Private E-2

    Well it looks like ubuntu is now refusing to recognize the disk again because of a corrupt mft / i/o errors.
    I'm considering trying to get testdisk to write an mbr in there, but who knows if that will make things worse. phoo.
     
  11. gvstn

    gvstn Private E-2

    I don't think rewriting the MBR will make any difference. Testdisk writes a very compatible MBR so I don't think it will do any damage. I've never had a testdisk MBR not be recognized.

    However, you seem to be having problems with the Master File Table which is different than the MBR. It could be a corrupted file or it could be a failing HD. The I/O errors suggest a bad drive.

    From this link: http://www.cgsecurity.org/wiki/Advanced_NTFS_Boot_and_MFT_Repair
    So testdisk is saying try running a chkdsk from within Windows first, and if that fails then try to rewrite the MFT using testdisk. It depends if your Windows machine will recognize the partition again whether or not chkdsk is an option. If it is an option then I would just do the filesystem check and skip the surface/sector scan since that HD is going from recognized to unrecognized faster than the time it may take to complete a surface scan.

    I've never used testdisk's MFT repair but I have tried their boot sector repair and have never had it actually be able to use the backup file. It couldn't hurt to see what it says about the MFT backup's integrity. After the integrity check you still get an option to say No to overwriting the original file.
     
  12. becolt

    becolt Private E-2

    Oh I was obviously confused about the difference between the MFT and MBR - though to my credit I do remember thinking it seemed more likely that the partition table and master file table were the same or similar things. To be honest I think it may have been the testdisk walkthrough page that confused the crap out of me. :)
    Ah, I've been very gun-shy about chkdsk because I kept reading horror stories about it deleting people's files.
    Yeah I got ubuntu to recognize the disk again a few hours ago after a few attempts - I'd finally figured out where terminal was, and in my searches found the command "sudo fdisk -l" to list the drive attributes. Unplugged the drive and reinserted, ran that command after it gave me its version of an i/o error message and suddenly the drive was recognized and I was able to copy some files(not 0 bytes either). Eventually it failed fully, rather than intermittently and I switched back to windows, where it was recognized again for around 45 minutes. It would fail during a transfer, saying the path doesn't exist, I'd wait about a minute, and there's the drive again.
    When it does it's larger failure it switches on and off between the local disk designation and an icon of a hard drive with ...I think it's a little red minus sign.
    Seems almost like it's getting powered off on the usb end. I say there, because the drive doesn't spin down while this is going on, it's just the connection being lost.
    Hm, couldn't be my usb card, could it? I guess that doesn't really make sense as the new drive is fine. Thinking out loud.
     
  13. gvstn

    gvstn Private E-2

    I just don't have much first-hand experience with external HD. I've seen so many posts like yours that I have never trusted them. I always add extra internal drives since I have little need to transfer large files between computers.

    That said there is always the possibility of removing the HD from the USB enclosure and adding the SATA HD contained within to your computer internally (assuming your computer has an extra SATA connection and cable). This would eliminate the USB connection. Depending on whether it is the HD itself that is failing or a problem with the USB connection this may help.

    The partition table is contained in the MBR but rebuilding the MBR doesn't change the partition table. The partition table is considered separate and is not effected by rebuild MBR commands. I think your partition table is good because the partition is usually seen (you have a drive letter in Windows but no files on it) but the filesystem is what is not being recognized.

    Take a look at powerdatarecovery I linked to earlier. It should try to find files independent of the MFT. They may be a bit randomly grouped but it seems to be a good program much like GetDataBack which was the old standard.
     

MajorGeeks.Com Menu

Downloads All In One Tweaks \ Android \ Anti-Malware \ Anti-Virus \ Appearance \ Backup \ Browsers \ CD\DVD\Blu-Ray \ Covert Ops \ Drive Utilities \ Drivers \ Graphics \ Internet Tools \ Multimedia \ Networking \ Office Tools \ PC Games \ System Tools \ Mac/Apple/Ipad Downloads

Other News: Top Downloads \ News (Tech) \ Off Base (Other Websites News) \ Way Off Base (Offbeat Stories and Pics)

Social: Facebook \ YouTube \ Twitter \ Tumblr \ Pintrest \ RSS Feeds