From owner-freebsd-current@FreeBSD.ORG Sun Aug 23 14:33:05 2009 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9BFD4106568C; Sun, 23 Aug 2009 14:33:05 +0000 (UTC) (envelope-from uqs@spoerlein.net) Received: from acme.spoerlein.net (cl-43.dus-01.de.sixxs.net [IPv6:2a01:198:200:2a::2]) by mx1.freebsd.org (Postfix) with ESMTP id 18F598FC18; Sun, 23 Aug 2009 14:33:04 +0000 (UTC) Received: from acme.spoerlein.net (localhost.spoerlein.net [127.0.0.1]) by acme.spoerlein.net (8.14.3/8.14.3) with ESMTP id n7NEX35N045364 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 23 Aug 2009 16:33:03 +0200 (CEST) (envelope-from uqs@spoerlein.net) Received: (from uqs@localhost) by acme.spoerlein.net (8.14.3/8.14.3/Submit) id n7NEX33U045363; Sun, 23 Aug 2009 16:33:03 +0200 (CEST) (envelope-from uqs@spoerlein.net) Date: Sun, 23 Aug 2009 16:33:03 +0200 From: Ulrich =?utf-8?B?U3DDtnJsZWlu?= To: Pawel Jakub Dawidek Message-ID: <20090823143303.GN91417@acme.spoerlein.net> Mail-Followup-To: Pawel Jakub Dawidek , current@freebsd.org References: <20090821131723.GA91417@acme.spoerlein.net> <20090822002822.GA2613@garage.freebsd.pl> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20090822002822.GA2613@garage.freebsd.pl> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: current@freebsd.org Subject: Re: Cannot mount / from UFS labels X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Aug 2009 14:33:05 -0000 On Sat, 22.08.2009 at 02:28:22 +0200, Pawel Jakub Dawidek wrote: > On Fri, Aug 21, 2009 at 03:17:23PM +0200, Ulrich Spörlein wrote: > > I'm not sure this ever worked for 7.x but now I need to have the same > > root fs device on two machines: labels to the rescue! As I don't want to > > use the GEOM labels, but UFS labels, this is what I did: > > > > # tunefs -L root / (in single user) > > then updated /etc/fstab and rebooted > > The problem is this: tunefs will write volume name into file system's > superblock on the disk. Then you remount read-write and UFS will overwrite > superblock with in-memory copy it picked up on first read-only mount (no volume > name in there). So there will be no volume name in the superblock anymore. You > can confirm that with: > > # tunefs -L root /dev/ad0s1a > # dumpfs /dev/ad0s1a | grep volname > There should be volume name here. > # mount -uw / > # dumpfs /dev/ad0s1a | grep volname > No volume name here. > > You cannot remount it read-only again and use tunefs again, because this is a > bit of a hack how it works now. Only first read-only mount opens GEOM provider > (eg. /dev/ad0s1a) for reading, but without exclusive bit. Once you remount it > the exclusive bit will be there and you will no longer be able to use tunefs on > this file system. You can confirm that with: > > # gpart list | grep -A3 'Name: ad0s1a' > Take a look at the 'e' (exclusive) count. > > So what you have to do instead is to boot into single-user mode, put volume > name using tunefs and reboot without remounting the file system. I had a hunch that this might work, thanks for confirming, I now also used this for my other machines and can confirm it worked. Cheers, Uli