From owner-freebsd-questions@FreeBSD.ORG Tue Jan 25 14:29:48 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 65D581065672 for ; Tue, 25 Jan 2011 14:29:48 +0000 (UTC) (envelope-from listreader@lazlarlyricon.com) Received: from mailgw5.surf-town.net (mail7.surf-town.net [212.97.132.47]) by mx1.freebsd.org (Postfix) with ESMTP id 1F64A8FC18 for ; Tue, 25 Jan 2011 14:29:47 +0000 (UTC) Received: by mailgw5.surf-town.net (Postfix, from userid 65534) id 643351FE77; Tue, 25 Jan 2011 15:29:44 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mailgw5.surf-town.net (Postfix) with ESMTP id ACD9F1FF6E; Tue, 25 Jan 2011 15:29:44 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mailgw5.surf-town.net X-Spam-Flag: NO X-Spam-Score: -1.44 X-Spam-Level: X-Spam-Status: No, score=-1.44 tagged_above=-999 required=7 tests=[ALL_TRUSTED=-1.44] Received: from mailgw5.surf-town.net ([127.0.0.1]) by localhost (mailgw5.surf-town.net [127.0.0.1]) (amavisd-new, port 10024) with LMTP id cYz6MvxXrD0Q; Tue, 25 Jan 2011 15:29:39 +0100 (CET) Received: from lazlar.kicks-ass.net (c-4d80e355.09-42-6e6b7010.cust.bredbandsbolaget.se [85.227.132.158]) by mailgw5.surf-town.net (Postfix) with ESMTPA id DD0EF1FF72; Tue, 25 Jan 2011 15:29:37 +0100 (CET) Message-ID: <4D3EDE51.6070404@lazlarlyricon.com> Date: Tue, 25 Jan 2011 15:29:37 +0100 From: Rolf Nielsen User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; sv-SE; rv:1.9.2.13) Gecko/20110117 Lightning/1.0b2 Thunderbird/3.1.7 MIME-Version: 1.0 To: "J. Porter Clark" References: <20110125014223.GA13385@auricle.charter.net> <4D3E8DC0.9060605@gmx.com> <20110125140705.GA20041@auricle.charter.net> In-Reply-To: <20110125140705.GA20041@auricle.charter.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-questions@freebsd.org Subject: Re: How to label a GELI device 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: Tue, 25 Jan 2011 14:29:48 -0000 2011-01-25 15:07, J. Porter Clark skrev: > On Tue, Jan 25, 2011 at 10:45:52AM +0200, Nikos Vassiliadis wrote: >> J. Porter Clark wrote: >>> I have an encrypted partition, /dev/da0s1d. I can use geli >>> attach da0s1d and obtain a device /dev/da0s1d.eli, which is a >>> UFS filesystem. All that works just fine. >>> >>> I'd like to label /dev/da0s1d so that I don't have to refer to >>> the exact drive number, etc., which might change if I reboot >>> with a USB stick in the system or whatever. But glabel puts the >>> label in the last sector, which is where GELI stores metadata. >> >> You don't have to worry about this. geli uses the last sector for >> its metadata and creates a device with one sector less to its clients. >> The original device is 2048 sectors, the device geli provides is 2047 >> sectors: >>> moby# diskinfo /dev/md0 /dev/md0.eli >>> /dev/md0 512 1048576 2048 0 0 >>> /dev/md0.eli 512 1048064 2047 0 0 >> >> There is no way for the "internal" GEOM to mess with the "external's" >> metadata. > > That's fine, but I want to label the "external" /dev/md0, not > the "internal" /dev/md0.eli. > > What I eventually want to do is to "geli attach" the device > using a name that doesn't depend on drive numbering. > Correct me if I'm wrong anyone. You need to first label da0s1d e.g. like so glabel label data da0s1d then geli init the labeled device e.g. like so geli init -l 256 -s 4096 label/data then geli attach label/data That will give you a device node called /dev/label/data.eli, that you can newfs and mount. Unfortunately, since you already encrypted da0s1d, you may have to back it up, and restore the data after you've redone it. I had this problem a few years ago, and I had to back up and restore, but perhaps it's been made simpler now? Though I doubt it. Rolf Nielsen