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



On Thu, Jan 05, 2012 at 03:57:29AM +0100, Julian Fagir wrote:
> 
> 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?

Depends what you want percentages of ...
A disk with an mbr might have netbsd-usable filesystems in any of its
mbr partitions, some, but not necessarily all, will be type 169.

You also have issues with disks that have been moved between systems
that use different raw partitions (c v d).

In reality, there is no reason these days to store the disk size
on the disk - this is probably a relic of RL01s :-)

        David

-- 
David Laight: david%l8s.co.uk@localhost


Home | Main Index | Thread Index | Old Index