Hello list. I have a single 2tb disk used on a 7.2-release/amd64 system with a small part of it given to UFS and most of the disk given to a single "simple" zfs pool with several filesystems without redundancy. I've noticed a really weird thing regarding what "df" reports regarding the "total space" of one of my filesystems: atom# zpool list NAME SIZE USED AVAIL CAP HEALTH ALTROOT tank 1.80T 294G 1.51T 15% ONLINE - atom# zfs list NAME USED AVAIL REFER MOUNTPOINT tank 294G 1.48T 18K none tank/DATA 292G 1.48T 292G /DATA tank/home 216K 1.48T 21K /home tank/home/jago 132K 1.48T 132K /home/jago tank/home/karni 62K 1.48T 62K /home/karni tank/usr 1.33G 1.48T 18K none tank/usr/local 455M 1.48T 455M /usr/local tank/usr/obj 18K 1.48T 18K /usr/obj tank/usr/ports 412M 1.48T 412M /usr/ports tank/usr/src 495M 1.48T 495M /usr/src tank/var 320K 1.48T 18K none tank/var/log 302K 1.48T 302K /var/log atom# df Filesystem 1K-blocks Used Avail Capacity Mounted on /dev/ad12s1a 16244334 1032310 13912478 7% / devfs 1 1 0 100% /dev linprocfs 4 4 0 100% /usr/compat/linux/proc tank/DATA 1897835904 306397056 1591438848 16% /DATA tank/home 1591438848 0 1591438848 0% /home tank/home/jago 1591438976 128 1591438848 0% /home/jago tank/home/karni 1591438848 0 1591438848 0% /home/karni tank/usr/local 1591905024 466176 1591438848 0% /usr/local tank/usr/obj 1591438848 0 1591438848 0% /usr/obj tank/usr/ports 1591860864 422016 1591438848 0% /usr/ports tank/usr/src 1591945600 506752 1591438848 0% /usr/src tank/var/log 1591439104 256 1591438848 0% /var/log atom# df -h Filesystem Size Used Avail Capacity Mounted on /dev/ad12s1a 15G 1.0G 13G 7% / devfs 1.0K 1.0K 0B 100% /dev linprocfs 4.0K 4.0K 0B 100% /usr/compat/linux/proc tank/DATA 1.8T 292G 1.5T 16% /DATA tank/home 1.5T 0B 1.5T 0% /home tank/home/jago 1.5T 128K 1.5T 0% /home/jago tank/home/karni 1.5T 0B 1.5T 0% /home/karni tank/usr/local 1.5T 455M 1.5T 0% /usr/local tank/usr/obj 1.5T 0B 1.5T 0% /usr/obj tank/usr/ports 1.5T 412M 1.5T 0% /usr/ports tank/usr/src 1.5T 495M 1.5T 0% /usr/src tank/var/log 1.5T 256K 1.5T 0% /var/log Considering that every single filesystem is part of the exact same pool, with no custom options whatsoever used during filesystem creation (except for mountpoints), why is the size of tank/DATA 1.8T while the others are 1.5T? - Sincerely, Dan Naumov
On Sat, Jul 4, 2009 at 2:55 PM, Dan Naumov <dan.naumov@gmail.com> wrote:> Hello list. > > I have a single 2tb disk used on a 7.2-release/amd64 system with a > small part of it given to UFS and most of the disk given to a single > "simple" zfs pool with several filesystems without redundancy. I've > noticed a really weird thing regarding what "df" reports regarding the > "total space" of one of my filesystems: > > atom# df -h > Filesystem Size Used Avail Capacity Mounted on > /dev/ad12s1a 15G 1.0G 13G 7% / > devfs 1.0K 1.0K 0B 100% /dev > linprocfs 4.0K 4.0K 0B 100% /usr/compat/linux/proc > tank/DATA 1.8T 292G 1.5T 16% /DATA > tank/home 1.5T 0B 1.5T 0% /home > tank/home/jago 1.5T 128K 1.5T 0% /home/jago > tank/home/karni 1.5T 0B 1.5T 0% /home/karni > tank/usr/local 1.5T 455M 1.5T 0% /usr/local > tank/usr/obj 1.5T 0B 1.5T 0% /usr/obj > tank/usr/ports 1.5T 412M 1.5T 0% /usr/ports > tank/usr/src 1.5T 495M 1.5T 0% /usr/src > tank/var/log 1.5T 256K 1.5T 0% /var/log > > Considering that every single filesystem is part of the exact same > pool, with no custom options whatsoever used during filesystem > creation (except for mountpoints), why is the size of tank/DATA 1.8T > while the others are 1.5T? >Did you set a reservation for any of the other filesystems? Reserved space is not listed in the "general" pool. -- Freddie Cash fjwcash@gmail.com
Hi Dan, basically the "size" in df shows the current free space plus the used space of the specific filesystem. This makes sense: Since per default all disk space is shared, and thus can be used by all filesystems, all filesystems need to report it as free space. Well, and used space has to be added to the complete size, of course. In your setup, there are 1.5TB available, but DATA uses 292GB (rounded to 300GB). Both value add up to 1.8TB, giving the overall size of your pool. (There is another rounding error because of your other filesystems, but they are rather small.) If you, say, add 400GB to tank/home/jago your df would look something like this:> tank/DATA 1.4T 292G 1.1T 16% /DATA > tank/home/jago 1.1T 400G 1.1T 0% /home/jagoIt needs some time to get used to the way df displays data. IMO things are getting easier when one remembers that the OS actually treats every Z Filesystem like an individual device. And BTW: The real fun starts when you add reservation and quotas to some of your filesystems. ;-) HTH Christian