Can ubuntu help me diagnose my hard drive?
January 13, 2010 4:12 PM   Subscribe

My desktop crashed, and won't boot windows xp from the hard drive. I managed to get into BIOS and set it to boot from the CD drive, and got a live session of ubuntu 8.10 running. I tried to mount the hard drive in ubuntu, but to no avail. Is there some sort of utility that ubuntu can run to look at or diagnose my hard drive?

I'm afraid it's just good and borked, because it's doind exactly what it did last time this happened. There are, naturally, lots of pictures on the hard drive that I'd like to salvage if possible. Because I didn't learn my lesson last time.

This is a custom-built computer, though it's about five years old. I have no idea what the chipset is, or any of the specifications, for that matter.

Thanks!
posted by Shohn to Computers & Internet (14 answers total) 3 users marked this as a favorite
 
FAT or NTFS? If it's NTFS you may need to specify that when you try to mount the drive.
posted by GuyZero at 4:20 PM on January 13, 2010


Response by poster: Appears to be NTFS. That's what the error message tells me is marked to be in use when I try to mount the drive from the GUI.
posted by Shohn at 4:33 PM on January 13, 2010


Get another hard drive. Use dd to back up your corrupted drive before you start experimenting. There are various suggestions that come up in Googling for "linux repair ntfs filesystem" or "linux repair fat filesystem" or "linux salvage fat files", and I have no idea how well they work, but it's a bad idea to try anything before backing up whatever is left.

First check that Linux can even recognize the disk: gparted should be on the live CD, and you should be able to at least see the disk and its partitions. (from the command line, fdisk can do the same thing)
posted by qxntpqbbbqxl at 4:42 PM on January 13, 2010


It won't normally mount if the NTFS "in use" flag is set, which is the problem you're having.

If you can boot in to windows safe mode (press F8 whilst booting) and then shut down properly, you'll be able to use your Ubuntu disk to mount it.

If you have the Windows installer CD you can boot from that and try:
fixboot
fixmbr
chkdsk /f c:
from the repair console.

Failing that, try the Trinity Rescue Kit which has some additional tools including ddrescue. There is some documentation on site, and google will help.
posted by dirm at 4:54 PM on January 13, 2010


if you got a live CD running, then you should be able to boot from your CD and get into chkdsk and do a /r.

as long as the disk is spinning, you should be able to salvage you stuff. Next, custom build yourself a WHS (the cracks are on TPB). Disk Duplication is the way to go there. If nothing here works, PM me and I'll work with you via email or chat or whatever.

curt
posted by Davaal at 8:25 PM on January 13, 2010


qxntpqbbbqxl: “Get another hard drive. Use dd to back up your corrupted drive before you start experimenting. There are various suggestions that come up in Googling for "linux repair ntfs filesystem" or "linux repair fat filesystem" or "linux salvage fat files", and I have no idea how well they work, but it's a bad idea to try anything before backing up whatever is left.”

Well, first off, my experience is that the Linux ntfs-serving programs can often work very well. They are to be found in a bundle called ntfsprogs, and the command you want is

ntfsfix /dev/sda1

... substituting your hard-drive device for /dev/sda1, of course.

However: though I am of caddis' mind as far as the Windows/Linux thing (typing this in Ubuntu right now, thank you very much) I really don't think Ubuntu should be what you're fooling with right now. That's a neat live CD, I know, but it's a huge memory hog, and it doesn't at all have the tools you need to fix this. I'm not surprised you couldn't mount the drive - that's probably because the specialized drivers Ubuntu usually uses for that sort of thing aren't in the lite version that runs on the live CD. The live CD isn't supposed to be a diagnostic or maintenance tool - it's meant for installation, and not much more. I am, of course, hoping that you have access to another computer, and can download and burn other CDs besides the Ubuntu disk. (If you're just stuck with the Ubuntu, well... we can try on that front, but I urge you to get thee to a Kinko's or something where you can burn a disk.)

What you need is to run the Windows utility chkdsk. Now, in this situation people (mostly Microsoft, in fact) will always recommend that you use the Windows system cd, but none of us keep those sorts of things around for five years, so I know how you feel in not having it. Don't worry - it's not necessary. What you want is the Ultimate Boot CD, or UBCD, a neat little collection of Windows and Linux boot utilities all collected on one disk. Download it here, burn it to disk, and boot your computer from that disk.

I'll be honest: it's been a while since I booted from UBCD, but a year ago when I had cause to use it frequently it was a life-saver. As I recall, you can often use its bootloader to simply boot up into your hard drive even when the hard drive doesn't want to boot itself. Though I can't guide you through the options at the moment, I can tell you this: the option you want, again, is chkdsk. Boot the UBCD, find chkdsk, and run it - this will check and fix your hard drive memory, if possible. If that doesn't work, or if you can't find chkdsk, let me know, and I will see what I can do.

Good luck.
posted by koeselitz at 5:30 AM on January 14, 2010


Oh, and by the way: Ubuntu mounts NTFS drives like a dream (again, my computer dual-boots, and I mount the NTFS partition every morning without any trouble) but it will almost never mount NTFS drives from a live CD, at least in my experience. I don't know why this is - honestly I never had reason to try to find out. If you're dying for a Linux live CD that's awesome, and can do this kind of thing, what you want is Knoppix, a live CD built for diagnostics and maintenance that runs a pretty awesome full system (and can easily mount NTFS drives).

In fact, Knoppix might be a very good option for getting your data back. If you'd like to try, just download the ISO (remember: only download version 5.3.1, and not 6.0.1, as the latter version is a spotty rebuild that doesn't work quite as well) burn it to a disk, and boot your computer from it. When booting, use the special option TORAM - this will copy the live CD to your computer's RAM, so once it's done booting you can take the CD out of the drive, mount your hard drive, put in a blank CD, and burn all the pictures you want to save to a CD. This is often (for me at least) the easiest way to save stuff in this situation.

Let me know if that's something you want to try. In the mean time, of course, we're talking NTFS, so we focus on Windows solutions: grab that UBCD and run chkdsk, and we'll see what happens.
posted by koeselitz at 5:47 AM on January 14, 2010


Response by poster: This is some good stuff, and exactly the kind of information I need. I'm computer-savvy enough to usually get myself into trouble, by which I mean not that savvy at all.

I've been running ubuntu on my laptop, and I had the disk so thought I'd see if I could get it to boot on the crashed desktop, to see if I could find some signs of life. I just don't know where to go from there, basically. I'll try the UBCD as soon as I get the chance.

FWIW, I can't get windows to boot at all, in safe mode or anything. The thing was fine Saturday night, was left running overnight, then was in a seemingly endless cycle of trying to boot on Sunday morning. I guess windows could have gone wonky for some reason, but I'm not getting a BSOD or anything when it tries to boot. I'm fairly certain that the guy who installed the hard drive put in a used one (which I didn't complain about at the time because he gave it to me and installed it for free), but I won't go that route again.
posted by Shohn at 5:47 AM on January 14, 2010


Shohn: “FWIW, I can't get windows to boot at all, in safe mode or anything. The thing was fine Saturday night, was left running overnight, then was in a seemingly endless cycle of trying to boot on Sunday morning. I guess windows could have gone wonky for some reason, but I'm not getting a BSOD or anything when it tries to boot. I'm fairly certain that the guy who installed the hard drive put in a used one (which I didn't complain about at the time because he gave it to me and installed it for free), but I won't go that route again.”

Yeah - I figured that was probably what happened from the way you phrased your question. The standard solution is indeed chkdsk; the hope, of course, is that you've got some corrupted memory, which certainly can prevent the machine from booting up at all if it's in the right place. In fact, that's really what this sounds like - it doesn't sound like there's physical damage to the drive, anyway - and that means there's hope for fixing it.
posted by koeselitz at 6:01 AM on January 14, 2010


You dont need to boot into safe mode to run chkdsk. You can boot your windows disc to the recovery console and run it from there.

Download it here, burn it to disk, and boot your computer from that disk.


He will need a working Windows install to create the iso. UBCD4WIN isnt distributed as an iso, its an installer that creates an iso after configuration and acquiring a windows license, which may require the windows disc if the proper files are not on the machine.
posted by damn dirty ape at 7:00 AM on January 14, 2010


Also you can download just the recovery console here.
posted by damn dirty ape at 7:05 AM on January 14, 2010


Response by poster: I finally got around to booting the recovery console that damn dirty ape linked to (I couldn't seem to write the UCBD for some reason). All I got from chkdsk was, "the volume appears to contain one or more unrecoverable errors." I got the same result from chkdsk /R.

I think I'm going to buy a new hard drive and install ubuntu on it. The incredibly bitter IT guy at work has offered me some sort of cable which may allow me to connect the borked hard drive to a USB port so I can try to get the files off it.

Thanks for all the help.
posted by Shohn at 3:39 PM on January 17, 2010


damn dirty ape: “He will need a working Windows install to create the iso. UBCD4WIN isnt distributed as an iso, its an installer that creates an iso after configuration and acquiring a windows license, which may require the windows disc if the proper files are not on the machine.”

Argh. I always forget that new UBCD4WIN thing, which isn't what you want.

What I meant to link to is the original UBCD411, which is indeed available as an ISO. The instructions I gave above will work just fine if you download UBCD from here. But that Recovery Console ISO that dda linked to is really all you need, so you should probably just go with that.

Hope some of this has helped.
posted by koeselitz at 3:42 PM on January 17, 2010


Synchronicity! I was just coming back to check on this thread - and we're both here at the same time.

Glad you found a solution of some kind anyway, Shohn. Hope everything works out in the end.
posted by koeselitz at 3:44 PM on January 17, 2010


« Older USB Hub recommendations wanted!   |   Re-enactments or transcripts of the Proposition 8... Newer »
This thread is closed to new comments.