tech-userlevel archive

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

Re: disklabel(8) allows addressing non-existent space



Hi,

> > I just played a bit around with disklabel(8), trying to copy checks for
> > batch-mode, but then I found out: There are virtually no checks checking
> > the disklabel for consistency.
> 
> I have on many occasions used disklabel to adjust the partition table
> before block-copying a disk's contents to a different-size disk.  I'd
> be pretty irritated if that stopped working.
just to make it clear: My proposed patch does not change the current
behaviour except for the buggy one, and extending the current behaviour for
-s and 'prettier' size modifiers.
It does *not* touch any verification issues!

But I'm still wondering: How to check the size of an encapsulated disk label,
for checking percentages (this would _only_ set the behaviour of users using
percentage modifiers for their sizes)?
You could e.g. check for the raw partition. If that is != 2, then I'd assume
it's an mbr partition in case of one of the following:
 * partition 2 exists and its type is unused, and it is the only partition
   besides the raw partition
 * partition 2 exists and its type is unused, and there are other partitions
   in use that overlap with partition 2, but are inside.
Do you think that's reasonable?

Regards, Julian

Attachment: signature.asc
Description: PGP signature



Home | Main Index | Thread Index | Old Index