1 (edited by jlebar 2009-01-21 07:43:08)

Topic: [Resolved] Stuck with the wrong HDD geometry

Hi there.

In the process of cloning an old 80gb drive onto a new 320gb drive, I've apparently managed to convince the OS that my new HDD is also of size 80gb.  Here are the details:

* I normally run Windows, so I booted into Linux via Slax on a USB drive.
* I used dd to copy my old drive onto my new drive.
* I opened GParted, which displayed, as expected, that my new drive contained a small service partition (FAT16, I think) followed by a large data partition (NTFS) followed by a large amount of free space.
* I told GParted to resize the NTFS partition from ~80gb to take up all the free space on the drive.  This operation completed successfully.
* When I try to boot into Windows off the new drive, I get a stop error.  Back in Linux, when I run fdisk on the new drive or examine it in GParted, the 320gb drive now shows up as an unformatted 80gb drive.

(I used dd instead of GParted to do the actual copying because GParted wouldn't copy the service partition on my old drive.  I'm not sure if that service partition is necessary -- I've heard that some Lenovo laptops won't boot without it, but I've never heard that about Dell laptops -- but I figured I might as well try to copy it.  In any case, this procedure worked just fine on a friend's Lenovo laptop, with a very similar setup.)

It looks like resizing the NTFS partition somehow messed up the operating system's idea of the new hard drive's geometry.  To wit, fdisk reports 9546 cylinders, but I expect 16383.  Changing the number of cylinders with fdisk doesn't seem to do anything.  (If the geometry really is the problem, then more than just the cylinder count is wrong; the drive is 1/4 its expected size, but it's missing fewer than half its cylinders.)

I'm perfectly happy to start from scratch with this drive, ignore the service partition, and use GParted to perform the cloning this time.  But first, I need to convince the operating system that the drive is actually 320gb in size, and I'm not sure how to do that.  I've already tried copying over the new drive (well, the first 80gb of it, anyway) with /dev/zero, but that didn't change anything; at this point, I'm out of ideas.

Do you guys have any idea what's going on here?  I'd really appreciate whatever insight you have.

Thanks,
-Justin

2

Re: [Resolved] Stuck with the wrong HDD geometry

Hi,

can you give us the make and model of your 320 GByte drive? Some hard drive manufacturers offer utilities that can be used to set the storage capacity reported to the operrating system and BIOS by the drive; maybe this could be a solution for your problem.
What does the BIOS tell you about the hard drive's size, and what does a

dmesg | less -S

issued th the Linux command line tell you about the drive (uise tze arrow keys to scroll through the text; look out for messages about devices named "hd..." or "sd...").

3 (edited by jlebar 2009-01-21 01:13:48)

Re: [Resolved] Stuck with the wrong HDD geometry

stormhead,

My drive is the 320GB Seagate Momentus 7200.3, model number ST9320421AS.  BIOS says that the drive has capacity 78GB, but it doesn't give me logical cylinder/head/track values -- it's too user-friendly.

dmesg doesn't seem to say anything meaningful about the drive when it's mounted as /dev/hda.  Just in case, here's the full dmesg output: http://pastebin.com/m37fd8a9

I should mention that this is actually the second HDD I've had problems with.  The first one, which I RMAed, showed up as 80gb immediately after I plugged it into my machine.  It's possible that both of these drives come from a defective bunch which, under certain circumstances, start reporting  their size as 80gb.  Maybe the first drive did it on its own (or during the first boot sequence while it was in my machine) and this drive took a little longer before it switched to 80gb.

I find it much more likely, however, that I've just messed something up.

Thanks for your help!

4 (edited by cmdr 2009-01-21 02:16:37)

Re: [Resolved] Stuck with the wrong HDD geometry

Hello jlebar,

http://datacent.com/datarecovery/hdd/seagate/ST9320421AS wrote:

Seagate drives operate under special firmware microcode that could also fail sometimes. Typically hard drives with corrupted firmware spin up normally, do not click but still fail to initialize. Such drives could have one of the following symptoms:

    * HDD is not found in BIOS at all
    * shows up with wrong S/N or capacity,
    * fails to read any data or boot up operating system.

If you attempt to boot up from such drive or read any data from it you would get "Primary Master Hard Disk Fail", "No operating system found", "Drive Mount Failure", "Disk boot failure. Insert system disk and press enter", "USB Device malfunctioned", "S.M.A.R.T. Capable But Command Failed" or some other BIOS hard drive error message on boot.
Seagate's new family - Barracuda 7200.11, specifically with FW version SD15 has especially high firmware failure rate. In such cases hard drive either doesn't show up in BIOS at all or identifies with 0 capacity. Unfortunately it is impossible to fix such drives without special equipment capable of accessing and repairing firmware modules in the hard drive System Area.

Seems, it's a Seagate related problem (warranty ?!).

Regards
cmdr

5

Re: [Resolved] Stuck with the wrong HDD geometry

After some digging, it looks like this is a problem with Dell's bootloader, which dd helpfully copied over to my new drive.  The bootloader apparently sets a maximum address on the drive's firmware -- for what reason I have no idea.  You can change this value using HDAT2 (see http://www.hdat2.com/hdat2_faq.html#q6).  See also this forum thread: http://forum.hddguru.com/disk-resized-f … t6774.html

Using HDAT2, I was able to make my drive show up as full sized again.  But the bootloader just changed it back the next time I restarted.

I tried cloning just the NTFS partition, but Windows wouldn't boot, I think because it's expecting to be installed on the second partition on the drive.  I'm going to try replicating that structure without replicating the Dell bootloader, and I'll let you guys know how that goes.

But in any case, it looks like the problem isn't GParted, so I'm going to mark this as resolved.  smile  I'll keep looking into it and let you know if I hit any more roadblocks.  Thanks again for looking into this for me.

-Justin

6

Re: [Resolved] Stuck with the wrong HDD geometry

Hi!

jlebar wrote:

dmesg doesn't seem to say anything meaningful about the drive when it's mounted as /dev/hda.  Just in case, here's the full dmesg output: http://pastebin.com/m37fd8a9

All this outut says is that you have some problems with one of the filesystems that are currently mounted - maybe with the root file system on the GÜarted LiveCD, which could indicate
- a bad CD (which is the most common cause);
- bad RAM;
- a broken CD drive;
- data errors during the image download.

Using HDAT2, I was able to make my drive show up as full sized again.  But the bootloader just changed it back the next time I restarted.

Then it could help to try working without that boot loader.

I tried cloning just the NTFS partition, but Windows wouldn't boot, I think because it's expecting to be installed on the second partition on the drive.

Maybe you can fix this by editing the \boot.ini file on the Windows partition - at least if you use Windows up to XP; Vista uses a different method for boot loader configuration.

I'm going to try replicating that structure without replicating the Dell bootloader, and I'll let you guys know how that goes.

You will definitely need a boot loader to get Windows up and running - the "classic" Windows boot loader will do quite fine. You'll likely have to (re)install this boot loader from the Windows CD - boot off the CD, start the recovery console, and issue the fixmbr and fixboot commands.

7

Re: [Resolved] Stuck with the wrong HDD geometry

Well...I don't know what bootloader I'm currently using, but I got it to work somehow.

I zeroed out the first 50mb of the drive for good measure, then used GParted to place a new MBR, an empty FAT-16 partition, followed by my NTFS partition.  It works great now.  smile

In retrospect, editing boot.ini might have been a more elegant way to convince Windows to boot off partition 0, but it's working now, so I don't think I'm going to touch it.

Let this be a lesson to all those who think they're clever enough to use dd to clone a drive!

Thanks for your help, stormhead and cmdr.

8

Re: [Resolved] Stuck with the wrong HDD geometry

Hi!

jlebar wrote:

Let this be a lesson to all those who think they're clever enough to use dd to clone a drive!

Well, it worked well more than once for me, using dd as well as dd_rescue, whatever was more appropriate on the specific drive. But the point is that there never were strange boot loaders involved that modified the drive's firmware!