From owner-freebsd-arch@FreeBSD.ORG  Sat Nov 29 14:07:49 2008
Return-Path: <owner-freebsd-arch@FreeBSD.ORG>
Delivered-To: arch@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 48F5D1065672
	for <arch@freebsd.org>; Sat, 29 Nov 2008 14:07:49 +0000 (UTC)
	(envelope-from rpaulo@gmail.com)
Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.175])
	by mx1.freebsd.org (Postfix) with ESMTP id D00EA8FC14
	for <arch@freebsd.org>; Sat, 29 Nov 2008 14:07:48 +0000 (UTC)
	(envelope-from rpaulo@gmail.com)
Received: by ug-out-1314.google.com with SMTP id 30so2128260ugs.39
	for <arch@freebsd.org>; Sat, 29 Nov 2008 06:07:47 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:received:received:cc:message-id:from:to
	:in-reply-to:content-type:content-transfer-encoding:mime-version
	:subject:date:references:x-mailer:sender;
	bh=c0XVmBKLHYpINxumuXxIlKWYXs//7u/79KpKt2oGJpM=;
	b=fjp3FAW4ESmpQQd7XpQ1nniPt9Lplvjskmw+05TOCO07At5pN7W3rZ5y/+HQQA28Ah
	dLtt3ASToShq75ccFZK8LS1hPt88+9XbyZ1qmasdbM61yXVfbZ1nI46lT4IvkgVxryZr
	r0b3CSNkhXfqs2wZOrXQxWVmnMrCjXH3GpgsY=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=cc:message-id:from:to:in-reply-to:content-type
	:content-transfer-encoding:mime-version:subject:date:references
	:x-mailer:sender;
	b=N0ybpeRSG2EWYYqRP5dbbsx3aPZ9+6lumW4FuHoU3EyiZ8DuTAe944H4ZB/46KCjDt
	L8rjTrSLdA6N4DrYGga64ZVcPGC/O48zI6XVkZnQOHTJqgqbdL647neLqoVOqKb4cpq8
	S/VqXRsRkW6tA9YcsU8mWMDL1krtBKRBSaOpI=
Received: by 10.66.222.6 with SMTP id u6mr1721712ugg.19.1227965944448;
	Sat, 29 Nov 2008 05:39:04 -0800 (PST)
Received: from epsilon.lan (bl6-145-143.dsl.telepac.pt [82.155.145.143])
	by mx.google.com with ESMTPS id j34sm1883783ugc.53.2008.11.29.05.39.02
	(version=TLSv1/SSLv3 cipher=RC4-MD5);
	Sat, 29 Nov 2008 05:39:03 -0800 (PST)
Message-Id: <28C48AAC-CF27-4434-819C-A2688D6485CC@fnop.net>
From: Rui Paulo <rpaulo@fnop.net>
To: Peter Wemm <peter@wemm.org>
In-Reply-To: <e7db6d980811282007j48903cdas289c302e1811a0b9@mail.gmail.com>
Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes
Content-Transfer-Encoding: 7bit
Mime-Version: 1.0 (Apple Message framework v929.2)
Date: Sat, 29 Nov 2008 13:38:45 +0000
References: <57809A37-B81C-4F50-A418-CD9303F06B72@mac.com>
	<e7db6d980811282007j48903cdas289c302e1811a0b9@mail.gmail.com>
X-Mailer: Apple Mail (2.929.2)
Sender: Rui Paulo <rpaulo@gmail.com>
Cc: FreeBSD Arch <arch@freebsd.org>, Marcel Moolenaar <xcllnt@mac.com>
Subject: Re: RFC: making gpart default
X-BeenThere: freebsd-arch@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: Discussion related to FreeBSD architecture <freebsd-arch.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/freebsd-arch>,
	<mailto:freebsd-arch-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/freebsd-arch>
List-Post: <mailto:freebsd-arch@freebsd.org>
List-Help: <mailto:freebsd-arch-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/freebsd-arch>,
	<mailto:freebsd-arch-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sat, 29 Nov 2008 14:07:49 -0000


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

> On Thu, Sep 25, 2008 at 9:59 AM, Marcel Moolenaar <xcllnt@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