bug-parted
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bug report


From: Andrew Clausen
Subject: Re: bug report
Date: Wed, 11 Apr 2001 09:48:29 +1000

Hi Joern,

Joern Tappe wrote:
> Using GNU Parted 1.4.10 (actually your boot disk version 2),
> I successfully resized the Windows partition of a Seagate 40 GB drive,
> model ST340823A, and then entered these commands to add new partitions:
> 
> > (parted) mkpartfs primary FAT 7012.749 8032.500
> > (parted) mkpartfs logical FAT 8032.500 19077.187
> > (parted) mkpartfs logical FAT 19077.187 20096.938
> > (parted) mkpartfs logical ext2 20096.938 20606.813
> > (parted) mkpartfs logical linux-swap 20606.813 20732.321
> > (parted) mkpartfs logical ext2 20732.321 24827.013

Why did you specify so many decimal places?!  Parted's constraint
solver will try to align the partitions to cylinder boundaries,
so it's likely to get changed lots!

(Note: prior to the latest version, 1.4.11, if there was a problem
with satisfying these constraints with ONE partition, then there
is no further attempt at satisfying them for other partitions,
so the decimal places did become significant.  Not any more ;-)
 
> Upon viewing the newly created partitions with the latest version
> of the 'Ranish Partition Manager', I got error messages saying that
> several partitions (apparently the Logical Partitions) overlap
> another partition. So, I inspected the Partition Sectors of the
> Logical Partitions, and found out that the second record of each
> Partition Table specifies the number of sectors in a way that all of
> the remaining space of the Extended Partition is allocated to the
> respective Logical Partition, which indeed constitutes overlapping
> partitions:

Yes, this is how Linux and fdisk interpret partition tables.  I
don't think MSDOS cares... anyway, there have been no complaints!

The idea is: logical partitions are nested in one another.  This
is a completely broken philosophy, because they are just inside
an extended partition (and are addressed as such).

So, to prevent the overlapping, a "container" logical/extended
partition would have to have the "container" partition table for
the following logical partition completely outside it.

This is quite surreal, having partition tables representing
partitions *completely* outside of themselves.

I guess it is no more surreal though, than having them
overlapping.

So, I guess we can change this.  in libparted/disk_dos.c,
on line 849:

                geom = ped_geometry_new (disk, part->prev->geom.start,
                                ped_disk_extended_partition (disk)->geom.end
                                - part->prev->geom.start + 1);

becomes:

                geom = ped_geometry_new (disk, part->prev->geom.start,
                                part->geom.end
                                - part->prev->geom.start + 1);

(you end the container partition at the end of the contained
logical partition, rather than the end of the extended partition.
The "- part->prev->geom.start + 1" is required, because the
ped_geometry_new takes arguments "disk, start, length", so
length = (end - start + 1))

Also, the previous partition to any logical partition "part"
is always the Parted metadata partition (the way Parted marks
part of the disk as being used by partition table metadata).
So part->prev->geom.start is where the container partition table
lives.

Does this make sense?  Feel like trying this out?  *grin*

> As far as I know, the 'traditional' way of specifying the number of
> sectors in those partition records which link the Logical Partitions
> would yield these table entries for my partition layout:

OK.  I guess I should play DOS fdisk...

Thanks,
Andrew Clausen



reply via email to

[Prev in Thread] Current Thread [Next in Thread]