tech-userlevel archive

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

Re: gpt's -s parameter



On Thu, Nov 21, 2013 at 08:46:58PM -0800, John Nemeth wrote:
>      As some people may have noticed, I've been working on fixing
> up gpt(8) lately.  One of the things I've done is to change various
> parameters to accept "human numbers".  These are numbers like "1M",
> "200K", "5.2G", etc.  I've been pondering what to do with the -s
> parameter.  This parameter is for specifying a partition size in
> terms of the number of sectors.  Most people would expect that if
> they were to specify "-s 1M" they would get a partition that would
> hold 1 MiB of data.  But, what they would get is 1 Mi sectors,
> which with a conventional disk with 512 byte sectors, they would
> actually get a partition that would hold 512 MiB of data.
> 
>      The meaning of the -s parameter can't be changed at this point
> since gpt(8) has been part of NetBSD since late 2006 and first
> appeared in NetBSD 4.0.  One solution I've been considering is to
> introduce a new -S parameter that would take a size in terms of
> bytes, and would calculate the appropriate number of sectors based
> on the device's sector size.  However, I'm wondering if having both
> -s and -S would cause confusion (the program wouldn't accept both).
> What are people's thoughts on this?

I think that's fine if -s accepts only plain numbers (that is, if I
type "-s 1M" I get an error).

-- 
Manuel Bouyer <bouyer%antioche.eu.org@localhost>
     NetBSD: 26 ans d'experience feront toujours la difference
--


Home | Main Index | Thread Index | Old Index