From owner-freebsd-fs@FreeBSD.ORG Sun Jan 13 15:30:47 2013 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E9035B9B for ; Sun, 13 Jan 2013 15:30:47 +0000 (UTC) (envelope-from wblock@wonkity.com) Received: from wonkity.com (wonkity.com [67.158.26.137]) by mx1.freebsd.org (Postfix) with ESMTP id 9F40FA0C for ; Sun, 13 Jan 2013 15:30:47 +0000 (UTC) Received: from wonkity.com (localhost [127.0.0.1]) by wonkity.com (8.14.6/8.14.6) with ESMTP id r0DFUkhW015940; Sun, 13 Jan 2013 08:30:46 -0700 (MST) (envelope-from wblock@wonkity.com) Received: from localhost (wblock@localhost) by wonkity.com (8.14.6/8.14.6/Submit) with ESMTP id r0DFUi0D015937; Sun, 13 Jan 2013 08:30:46 -0700 (MST) (envelope-from wblock@wonkity.com) Date: Sun, 13 Jan 2013 08:30:43 -0700 (MST) From: Warren Block To: kpneal@pobox.com Subject: Re: Using glabel In-Reply-To: <20130113062702.GA63271@neutralgood.org> Message-ID: References: <20130112200041.GA77338@psconsult.nl> <20130113062702.GA63271@neutralgood.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.7 (wonkity.com [127.0.0.1]); Sun, 13 Jan 2013 08:30:46 -0700 (MST) Cc: freebsd-fs@freebsd.org X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jan 2013 15:30:48 -0000 On Sun, 13 Jan 2013, kpneal@pobox.com wrote: >> You can use glabel to label your disks or partition the disks with gpart >> (using the GPT scheme) and let gpt put a label on each (-l flag). > > Don't use glabel pretty much ever. It stores the label inside the > partition (or disk). If the end of the partition is ever touched then > the label goes *poof*. Stick to gpt labels. If you label a partition, the label device will be one block smaller in size. The metadata is hidden and safe, as long as it is accessed through the label device. # diskinfo -v /dev/da0p1 /dev/da0p1 512 # sectorsize 512000 # mediasize in bytes (500k) 1000 # mediasize in sectors # glabel label teeny /dev/da0p1 # diskinfo -v /dev/label/teeny /dev/label/teeny 512 # sectorsize 511488 # mediasize in bytes (499k) 999 # mediasize in sectors Note the size in sectors. The problem is that sometimes people don't realize that the label device (/dev/label/teeny) is offering those extra features and will continue to use the raw partition in newfs commands and such. Anyway, GPT labels are still preferable to glabel because they can be created at the same time as partitions and don't use any extra metadata. ZFS has its own metadata, and newer versions are supposed to leave the last megabyte or so unused to allow for actual versus nominal disk sizes. I'm not clear whether there's a good reason to use additional labels instead of just giving ZFS the whole disk. Unless you aren't planning on using the whole disk for ZFS, of course.