RFC: making gpart default

Joao Barros joao.barros at gmail.com
Sat Nov 29 06:29:52 PST 2008


On Sat, Nov 29, 2008 at 4:07 AM, Peter Wemm <peter at wemm.org> 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.
>
> First, the 'gpart create' man page doesn't say what "scheme" is.

True.

> 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.

A recent CURRENT has it by default.

>
> 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.
>
> 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...

Fixed on Nov 18:
http://svn.freebsd.org/viewvc/base?view=revision&revision=185038

>
> overcee# gpart add -b 512 -s 512m -t freebsd-ufs twed1
> gpart: 22 size '512m'
> Huh? "22"?

This would be nice...

>
> overcee# gpart add -b 512 -s 1048576 -t freebsd-ufs twed1
> twed1p2 added
>
> 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.

This would be nice too...

>
> 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.
>

Yes, it could be smarter and more helpfull.

>
> This is really, really raw and unfriendly stuff.



-- 
Joao Barros


More information about the freebsd-arch mailing list