From owner-freebsd-questions@freebsd.org Wed Aug 16 14:36:33 2017 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E986DDF6C0 for ; Wed, 16 Aug 2017 14:36:33 +0000 (UTC) (envelope-from matthew@FreeBSD.org) Received: from smtp.infracaninophile.co.uk (smtp.infracaninophile.co.uk [IPv6:2001:8b0:151:1:c4ea:bd49:619b:6cb3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.infracaninophile.co.uk", Issuer "infracaninophile.co.uk" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 47181D49 for ; Wed, 16 Aug 2017 14:36:33 +0000 (UTC) (envelope-from matthew@FreeBSD.org) Received: from liminal.local (unknown [IPv6:2001:8b0:151:1:1c1d:86a1:a200:b700]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: m.seaman@infracaninophile.co.uk) by smtp.infracaninophile.co.uk (Postfix) with ESMTPSA id D99441EE5 for ; Wed, 16 Aug 2017 14:36:29 +0000 (UTC) Authentication-Results: smtp.infracaninophile.co.uk; dmarc=none header.from=FreeBSD.org Authentication-Results: smtp.infracaninophile.co.uk/D99441EE5; dkim=none; dkim-atps=neutral Subject: Re: ZFS and free space To: freebsd-questions@freebsd.org References: <126aaff1-58af-f7d5-b47e-c7d894b45606@gmail.com> From: Matthew Seaman Message-ID: <209906b0-4c1e-fff1-8f39-7b046494b793@FreeBSD.org> Date: Wed, 16 Aug 2017 15:36:22 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="pUfkEBFSVFt7IxNWge9DkUAXqbsbupikT" X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Aug 2017 14:36:33 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --pUfkEBFSVFt7IxNWge9DkUAXqbsbupikT Content-Type: multipart/mixed; boundary="AHxciXGVX1wM8EAdvrgpG0kbJx29xDtOf"; protected-headers="v1" From: Matthew Seaman To: freebsd-questions@freebsd.org Message-ID: <209906b0-4c1e-fff1-8f39-7b046494b793@FreeBSD.org> Subject: Re: ZFS and free space References: <126aaff1-58af-f7d5-b47e-c7d894b45606@gmail.com> In-Reply-To: --AHxciXGVX1wM8EAdvrgpG0kbJx29xDtOf Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: quoted-printable On 16/08/2017 09:03, Johan Helsingius wrote: > Hi, Mike, >=20 > On 16-08-17 07:45, Michael Schuster wrote: >> I wonder ... is zroot/usr/home part of zroot/home? Naming suggests >> otherwise. >> >> Perhaps you can try=20 >> # zfs list -t all | egrep 'home|usr'=20 >> (or simply 'zfs list -t all', if that doesn't produce too much output= ) >> and see whether that helps ... >=20 > # zfs list -t all > NAME USED AVAIL REFER MOUNTPOINT > zroot 10.2T 47.8G 140K /zroot > zroot/ROOT 3.01G 47.8G 140K none > zroot/ROOT/default 3.01G 47.8G 3.01G / > zroot/home 5.98T 47.8G 5.98T /home/storage > zroot/tmp 163K 47.8G 163K /tmp > zroot/usr 4.17T 47.8G 140K /usr > zroot/usr/home 4.17T 47.8G 4.17T /usr/home > zroot/usr/ports 1.26G 47.8G 1.26G /usr/ports > zroot/usr/src 140K 47.8G 140K /usr/src > zroot/var 1.42M 47.8G 140K /var > zroot/var/audit 140K 47.8G 140K /var/audit > zroot/var/crash 140K 47.8G 140K /var/crash > zroot/var/log 761K 47.8G 761K /var/log > zroot/var/mail 140K 47.8G 140K /var/mail > zroot/var/tmp 140K 47.8G 140K /var/tmp >=20 > So /zroot is 10T, zroot/home is 6T and zroot/usr (and zroot/usr/home) > is 4T - so clearly they are separate. But what is taking up the space > on zroot/usr/home? "du" doesn't show anything there! >=20 > # du -sh /usr/home/* > 715M /usr/home/julf > 4.2T /usr/home/storage >=20 > # file /home > /home: symbolic link to usr/home >=20 > # ls -id /usr/home/storage/ /home/storage > 18 /home/storage 18 /usr/home/storage/ Try this: # zfs umount zroot/home # du -shc /usr/home/storage If there is any directory contents under the mountpoint for your storage ZFS then when /usr/home/storage is mounted over it, it will still take up space in your zpool, but you won't be able to access it at all. Aside from anything else, I'd do this: # rm /home # zfs rename zroot/home zroot/home2 # zfs rename zroot/usr/home zroot/home # zfs rename zroot/home2 zroot/home/storage # zfs set canmount=3Don zroot/home # zfs inherit mountpoint zroot/home/storage # ln -s /usr/home /home So you should end up with zroot/home mounted on /home zroot/home/storage mounted on /home/storage Personally I like to mount /home directly rather than faffing around with symlinks, and this will make your zfs hierarchy rather less confusing. The one slight gotcha is that you have to set the 'canmount' property on zroot/home, since you don't want to inherit the 'canmount=3Doff' setting that zroot has. Cheers, Matthew --AHxciXGVX1wM8EAdvrgpG0kbJx29xDtOf-- --pUfkEBFSVFt7IxNWge9DkUAXqbsbupikT Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQJ8BAEBCgBmBQJZlFhtXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQ2NTNBNjhCOTEzQTRFNkNGM0UxRTEzMjZC QjIzQUY1MThFMUE0MDEzAAoJELsjr1GOGkATjKgQAIcbYiIjtalTjkVJBxOjOKfj 5Ya8RGiFbBGO+MVA8gIkgSz1BnDSj6cmZS6Tv3kl770k4msyJ9lINijZSmkssG+D qJxBpsdqmHc/uydrIVIN+w4hq79KfcEqwZYokkrSzvWj6nm+x9xPJQdXA30Hn8lT tSBnhuJ6Vyv94euSBnpB8SmWntXrDBIqh/p0fG2topDsG99CWQBhGCxHh8MFSO5d 8h5EDJD9ZAQ1nuwmyR0op91lEAgU/UE/4rmqcCLXq2VLfYMNqeN5atsdBGr5savU taAhJvWMbv1urDfBNGBEF/btOYnfk2aDDe0xLNXTFx4DfX3xHcec3ye2WhWNNBUb eaZ8iIt04MVnmmJdd+JGNmF61IXsVvNsGRuyf4wUjHYulbZXL2rgVAR0lkStLwny uUfT2EnmMI58E9GsiCIjuf79glqtoo82SkXCedBLPK0RCM0VVfp0zncvZWQl9aez lIEctczbvvIino1LLHvYZb+LbKRwTv97FtzVjqxhPlMNyav0SoS6GM0YEwXI2cLA khF3TtDQDT9DtacB1Dh8o0BSIkRhlLm+mOfs5uhJD1aXO+aXJbGMaZlyGR1KL4sy smTcuFvTieDvtYpx+My74OwXw+50k8qNiLnyiV6AH2CAnPJRBkdZM3HCAmY6rhdK 9GSc0Qyq+QzCklFdqaY4 =HlMI -----END PGP SIGNATURE----- --pUfkEBFSVFt7IxNWge9DkUAXqbsbupikT--