[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug] mkpartfs
From: |
Andrew Clausen |
Subject: |
Re: [bug] mkpartfs |
Date: |
Sun, 5 Aug 2001 20:38:45 +1000 |
User-agent: |
Mutt/1.2.5i |
On Sun, Aug 05, 2001 at 02:22:57AM +0200, Neal H Walfield wrote:
> Consider the following transcript:
>
> address@hidden:~/src/parted-1.5.3/build (0)$ sudo parted/parted \
> > /dev/hd2
> GNU Parted 1.5.3
> EXPERIMENTAL RELEASE - DO NOT USE ON VALUABLE DATA!!!
>
> [ chop ]
>
> Using /dev/hd2
> (parted) print
> Disk geometry for /dev/hd2: 0.000-19092.937 megabytes
> Disk label type: msdos
> Minor Start End Type Filesystem Flags
> 1 0.031 953.859 primary linux-swap
> 2 953.859 1907.718 primary sun-ufs
> 3 1907.719 2861.578 primary FAT
> 4 2861.578 9538.593 extended
> 5 2861.609 3815.437 logical ext2
> 6 3815.468 4769.296 logical ext2
> 7 4769.328 5723.156 logical ext2
> 8 5723.187 6677.015 logical ext2
> 9 6677.046 7630.875 logical ext2
> 10 7630.906 8584.734 logical ext2
> 11 8584.765 9538.593 logical
> (parted) mkpart
> Partition type? logical? log
> File system type? ext2? ext2
> Start? 10000
> End? 11000
> Error: The new partition overlaps with another partition.
This is subtle.
10000 - 11000 is outside of the extended partition, so the constraint
solver finds the closest match, which is something like 9530 - 9538.
However, that overlaps with partition 11 (hence the error message).
It's not clear what the best thing to do is, here...
The solution to the constraint is SO far away from what the user
typed... maybe this should be caught somewhere...
But, PedConstraint isn't expressive enough for partition tables
(it needs disjunctions). Therefore, the solving is the responsibility
of the partition table code (*_partition_align()), so such checking
can't be controlled by the user of the API. Maybe I should
bite-the-bullet TM and make PedConstraint support disjunctions...
> (parted) resize
> Partition number? 4
> Start? 2861.578
> End? 19092
> Error: Can't grow a partition onto used space.
This one is even more subtle, and really ugly. (Suggestions how to fix?)
Try typing 2861.579 instead of 2861.578.
I think the best solution is to add a resize constraint to make it
keep it within free space either side of it, IFF it has logical
partitions.
> (parted) quit
> address@hidden:~/src/parted-1.5.3/build (0)$ exit
>
> As you can see, I have a 20G hard drive. The extended partition (as
> created by cfdisk under GNU/Linux), only extends until the end of the
> last logical partition. Therefore, I cannot create additional logical
> partitions without extending the extended partition.
Right, that's how it works.
> However, Parted
> will not let me resize the extended partition because it overlaps other
> partitions (but, of course it does!).
The problem is, the number you typed overlaps with partition 3,
a primary partition. (rounding crap!)
> Parted should always assume that
> the end of the extended partition is the end of the disk: all primary
> partitions _must_ start and end before the start of extended partition,
Wrong.
> thereby, making this is a valid assumption.
s/valid/invalid/ ;)
Andrew