From owner-freebsd-current@FreeBSD.ORG Sat Aug 22 01:01:23 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 59707106568B for ; Sat, 22 Aug 2009 01:01:23 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (chello087206049004.chello.pl [87.206.49.4]) by mx1.freebsd.org (Postfix) with ESMTP id 9D7568FC1D for ; Sat, 22 Aug 2009 01:01:22 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id B7BBD45C9F; Sat, 22 Aug 2009 02:28:24 +0200 (CEST) Received: from localhost (chello087206049004.chello.pl [87.206.49.4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id AF6DB45C98 for ; Sat, 22 Aug 2009 02:28:19 +0200 (CEST) Date: Sat, 22 Aug 2009 02:28:22 +0200 From: Pawel Jakub Dawidek To: current@freebsd.org Message-ID: <20090822002822.GA2613@garage.freebsd.pl> References: <20090821131723.GA91417@acme.spoerlein.net> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="u3/rZRmxL6MmkK24" Content-Disposition: inline In-Reply-To: <20090821131723.GA91417@acme.spoerlein.net> User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 8.0-CURRENT i386 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-0.6 required=4.5 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.4 Cc: 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: Sat, 22 Aug 2009 01:01:23 -0000 --u3/rZRmxL6MmkK24 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Aug 21, 2009 at 03:17:23PM +0200, Ulrich Sp=F6rlein wrote: > Hello, >=20 > 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: >=20 > # 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 vo= lume 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 provi= der (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 tunef= s 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. After the reboot, boot it again into single-user mode, remount it read-write and edit /etc/fstab. Alternatively for the second single-user mode boot you can chan= ge root provider from loader prompt with this command: OK set vfs.root.mountfrom=3D"ufs:/dev/ufs/root" OK boot And once you boot, edit /etc/fstab. --=20 Pawel Jakub Dawidek http://www.wheel.pl pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --u3/rZRmxL6MmkK24 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4 (FreeBSD) iD8DBQFKjzumForvXbEpPzQRAsW6AKC99En9Qeu+V8AgllMIPWLw98eYCQCgo8u5 NIyt9aumzPMuMb+r4hMENaI= =rMHR -----END PGP SIGNATURE----- --u3/rZRmxL6MmkK24--