[Parted-maintainers] Bug#380226: NTFS (partition) not recreated correctly after resize: incorrect start sector

Bas Zoetekouw bas at debian.org
Fri Dec 15 21:33:09 UTC 2006


Hi guys!

[Cc'ing a lot of people who contributed to the bug report]

Kurt wrote:

| libparted/label/dos.c:_primary_start_constraint() has this comment:
| /* This constraint is for partitions starting on the first cylinder. They
|  * must start on the 2nd head of the 1st cylinder.
|  */
| 
| So it needs to start at the second track, and would mean in most cases
| be on sector 63 (63 sectors/track).
| However, vista seems to create the first one at sector 2048, which is in
| even in the middle of a track.  I can't see a good reason why they did
| this, other than trying to break things and waste more space.

Well, does it really matter _why_ they did it?  The problem here (as I
perceive it, at least), is that parted is for some reason "fixing" the
starting sector of the partition, while it shouldn't touch the beginning
of the partition at all.  All it should do is change the _ending_ sector.

Maybe indeed starting a partition at a non-cylinder boundary will break
Windows (on pre-LBA harddisks, etc).  But if that is the case, then the
partition table was broken already before parted had anything to do with
it.  I don't think that in such a situation chaning the ending sector
will make things worse.

Of course, this is a totally different situation than in the case that
parted is creating a new partition from scratch.  In such a case, of
course, it _does_ make sense to write a sane parition table with
partitions starting at cylinder boundaries only.

So IMO this should be fixed by somehow restricting the parition aligning
to the ending sector only, and not have libparted and _partition_align()
touch the begin sector of the partition at all, if the partition is
being resized.  In the case that a new partition is created, everything
should stay as it is, and both beginning and ending sector should be
aligned.

-- 
Kind regards,
+--------------------------------------------------------------------+
| Bas Zoetekouw              | GPG key: 0644fab7                     |
|----------------------------| Fingerprint: c1f5 f24c d514 3fec 8bf6 |
| bas at debian.org             |              a2b1 2bae e41f 0644 fab7 |
+--------------------------------------------------------------------+ 




More information about the Parted-maintainers mailing list