Date: Fri, 27 Apr 2007 11:04:09 +0200 From: Pawel Jakub Dawidek <pjd@FreeBSD.org> To: Barry Pederson <bp@barryp.org> Cc: freebsd-fs@FreeBSD.org Subject: Re: ZFS: inherited mountpoints with root filesystem Message-ID: <20070427090409.GA48798@garage.freebsd.pl> In-Reply-To: <463110F5.1090102@barryp.org> References: <462F65DB.5010305@barryp.org> <20070426170824.GO41670@garage.freebsd.pl> <463110F5.1090102@barryp.org>
next in thread | previous in thread | raw e-mail | index | archive | help
--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 "/<p= ool-name>"? > >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--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070427090409.GA48798>