From owner-freebsd-fs@FreeBSD.ORG Fri Apr 27 09:04:53 2007 Return-Path: X-Original-To: freebsd-fs@FreeBSD.org Delivered-To: freebsd-fs@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 02E0816A408 for ; Fri, 27 Apr 2007 09:04:53 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (arm132.internetdsl.tpnet.pl [83.17.198.132]) by mx1.freebsd.org (Postfix) with ESMTP id D674213C458 for ; Fri, 27 Apr 2007 09:04:51 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id B323F45685; Fri, 27 Apr 2007 11:04:48 +0200 (CEST) Received: from localhost (154.81.datacomsa.pl [195.34.81.154]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id E67F0456AB; Fri, 27 Apr 2007 11:04:35 +0200 (CEST) Date: Fri, 27 Apr 2007 11:04:09 +0200 From: Pawel Jakub Dawidek To: Barry Pederson Message-ID: <20070427090409.GA48798@garage.freebsd.pl> References: <462F65DB.5010305@barryp.org> <20070426170824.GO41670@garage.freebsd.pl> <463110F5.1090102@barryp.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="1yeeQ81UyVL57Vl7" Content-Disposition: inline In-Reply-To: <463110F5.1090102@barryp.org> X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 7.0-CURRENT i386 User-Agent: mutt-ng/devel-r804 (FreeBSD) X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-2.6 required=3.0 tests=BAYES_00 autolearn=ham version=3.0.4 Cc: freebsd-fs@FreeBSD.org Subject: Re: ZFS: inherited mountpoints with root filesystem X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Apr 2007 09:04:53 -0000 --1yeeQ81UyVL57Vl7 Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Apr 26, 2007 at 03:52:05PM -0500, Barry Pederson wrote: > Pawel Jakub Dawidek wrote: > >On Wed, Apr 25, 2007 at 09:29:47AM -0500, Barry Pederson wrote: > >>Is this double-mountpoint setup the way things should be? If so, is/ca= n there be an option to have the ZFS-mountpoint for a root-mounted filesyst= em also be "/", so that=20 > >>inherited mountpoints for sub-filesystems are under "/" instead of "/"? > >For file systems that are mounted not via 'zfs mount -a' (eg. they are > >mounted by hand or via /etc/fstab), you should set mountpoint property > >to 'legacy'. >=20 > So you're saying that if you're doing vfs.root.mountfrom=3D"zfs:tank" in = loader.conf, then tank's mountpoint should be "legacy"? >=20 > I'm trying that now, but the drawback there is that the sub-filesystems l= ike "tank/home" also inherit that "legacy" mountpoint, so they have to be m= anually listed in=20 > /etc/fstab. That seems to carry on down to sub-sub filesystems like "tan= k/home/bob" and so on. So you lose out on the nice auto-mounting feature i= n ZFS. >=20 > I was hoping that booting with vfs.root.mountfrom=3D"zfs:tank" would be e= quivalent to something like: >=20 > zpool import -R / >=20 > I wonder now if it wouldn't have been better to have created the pool as = an Alternate Root Pool in the first place. >=20 > Is there a way to change an existing pool's mountpoint to '/' like an Alt= ernate Root pool? A simple "zfs set mountpoint=3D/" doesn't fly because it= wants to unmount root to=20 > do it. I'd kind of need to change it, but not have it take effect immedi= ately. But the thing is that root file system is mounted by the kernel automatically and such file systems should define mountpoint as 'legacy'. You can still set mountpoint for tank/home to /usr/home/ and then all children of tank/home will inherit it. You could also try setting tank mountpoint to /, but after setting canmount property to 'off'. This may not work, because ZFS may want to unmount tank automatically. What I prefer the most, is to don't touch root dataset at all, just keep it around unmounted as a head for others datasets, eg. # zpool create tank da0 # zfs set canmount=3Doff tank # zfs set mountpoint=3Dlegacy tank # zfs create tank/root # this will be mounted as / by the kernel # zfs create tank/usr # zfs set mountpoint=3D/usr tank/usr etc. --=20 Pawel Jakub Dawidek http://www.wheel.pl pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --1yeeQ81UyVL57Vl7 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (FreeBSD) iD8DBQFGMbyJForvXbEpPzQRAjs0AJ4+4+YKxX3jJ/E0gvAVbOn18Gq4OwCfU1Yp fdSEAwQQDiQZOkwLdKuvC/Q= =MDcH -----END PGP SIGNATURE----- --1yeeQ81UyVL57Vl7--