• Welcome to Overclockers Forums! Join us to reply in threads, receive reduced ads, and to customize your site experience!

HDD failing

Overclockers is supported by our readers. When you click a link to make a purchase, we may earn a commission. Learn More.

Zerix01

Member
Joined
Mar 12, 2007
I am fixing my fathers computer. I was getting sick of dealing with Windows and the crapware my step sister was getting on it so I installed Kubuntu 7.04 on it, a week later I get a call saying the computer is not booting. When I turn it on it just hangs at loading Grub. I also remember when installing Kubuntu the installer hung while formating the drive the first time but completed fine after the second time.

This is feeling like a failing hard drive to me. I booted the computer from the Kubuntu Live cd and ran

dd if=/dev/zero of=/dev/sda
(Warning to those that don't know, this wipes out everything on the drive)

to write all zeros to the disk and basically check for bad sectors. It stopped at 6.4MB's with an input/output error. To me this confirms my initial thoughts, but I'm going to put the drive in my computer and enable SMART and try dd again and what ever else I can think of.

Does anyone have any other Linux based methods of checking for hard drive failure?
 
fsck is what you should use. There are options in it (see man fsck) to do full surface scans, mark bad sectors, etc. You probably need a filesystem first... not sure... but if so, that's easy enough (mke2fs /dev/sda will format it with an ext2 filesystem, mke2fs -j /dev/sda will format it with an ext 3).
 
Bad sectors means the drive's going out. Even if you map them there's a high chance of more popping up soon.
 
Sometimes... not always. I've found drives with bad sectors where the rest of the drive stays fine for many years.
 
This is like the fifth time I see people posting about HDD trouble without posting the SMART parameters. SMART WILL tell you if your HDD is semi good or horrible. It is the THING you check when your HDD does bad stuff.

Use mhdd(low system HDD access), get the SMART log, check it up there.
 
I haven't had a whole lot of time to work on this issue (car issues trump computer issues). I did get the drive into my computer but I can't seem to access it in any way. I have smartmontools installed but it does not see the drive. I tried fdisk and it tells me no such device. This is the first time I've had an SATA drive connected to this computer, but the BIOS does see the drive and gave me a brand and a model and when I check KDE's version of a device manager (I'm at work and forgot what it is called, K something, ha) it shows me the drive connected on my SATA 3 port (which it is). But software wise I can't seem to see it, even in the dev folder I don't see sdc or any sd devices. Also Kubuntu took a long time to start after connecting that drive, I later booted the system without the splash screen on and I saw lots of device errors related to that drive. Even when I got to the command prompt they were still scrolling across the screen, this made it very hard to type commands :mad: .

So you see I'm trying to get SMART status but I can't. I guess I should have tried that before dd'ing the drive, but the drive being blank should not be causing these issues.
 
This likely means that you don't have a driver for your SATA adapter built into the kernel. You need to rebuild the kernel, or try a livecd that might already have a kernel with support for it.
 
Zerix01 said:
I haven't had a whole lot of time to work on this issue (car issues trump computer issues). I did get the drive into my computer but I can't seem to access it in any way. I have smartmontools installed but it does not see the drive. I tried fdisk and it tells me no such device. This is the first time I've had an SATA drive connected to this computer, but the BIOS does see the drive and gave me a brand and a model and when I check KDE's version of a device manager (I'm at work and forgot what it is called, K something, ha) it shows me the drive connected on my SATA 3 port (which it is). But software wise I can't seem to see it, even in the dev folder I don't see sdc or any sd devices. Also Kubuntu took a long time to start after connecting that drive, I later booted the system without the splash screen on and I saw lots of device errors related to that drive. Even when I got to the command prompt they were still scrolling across the screen, this made it very hard to type commands :mad: .

So you see I'm trying to get SMART status but I can't. I guess I should have tried that before dd'ing the drive, but the drive being blank should not be causing these issues.


Grab a floppy, grab a copy of mhdd and then boot into mhdd. If your BIOS can see the HDD, that means that mhdd will have absolutely no problem seeing it.
So far the only time when mhdd failed me was when the HDD was totally dead.
 
MRD said:
This likely means that you don't have a driver for your SATA adapter built into the kernel. You need to rebuild the kernel, or try a livecd that might already have a kernel with support for it.

I'll look into that but last I knew the Nvidia 590 chipset has full support.
 
ShadowPho said:
Grab a floppy, grab a copy of mhdd and then boot into mhdd. If your BIOS can see the HDD, that means that mhdd will have absolutely no problem seeing it.
So far the only time when mhdd failed me was when the HDD was totally dead.

Thanks I'll try that out when I get more time for this.
 
I'll look into that but last I knew the Nvidia 590 chipset has full support.

Just because the kernel supports it doesn't mean it is built into the kernel. That just depends how the individual that built that particular kernel configured it. For example, my kernel that I am running on this computer only supports my hardware, nothing else, as I turned off all the other options before I compiled it. It's kernel 2.6.20, so obviously it supports a lot more hardware, but this particular kernel hasn't been configured to do so.

Check your kernel config and see if your SATA adapter is built in. It should be built in and not modular (it can't reach the disk to load the module if it can't access the drive... so SATA adapters must be built in). If it's not, just select it (not as a module) and rebuild the kernel and copy it to your boot directory, and it should work.

I'm alsmost certain this is the problem. If bios recognizes the drive, even if it's totally dead otherwise, Linux should too if the driver is built into the kernel.
 
Kubuntu definitely has support for SATA and uses an initramfs/initrd to get past the chicken and egg problem of not having support for every single filesystem type or HD interface built directly into the kernel. (SATA, SCSI or RAID). Because the drivers for these are on the filesystem, the OS can't boot without the drivers, since the filesystem can't be reached...so it boots into the initrd/initramfs wherein all needed drivers to boot the system are loaded, and then continues with normal boot events thereafter. :)
Almost all distros work this way, if you do not compile your own, and just use the stock kernel. Gentoo obviously does not need an initramfs, since you build your own during the install anyways. EDIT: (Although I guess genkernel would require an initramfs.) :)
 
Last edited:
Genkernel does, yes.

It isn't a question of supporting SATA. It's a question of whether support for that particular SATA controller is present. It may not be, even with an initrd. The problem just sounds so much like an SATA driver issue.
 
Or the drive's so dead that it's not being detected... 'lots of device errors', anyone?
 
MRD said:
Genkernel does, yes.

It isn't a question of supporting SATA. It's a question of whether support for that particular SATA controller is present. It may not be, even with an initrd. The problem just sounds so much like an SATA driver issue.

I see.
Well, with the 590 chipset, his kernel should need the "sata_nv" module, unless there is a different controller onboard... I don't use Kubuntu, but I would almost guarantee it is in there, since it's such a popular module.
 
Or the drive's so dead that it's not being detected... 'lots of device errors', anyone?

In that case, the bios almost certainly wouldn't recognize it, but the bios does see it.

The other possibility is that it's not loading the correct module because it's not correctly figuring out which to load... so you might have to build it in.
 
I just wanted to follow up on this. SATA support was no issue in my kernel btw.

The drive was very much dead, I think the head was going. I ran many tests on it with mhdd (thank you) and basically I could not run one test (forgot what it was), the surface scan test displayed mostly red X's, and the erase disk function took a very long time. The reason I think the head was failing was while I was doing the surface scan, I used the arrow keys to jump a few hundred blocks ahead. When it started to read the new set of blocks the only errors I got were a delay in reading the blocks then after a minute they would all be red X's again. This happend no matter where I skipped to. After I got my replacement I ran all the same tests on the new drive with no issues.

Also a bit of a warning to people about mhdd, read up on what each feature does, it seems like many of the 'tests' will destroy the data on the drive without much warning ahead of time. Luckily for me the drive was blank so I just randomly tried everything on it.
 
I just wanted to follow up on this. SATA support was no issue in my kernel btw.

The drive was very much dead, I think the head was going. I ran many tests on it with mhdd (thank you) and basically I could not run one test (forgot what it was), the surface scan test displayed mostly red X's, and the erase disk function took a very long time. The reason I think the head was failing was while I was doing the surface scan, I used the arrow keys to jump a few hundred blocks ahead. When it started to read the new set of blocks the only errors I got were a delay in reading the blocks then after a minute they would all be red X's again. This happend no matter where I skipped to. After I got my replacement I ran all the same tests on the new drive with no issues.

Also a bit of a warning to people about mhdd, read up on what each feature does, it seems like many of the 'tests' will destroy the data on the drive without much warning ahead of time. Luckily for me the drive was blank so I just randomly tried everything on it.

I believe that Xs are UNC (uncorrectable data error). If my memory doesn't change me, it is when the HDD tries doing a sector and is unable to do so even after a few retries.

Also, check for cache on the hard drive.

And thank you for the "destroy the data" warning. I placed "backing up the data" as step 0 now. :)
 
I believe that Xs are UNC (uncorrectable data error). If my memory doesn't change me, it is when the HDD tries doing a sector and is unable to do so even after a few retries.

Also, check for cache on the hard drive.

And thank you for the "destroy the data" warning. I placed "backing up the data" as step 0 now. :)

Definitely. I've seen an fsck push a dying disk over the edge. Slightest hint of bad = backup ASAP.
 
Back