From owner-freebsd-questions@FreeBSD.ORG Sat Dec 3 17:04:37 2011 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 847C1106564A for ; Sat, 3 Dec 2011 17:04:37 +0000 (UTC) (envelope-from cyberleo@cyberleo.net) Received: from paka.cyberleo.net (paka.cyberleo.net [66.219.31.21]) by mx1.freebsd.org (Postfix) with ESMTP id 61CD18FC13 for ; Sat, 3 Dec 2011 17:04:37 +0000 (UTC) Received: from [172.16.44.4] (den.cyberleo.net [66.253.36.39]) by paka.cyberleo.net (Postfix) with ESMTPSA id 34F8428407; Sat, 3 Dec 2011 12:04:36 -0500 (EST) Message-ID: <4EDA56A3.6090108@cyberleo.net> Date: Sat, 03 Dec 2011 11:04:35 -0600 From: CyberLeo Kitsana User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:7.0.1) Gecko/20111106 Thunderbird/7.0.1 MIME-Version: 1.0 To: lists@midsummerdream.org References: <4ED98E9F.9010401@midsummerdream.org> <4EDA489B.9060503@midsummerdream.org> In-Reply-To: <4EDA489B.9060503@midsummerdream.org> X-Enigmail-Version: 1.4a1pre Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Derrick Ryalls , freebsd-questions@freebsd.org Subject: Re: AHCI driver and static device names X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2011 17:04:37 -0000 On 12/03/2011 10:04 AM, Rob wrote: > glabel looks to place a label on the whole disk, but the manpage is > unclear (to me) how the partitions are handled. If I use glabel to > label a disk "test" and this disk has 4 partitions on it, then how is > each partition accessed? testp1...testp4 for gpt? Ideally, you would label the partitions according to their usage. glabel will automatically create labels for GPT partitions based on the GPT 'label' field; likewise for UFS, MSDOS, and ISO9660 filesystems. For example, one of my (few remaining non-ZFS) machines looks like this: ----8<---- /dev/iso9660/root on / (cd9660, local, read-only) /dev/ufs/boot on /boot (ufs, local, read-only) /dev/ufs/conf on /conf (ufs, local, read-only, soft-updates) ----8<---- The root filesystem on this machine is actually mounted off a uzip-compressed iso image on a BSD partition burned to some flash; but the unimportant details are hidden behind the label, which just presents a plain filesystem. It doesn't really matter where these filesystems are: they can be moved to completely different disks with wildly different partition schemes, or even to iscsi- or ggate-imported disks, and the system will find them perfectly by their labels. This works for ZFS as well: since there's no guarantee where these disks will show up, and the ZFS code will not be able to find them across reboots if their names change, labels are useful for assigning static names to the partitions or slices that make up a pool: ----8<---- pool: amani state: ONLINE scrub: none requested config: NAME STATE READ WRITE CKSUM amani ONLINE 0 0 0 mirror ONLINE 0 0 0 gpt/amani/r0 ONLINE 0 0 0 gpt/amani/r1 ONLINE 0 0 0 ----8<---- To answer your question, though: You cannot combine GPT with glabel (or any other geom class that writes data to the first or last 34 sectors of a disk, like gmirror) due to layout conflicts. MBR and BSD schemes can be used, since they occupy only the first sectors of the device, and their monikers will be appended to the label. Thus, labeling a single-slice MBR disk (/dev/ada0) with 'test' would produce /dev/ada0, /dev/ada0s1, /dev/label/test, and /dev/label/tests1; nesting a BSD table within s1 would add /dev/ada0s1a and /dev/label/tests1a as well. > The other option seems to be to use tunefs or a partitioning tool to > label each partition, which is even more ugly imo. Ugly how? Labels appear a lot more semantically elegant than the opaque 'ada4s1a' moniker. -- Fuzzy love, -CyberLeo Technical Administrator CyberLeo.Net Webhosting http://www.CyberLeo.Net Furry Peace! - http://wwww.fur.com/peace/