tech-userlevel archive

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

gpt's -s parameter

     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?

Home | Main Index | Thread Index | Old Index