[parted-devel] Patch for Windows Vista partition destruction
David Cantrell
dcantrell at redhat.com
Thu Jan 18 21:19:24 CET 2007
I've spent the last several days tracking the problem and verifying that
my fix won't break previous versions of Windows and their partitions.
The bug I was pointed to:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=380226
The summary:
Vista partitions are not aligned on the 2nd head of the 1st cylinder if
they are at the beginning of the drive, they are aligned to sector 2048.
Alignment to the 2nd head is standard for pretty much everything else
on the DOS disklabel which is what _primary_start_constraint() takes
care of in libparted/labels/dos.c.
The fix:
I've modified the call to _primary_start_constraint() so it also
receives the PedPartition for the partition it's working on. Inside
_primary_start_constraint(), I check to see if the probed starting
sector of the partition in question does not equal the bios value. If
it doesn't, we preserve whatever we probed. If it does equal the bios
value, we go ahead and ensure we are aligned according to the existing
constraint. This fix works with Vista and Windows 2000 in my test
environment. I am going to test NT 4.0 to check another version of
NTFS. I'll most likely add this to the Fedora development tree tonight.
I'd like to know if it works for Debian.
--
David Cantrell
Red Hat / Westford, MA
-------------- next part --------------
A non-text attachment was scrubbed...
Name: parted-1.8.2-vista.patch
Type: text/x-patch
Size: 2500 bytes
Desc: not available
Url : http://lists.alioth.debian.org/pipermail/parted-devel/attachments/20070118/7dce7f79/parted-1.8.2-vista.bin
More information about the parted-devel
mailing list