GParted errors on MBR Disk, Claims it's GPT. (It's mistaken, but why?)

It's very tempting for me to go on a rant here about GParted and Linux, but I'll do my best to avoid it. :)

Question:

Why does GParted claim that my disk is corrupted and GPT, whereas the Disk Utility thinks everything is fine?

My only partition on the disk (NTFS) has Windows 7 x64 on it, and has absolutely no problems -- I never had any problems with it, and I ran CheckDisk to make sure.

Why is GParted behaving this way?

(I was going to post this on AskUbuntu, but since GParted isn't really limited to Ubuntu, I posted it here. I'm using Ubuntu 11.04 x64's boot disc.)

Screenshot


Solution 1:

Chances are the disk used to be a GUID Partition Table (GPT) disk. Such disks have partitioning data from sectors 0-33 (typically) and also in the last 33 sectors of the disk. If a GPT disk is repartitioned by a GPT-unaware utility, that utility is likely to replace just sector 0 (the MBR), leaving most of the GPT data intact. Technically, the disk is then an MBR disk; however, some partitioning tools, including many Linux tools that are based on libparted (including GParted) become confused by this. They may show the disk as being completely blank or show the old GPT partitions rather than the new MBR partitions. This is a bug in libparted, but it's triggered by some inconsistent data on the disk.

The solution is to wipe the old GPT data. This can be done various ways, but the simplest is probably to use FixParts, which is designed for this and some other partition table repair tasks. Alternatively, you could use dd to wipe sector 1 (numbered from 0) and the final sector on the disk; that's where the GPT signatures that are confusing libparted reside.

Sorry I didn't get here sooner, Mehrdad. My guess is that when you rewrote the partition table you also wiped out the boot loader in the MBR. Re-installing your boot loader should fix that problem. It's possible that you wrote the wrong partition table, though, which would be harder to fix.