#4188 FreeBSD9.1 - ZFS - Disk Space incorrectly calculated


I installed PCBSD9.1 (Based on FreeBSD9.1) on a 16GB USB stick. The default FS is ZFS with root.

When I installed Webmin the "System Information" displays "Local disk space" as "117.74 GB total, 3.95 GB used".

This is impossible. I think Webmin is calculating all of the ZFS mounts as separate disks or FS's and adding them together.

I also noticed on FreeBSD Webmin does not show Partitions on local disks.


1 2 > >> (Page 1 of 2)
  • Jamie Cameron

    Jamie Cameron - 2013-01-24

    What does the `df -k` command output on your system?

  • Jamie Cameron

    Jamie Cameron - 2013-02-12

    Ok, I've found the bug that causes this now .. and will include a fix in the next Webmin release.

  • Jamie Cameron

    Jamie Cameron - 2013-02-12
    • status: open --> closed-fixed
  • Marco Schilder

    Marco Schilder - 2014-01-05

    I still have this issue, 1.660, Ubuntu 12.04 LTS. The system has 1x60GB for the OS and 4x2TB for storage (ZFS). Webmin shows 37.10TB local storage, it is counting all the mounts as every ZFS volume has a new local mount.

  • Jamie Cameron

    Jamie Cameron - 2014-01-05

    I recently found another bug that can cause this, which will be fixed in the 1.670 Webmin release.

  • Marco Schilder

    Marco Schilder - 2014-01-19

    Updated to release 1.670, problem still exists.

  • Jamie Cameron

    Jamie Cameron - 2014-01-19

    Unfortunately 1.670 introduced a different bug in the computation of total disk space. But this will be fixed in 1.680, which should be out next week (promise!)

  • Marco Schilder

    Marco Schilder - 2014-02-16

    Any idea when the 1.680 update will be available? :)

  • Jamie Cameron

    Jamie Cameron - 2014-02-17

    A fix for this is also available in version 1.675, which is available from http://www.webmin.com/devel.html

  • Marco Schilder

    Marco Schilder - 2014-02-19

    I'm afraid updating to 1.675 didn't solve it. Is there any way I can provide you with some extra information, a standard checklist sort a way? Something that gives you a hint about maybe something I configured in a wrong or different way than usual.
    Don't get me wrong! I have a lot of appreciation for the work you put in this, but perhaps it is more guessing as solving right now :) I do get the idea behind Open Source where you do this all 'free of charge', if there is anything I could help you with/troubleshoot I would gladly do that.

  • Jamie Cameron

    Jamie Cameron - 2014-02-20

    Marco - can you post the output of the following commands :

    df -h
    cat /etc/mtab

  • Marco Schilder

    Marco Schilder - 2014-02-24

    Certainly :)

    mschilder@nas:~$ df -h
    Filesystem Size Used Avail Use% Mounted on
    /dev/sda2 23G 7.4G 15G 34% /
    udev 3.7G 4.0K 3.7G 1% /dev
    tmpfs 1.5G 540K 1.5G 1% /run
    none 5.0M 0 5.0M 0% /run/lock
    none 3.7G 0 3.7G 0% /run/shm
    cgroup 3.7G 0 3.7G 0% /sys/fs/cgroup
    /dev/sda1 94M 124K 94M 1% /boot/efi
    data 2.0T 384K 2.0T 1% /data
    data/apps 2.1T 54G 2.0T 3% /data/apps
    data/backup 2.1T 41G 2.0T 2% /data/backup
    data/documents 2.0T 1.9G 2.0T 1% /data/documents
    data/downloads 2.1T 101G 2.0T 5% /data/downloads
    data/dreambox 2.0T 256K 2.0T 1% /data/dreambox
    data/kvm 2.0T 17G 2.0T 1% /data/kvm
    data/movies 3.4T 1.4T 2.0T 42% /data/movies
    data/music 2.1T 107G 2.0T 5% /data/music
    data/owncloud 2.0T 2.4G 2.0T 1% /data/owncloud
    data/pictures 2.1T 23G 2.0T 2% /data/pictures
    data/scanner 2.0T 258M 2.0T 1% /data/scanner
    data/timemachine 2.1T 95G 2.0T 5% /data/timemachine
    data/tvshows 3.4T 1.4T 2.0T 41% /data/tvshows
    data/videos 2.1T 60G 2.0T 3% /data/videos
    data/xbmc 2.0T 30M 2.0T 1% /data/xbmc

    mschilder@nas:~$ mount
    /dev/sda2 on / type ext4 (rw,errors=remount-ro)
    proc on /proc type proc (rw,noexec,nosuid,nodev)
    sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
    none on /sys/fs/fuse/connections type fusectl (rw)
    none on /sys/kernel/debug type debugfs (rw)
    none on /sys/kernel/security type securityfs (rw)
    none on /sys/firmware/efi/efivars type efivarfs (rw)
    udev on /dev type devtmpfs (rw,mode=0755)
    devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
    tmpfs on /run type tmpfs (rw,noexec,nosuid,size=10%,mode=0755)
    none on /run/lock type tmpfs (rw,noexec,nosuid,nodev,size=5242880)
    none on /run/shm type tmpfs (rw,nosuid,nodev)
    cgroup on /sys/fs/cgroup type tmpfs (rw,relatime,mode=755)
    cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,relatime,cpuset)
    cgroup on /sys/fs/cgroup/cpu type cgroup (rw,relatime,cpu)
    /dev/sda1 on /boot/efi type vfat (rw)
    data on /data type zfs (rw)
    data/apps on /data/apps type zfs (rw)
    data/backup on /data/backup type zfs (rw)
    data/documents on /data/documents type zfs (rw)
    data/downloads on /data/downloads type zfs (rw)
    data/dreambox on /data/dreambox type zfs (rw)
    data/kvm on /data/kvm type zfs (rw)
    data/movies on /data/movies type zfs (rw)
    data/music on /data/music type zfs (rw)
    data/owncloud on /data/owncloud type zfs (rw)
    data/pictures on /data/pictures type zfs (rw)
    data/scanner on /data/scanner type zfs (rw)
    data/timemachine on /data/timemachine type zfs (rw)
    data/tvshows on /data/tvshows type zfs (rw)
    data/videos on /data/videos type zfs (rw)
    data/xbmc on /data/xbmc type zfs (rw)
    rpc_pipefs on /run/rpc_pipefs type rpc_pipefs (rw)
    nfsd on /proc/fs/nfsd type nfsd (rw)

    mschilder@nas:~$ cat /etc/mtab
    /dev/sda2 / ext4 rw,errors=remount-ro 0 0
    proc /proc proc rw,noexec,nosuid,nodev 0 0
    sysfs /sys sysfs rw,noexec,nosuid,nodev 0 0
    none /sys/fs/fuse/connections fusectl rw 0 0
    none /sys/kernel/debug debugfs rw 0 0
    none /sys/kernel/security securityfs rw 0 0
    none /sys/firmware/efi/efivars efivarfs rw 0 0
    udev /dev devtmpfs rw,mode=0755 0 0
    devpts /dev/pts devpts rw,noexec,nosuid,gid=5,mode=0620 0 0
    tmpfs /run tmpfs rw,noexec,nosuid,size=10%,mode=0755 0 0
    none /run/lock tmpfs rw,noexec,nosuid,nodev,size=5242880 0 0
    none /run/shm tmpfs rw,nosuid,nodev 0 0
    cgroup /sys/fs/cgroup tmpfs rw,relatime,mode=755 0 0
    cgroup /sys/fs/cgroup/cpuset cgroup rw,relatime,cpuset 0 0
    cgroup /sys/fs/cgroup/cpu cgroup rw,relatime,cpu 0 0
    /dev/sda1 /boot/efi vfat rw 0 0
    data /data zfs rw 0 0
    data/apps /data/apps zfs rw 0 0
    data/backup /data/backup zfs rw 0 0
    data/documents /data/documents zfs rw 0 0
    data/downloads /data/downloads zfs rw 0 0
    data/dreambox /data/dreambox zfs rw 0 0
    data/kvm /data/kvm zfs rw 0 0
    data/movies /data/movies zfs rw 0 0
    data/music /data/music zfs rw 0 0
    data/owncloud /data/owncloud zfs rw 0 0
    data/pictures /data/pictures zfs rw 0 0
    data/scanner /data/scanner zfs rw 0 0
    data/timemachine /data/timemachine zfs rw 0 0
    data/tvshows /data/tvshows zfs rw 0 0
    data/videos /data/videos zfs rw 0 0
    data/xbmc /data/xbmc zfs rw 0 0
    rpc_pipefs /run/rpc_pipefs rpc_pipefs rw 0 0
    nfsd /proc/fs/nfsd nfsd rw 0 0

  • Jamie Cameron

    Jamie Cameron - 2014-02-25

    Thanks - and in your case, what are the total and free disk space shown as?

  • Marco Schilder

    Marco Schilder - 2014-02-25

    That's another thing; the total amount varies ;) It used to be around 43TB, yesterday it was about 35.2TB and now it is 34.93TB. And I haven't changed anything to the filestructure for about 2 months now.

    The used space right now is 3.21TB.

    Last edit: Marco Schilder 2014-02-25
  • Jamie Cameron

    Jamie Cameron - 2014-02-26

    Ok, it looks like the reason is that ZFS mounts are being counted multiple times. What does the command "zpool list" output on your system?

  • Marco Schilder

    Marco Schilder - 2014-02-26

    This is the output:

    mschilder@nas:~$ sudo zpool list
    [sudo] password for mschilder:
    data 7.25T 4.41T 2.84T 60% 1.00x ONLINE -

  • Jamie Cameron

    Jamie Cameron - 2014-02-26

    Thanks. So how large is your "data" pool exactly? What is confusing Webmin is that according to df there are several mounts pools like data/apps , data/videos, etc that have different sizes. And yet I assume they all share the same actual pool of space?

  • Marco Schilder

    Marco Schilder - 2014-02-27

    The data pool consists of 4x 2TB in RAIDZ (so that leaves roughly 5,8TB) with a SSD for caching and logging.

    Now that you mention, it seems indeed that Linux as an OS has a struggle to determine the total disk size too. Perhaps this is not really a Webmin problem, rather a ZFS/Ubuntu problem?

  • Jamie Cameron

    Jamie Cameron - 2014-02-27

    Yeah, the concept of "free disk space" in ZFS is unclear. In your case, the sum total of the sizes of all your ZFS mounts (as shown by df -h) is greater than the 5.8 TB that is actually in the ZFS pool!

  • cadatoiva

    cadatoiva - 2015-09-27

    Still having this issue in 1.760
    I don't know where in the program the relevant code is, but could it be possible to ignore the output of df -h for zfs filesystems when zfs is detected as in use and substitute the output of zpool list in its place?

  • cadatoiva

    cadatoiva - 2015-09-27

    Yes, here is the full output:
    $ zpool list
    tank 7.25T 1.69T 5.56T - - 23% 1.00x ONLINE -

  • cadatoiva

    cadatoiva - 2015-09-27

    Looking at the code, part of the bug might be that your command is also printing the headers and arbitrary spacing for the zpool lists. the -H option outputs a script parseable format that separates lines by a single tab. the -o option lets you specify which stats and in what order they will be output.

    I've never been very good at coding, and never took the time to learn perl, so that's the only thing that stands out to me.

    Actually, I think I found the bug. My zpool is called 'tank' but it is mounted at /files/ with most (but not all) sub-filesystems sub mounted within /files/
    It looks like your regex is looking for it to be mounted in a folder that's the same name as the zpool?

    Here is the output of zfs list for verification:

    zfs list

    tank 1.23T 3.87T 69.4G /files
    tank/Minecraft 85.3M 3.87T 209K /files/Minecraft
    tank/Minecraft/worlds 85.1M 3.87T 85.1M /usr/local/minecraft-server/worlds
    tank/torrents 546G 3.87T 546G /files/Torrents
    tank/users 645G 3.87T 645G /files/users

    Last edit: cadatoiva 2015-09-27
  • Jamie Cameron

    Jamie Cameron - 2015-09-27

    The current code runs "zpool list" to get the list of pools ("tank" in your case), and then looks for filesystems whose device is like tank/something .. and only counts the size of the first one when working out available space. However, in your case the /files filesystem is just mounted from "tank" which Webmin doesn't recognize as it is expecting tank/something.

    I will fix this in the next Webmin release.

  • cadatoiva

    cadatoiva - 2015-09-27

    Thanks. I appreciate it.

1 2 > >> (Page 1 of 2)

Log in to post a comment.