RFC: making gpart default

Rui Paulo rpaulo at fnop.net
Sat Nov 29 06:07:49 PST 2008


On 29 Nov 2008, at 04:07, Peter Wemm wrote:

> On Thu, Sep 25, 2008 at 9:59 AM, Marcel Moolenaar <xcllnt at mac.com>  
> wrote:
>> All,
>>
>> I'd like to switch all architectures to gpart for the reasons given
>> below. All current partitioning schemes are supported by gpart and
>> work on all platforms. On top of that, ia64 and powerpc are using
>> gpart exclusively already.
> [..]
>> In short: gpart is the first step towards a unified set of
>> tools and interfaces and provides the basis for extending
>> file system related tools by allowing us to attach real
>> meaning to partition types. With the commit and undo feature,
>> gpart is ready for use by next generation installers that
>> allow us to use any partitioning scheme on any platforms.
>>
>> Thoughts?
>
> oh my god.  I just tried to use gpart.  This needs some SERIOUS help.

I agree.

>
>
> First, the 'gpart create' man page doesn't say what "scheme" is.

Right. Also, the gpart man page should have much more examples.

> After guessing, I tried:
>
> overcee# gpart create -s gpt /dev/twed1
> gpart: 22 scheme 'gpt'
>
> What does that mean?  It turns out that I didn't have GEOM_PART_GPT  
> compiled in.

Yes, these should probably go into sys/conf instead of GENERIC.

> After continuing the guessing game:
>
> overcee# gpart create -s gpt /dev/twed1
> gpart: 22 provider '/dev/twed1'
>
> That was useful.  Out other tools generally allow /dev prefixes to  
> be optional.

In this case, I think '/dev/' should be stripped and then sent to  
GEOM. Or maybe I don't know what I'm talking about.

> overcee# gpart create -s gpt twed1
> twed1 created
>
> Now what?  Boot code.. there's no example of this either.  I tried:
>
> overcee# gpart bootcode -b /boot/pmbr -p /boot/gptboot -i 1 twed1
> gpart: /dev/twed1p1: Invalid argument
>
> I suppose that beats "22".
>
> This works though:
> overcee# gpart bootcode -b /boot/pmbr  twed1
>
> This doesn't:
> overcee# gpart bootcode -p /boot/gptboot -i 1 twed1
> gpart: /dev/twed1p1: Invalid argument
> I haven't figured this out yet.  I'm guessing this is because
> /boot/gptboot isn't a multiple of 512 bytes.  The error message is
> obviously giving no help here.
>
> Let's try padding it:
> overcee# dd if=/boot/gptboot of=/tmp/gptboot conv=sync
> 14+1 records in
> 15+0 records out
> 7680 bytes transferred in 0.000098 secs (78375316 bytes/sec)
> overcee# gpart bootcode -p /tmp/gptboot -i 1 twed1
> overcee#
>
> Yep, that worked.  Now for a partition...
>
> overcee# gpart add -b 512 -s 512m -t freebsd-ufs twed1
> gpart: 22 size '512m'
> Huh? "22"?
>
> overcee# gpart add -b 512 -s 1048576 -t freebsd-ufs twed1
> twed1p2 added

Size prefixes should be supported, yes.

> But at least I think I'm getting some progress:
> overcee# gpart show twed1
> =>       34  976771053  twed1  GPT  (500.1GB)
>         34        478      1  freebsd-boot  (244.7KB)
>        512    1048576      2  freebsd-ufs  (536.9MB)
>    1049088  975721999         - free -  (499.6GB)
>
> So I continue.. I figure gpart would pick the first free space:
> overcee# gpart add -s 4058062 -t freebsd-ufs twed1
> gpart: Option 'b' not specified.

gpt did this with no problems... :-/

>
>
> Apparently not...
> overcee# gpart add -b 1049088 -s 4058062 -t freebsd-ufs twed1
> twed1p3 added
>
> Now one has to do a gpart show ; add ; show ; add loop to get the  
> start address.
>
>
> This is really, really raw and unfriendly stuff.


Yes. This looks like fdisk, something we really want to avoid.
I'll see what I can do to help.

Regards,
--
Rui Paulo



More information about the freebsd-arch mailing list