From owner-freebsd-stable@FreeBSD.ORG Thu Jul 22 10:20:29 2010 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2D6581065673 for ; Thu, 22 Jul 2010 10:20:29 +0000 (UTC) (envelope-from doconnor@gsoft.com.au) Received: from cain.gsoft.com.au (cain.gsoft.com.au [203.31.81.10]) by mx1.freebsd.org (Postfix) with ESMTP id B6BE18FC16 for ; Thu, 22 Jul 2010 10:20:28 +0000 (UTC) Received: from ur.dons.net.au (ppp121-45-158-44.lns6.adl6.internode.on.net [121.45.158.44]) (authenticated bits=0) by cain.gsoft.com.au (8.14.4/8.14.3) with ESMTP id o6MAKI5t042162 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Thu, 22 Jul 2010 19:50:25 +0930 (CST) (envelope-from doconnor@gsoft.com.au) Mime-Version: 1.0 (Apple Message framework v1081) Content-Type: text/plain; charset=us-ascii From: "Daniel O'Connor" In-Reply-To: <4C47B57F.5020309@langille.org> Date: Thu, 22 Jul 2010 19:50:18 +0930 Content-Transfer-Encoding: quoted-printable Message-Id: <3D5AABDD-F51B-4B7A-BC7F-BAA72F829A21@gsoft.com.au> References: <4C47B57F.5020309@langille.org> To: Dan Langille X-Mailer: Apple Mail (2.1081) X-Spam-Score: 0.163 () BAYES_00,RDNS_DYNAMIC X-Scanned-By: MIMEDefang 2.67 on 203.31.81.10 Cc: freebsd-stable Subject: Re: Using GTP and glabel for ZFS arrays X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jul 2010 10:20:29 -0000 On 22/07/2010, at 12:35, Dan Langille wrote: > Why use glabel? >=20 > * So ZFS can find and use the correct HDD should the HDD device ever > get renumbered for whatever reason. e.g. /dev/da0 becomes /dev/da6 > when you move it to another controller. >=20 > Why use partitions? >=20 > * Primarily: two HDD of a given size, say 2TB, do not always provide > the same amount of available space. If you use a slightly smaller > partition instead of the entire physical HDD, you're much more > likely to have a happier experience when it comes time to replace an > HDD. >=20 > * There seems to be a consensus amongst some that leaving the start = and > and of your HDD empty. Give the rest to ZFS. I would combine both! GPT generates a UUID for each partition and glabel presents this so ZFS = can use it, eg I have.. [cain 19:45] ~ >sudo zpool status pool: tank state: ONLINE scrub: none requested config: NAME STATE READ = WRITE CKSUM tank ONLINE 0 = 0 0 raidz2 ONLINE 0 = 0 0 gptid/d7467802-418f-11df-bcfc-001517e077fb ONLINE 0 = 0 0 gptid/d7eeeced-418f-11df-bcfc-001517e077fb ONLINE 0 = 0 0 gptid/d8761aa0-418f-11df-bcfc-001517e077fb ONLINE 0 = 0 0 gptid/d9083d18-418f-11df-bcfc-001517e077fb ONLINE 0 = 0 0 gptid/d97203ec-418f-11df-bcfc-001517e077fb ONLINE 0 = 0 0 and on each disk.. [cain 19:46] ~ >gpart list ada0 =20 Geom name: ada0 fwheads: 16 fwsectors: 63 last: 1953525134 first: 34 entries: 128 scheme: GPT Providers: 1. Name: ada0p1 Mediasize: 8589934592 (8.0G) Sectorsize: 512 Mode: r0w0e0 rawtype: 516e7cb5-6ecf-11d6-8ff8-00022d09712b label: (null) length: 8589934592 offset: 17408 type: freebsd-swap index: 1 end: 16777249 start: 34 2. Name: ada0p2 Mediasize: 991614917120 (924G) Sectorsize: 512 Mode: r1w1e2 rawtype: 516e7cba-6ecf-11d6-8ff8-00022d09712b label: (null) length: 991614917120 offset: 8589952000 type: freebsd-zfs index: 2 end: 1953525134 start: 16777250 Consumers: 1. Name: ada0 Mediasize: 1000204886016 (932G) Sectorsize: 512 Mode: r1w1e3 The only tedious part is working out which drive has what UUIDs on it = because gpart doesn't list them. The advantage of using the UUIDs is that if you setup another machine = the same way you don't have to worry about things when you plug in the = disks from it to recover something. Or perhaps you are upgrading at the = same time as replacing hardware so you have all the disks in at once. > Create a new partition within that scheme: >=20 > gpart add -b 34 -s SOMEVALUE -t freebsd-zfs ad0 >=20 > Why '-b 34'? Randi pointed me to = http://en.wikipedia.org/wiki/GUID_Partition_Table where it explains what = the first 33 LBA are used for. It's not for us to use here. If you don't specify -b it will DTRT - that's how I did it. You can also specify the size (and start) in human units (Gb etc). -- Daniel O'Connor software and network engineer for Genesis Software - http://www.gsoft.com.au "The nice thing about standards is that there are so many of them to choose from." -- Andrew Tanenbaum GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C