#9856 closed bug (fixed)
DriveSetup allows "formatting" an extended-partition / wastes the partition table
Reported by: | ttcoder | Owned by: | stippi |
---|---|---|---|
Priority: | normal | Milestone: | R1/beta2 |
Component: | Applications/DriveSetup | Version: | R1/Development |
Keywords: | Cc: | ||
Blocked By: | Blocking: | ||
Platform: | All |
Description
I might have found a serious bug in DS:
- if you have a partition you want to get rid of because it's set as "extended" (instead of "primary"), with, say, one sub-partition inside it;
- and one or more primari'es behind it;
- and you select the mother (extended) partition at the beginning, rather than the sub-partition inside it and do Format... Be File System, your HDD contents is lost.
More precisely -- the HDD appears normal at fast, but once you reboot, the Haiku boot menu says "no bootable partition".. Using another media (e.g. USB) to boot and opening DriveSetup from there, you see your HDD completely empty of any partition.
I'm guessing an extended partition has some overhead compared to a primary one, a few KB or MB, and if DS formats it again as primary it does not account for the "gained" space and recalculates the offsets of the partitions behind it, even though their physical offset on the disk has not changed, which makes them invisible. That theory would explain the loss of the partitions behind the number one but now why I lost the first one too though.
Anyhow the "format" submenu should probably be grayed out when an extended partition is selected, to hint at the correct way to get rid of it: do a "Delete", then recreate it with "Create" as a primary, and then one may format it to BFS I guess.
Attachments (2)
Change History (6)
comment:1 by , 11 years ago
by , 11 years ago
Attachment: | drivesetup_1_aftermarth.png added |
---|
Fallout after first reboot: HDD is wiped clean, no partitions recognized (maybe the 0xff everywhere don't help?)
by , 11 years ago
Attachment: | drivesetup_2_hackfixed.png added |
---|
After a few hours of dumb experiments I finally understood I had to wipe out the partition table and enter the original offsets by hand in diskprobe; then after rebooting I can mount my partitions again (last two, gotta do the first ones now)
comment:4 by , 5 years ago
Milestone: | R1 → R1/beta2 |
---|
Assign tickets with status=closed and resolution=fixed within the R1/beta2 development window to the R1/beta2 Milestone
I'm not anxious to try and reproduce this since this is my dev machine and time is tight... But I collected some data and can answer questions while the sequence of events is fresh in my mind.
I spent the whole evening on this, reading mmlr's article on makebootable that explains the MBR structure ..etc, and finally recovered all my data by hacking offsets in DiskProbe BTW.. one more reason to not go back in the salt mines and leave someone else to investigate this ;-)