Parted corrupts the partition table
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
parted (Ubuntu) |
Fix Released
|
Medium
|
Colin Watson |
Bug Description
I'll mostly describe what I've done, so people with better knowledge of
partitions and disk management might find it useful.
Before I installed last week, I deleted my Debian partitions on the disk I
wanted to install Ubuntu to.
== BEFORE INSTALL ==
The disk looks like this:
NTFS (50G)
Empty (7G)
NTFS (57G)
It's not my Win2k-partition, it only has some data on it, in two partitions. The
"Empty" space is where I usually keep my Linux installations. I emptied it using
Partition Magic, and the disk looked alright before installing.
Then I installed Ubuntu and used it for a few days:
NTFS (50G)
Ubuntu Root (7G)
Swap (350MB)
NTFS (57G)
Yesterday I thought about increasing the size of the Ubuntu partition, so I
started PMagic.
== THE PROBLEM ==
It told me that the partition table of the disk had some errors (something about
CHS and LBA values being different although they should match) and if it should
fix it. This is nothing special, I get this often when repartitioning the disk,
so I said Yes a few times, till the program opened.
But the disk had a "BAD" label and had no partitions + a small label "Error 108".
Error 108 is a partition table error. When I checked it with some other
programs, Linux fdisk said the partition table didn't match the drive geometry
(some cylinder settings or somewhat are wrong).
I found no way to fix this. The disk worked flawlessly in Linux and Win2k, but I
wanted an error-free partition table, so I backed up all the data and formatted.
This time, I created all partitions before the installation in Partition Magic,
then retrieved my backups of NTFS, then re-installed Ubuntu (the Ubuntu backup
had errors, so I had to reinstall).
In the installer, I selected the ext3 and swap partitions to be used.
After the installation, same problem again: The partition table had errors.
== FIXING THE PROBLEM ==
Some people on IRC Freenode #ubuntu helped me find some answers, and so I wanted
to try out other BIOS settings for the drive. (Infos from this article:
http://
My BIOS only has a switch "LBA: On/Off" for each drive, and it was on for the
Linux/NTFS disk. I switched it to off.
Booted Win2k, opened PMagic: First again some fixable errors about CHS/LBA
values, but in the main program the disk was "BAD" again.
Changed the BIOS setting to on again: Some fixable errors, but now the disk was
good again?! The partition table had no errors, PMagic could see the whole drive
with all partitions.
== CONCLUSION ==
I have no idea how this has worked out... my guess is that the switching between
LBA/non-LBA mode and PMagic repairing my partition table somehow resulted in a
partition table with all values matching, and no errors.
Well, the problem with the last Ubuntu install was, that I still wanted my
backup, so I had it installed and then extracted my backup over it. Didn't work
out, couldn't boot anymore, so I had to reinstall again.
Well, interestingly, after this reinstall (with selecting the partitions and
formatting them in the installer), it was still the same: No partition errors.
So now I got a working Ubuntu installation and a fully working partition table.
One of the Ubuntu devs said on IRC that it looked pretty much like a parted
problem, and he cited some changes in the parted sources that matched pretty
much the problems I had.
Maybe also of note is this: When I had installed Debian (February/March 2004)
testing/Sarge, I had none of these problems. It just worked. So the bug might
have been introduced between then and now.
My fix (switching LBA setting) might look more like an act of the goddess than a
reproducible repair, but it might give some hints for the bug in parted.
Disclaimer: I was advised by a dev to file this bug. It's not like I have no
other place to save the experiences of my last day to. ;)
This sounds like the parted geometry problem which has been discussed on
ubuntu-users, and which is supposedly fixed upstream in parted. Colin, do you
agree?