wired... zfs list shows different result compared with ls -a

prolab

New Member
Aug 11, 2020
21
3
3
Hi I'm following some tutorials (https://forum.level1techs.com/t/how-to-create-a-nas-using-zfs-and-proxmox-with-pictures/117375) learning to use Proxmox and ZFS. I installed Proxmox using the latest version yesterday and all my disks are just formatted with no errors. But my result is wired, the zfs list result is different with ls -a.

This is the zfs list result.

Code:
root@pve:~# zfs list
NAME                            USED  AVAIL     REFER  MOUNTPOINT
zfsui1                         43.7G  21.1T      128K  /zfsui1
zfsui1/share                   1.01M  21.1T      139K  /zfsui1/share
zfsui1/share/downloads          128K  21.1T      128K  /zfsui1/share/downloads
zfsui1/share/iso                128K  21.1T      128K  /zfsui1/share/iso
zfsui1/share/test1              256K  21.1T      128K  /zfsui1/share/test1
zfsui1/share/test1/test1sub1    128K  21.1T      128K  /zfsui1/share/test1/test1sub1
zfsui1/share/test2              128K  21.1T      128K  /zfsui1/share/test2
zfsui1/share/testa              128K  21.1T      128K  /zfsui1/share/testa
zfsui1/share/testb              128K  21.1T      128K  /zfsui1/share/testb
zfsui1/vm-101-disk-0           43.7G  21.1T      623K  -
zfsui1/vmstorage                394K  21.1T      139K  /zfsui1/vmstorage
zfsui1/vmstorage/limited1000G   128K  1000G      128K  /zfsui1/vmstorage/limited1000G
zfsui1/vmstorage/limited2000G   128K  1.95T      128K  /zfsui1/vmstorage/limited2000G

This is the ls result

Code:
root@pve:~# ls -liarFSBR /zfsui1/
/zfsui1/:
total 16
1179651 drwxr-xr-x  2 root root 4096 Aug 11 14:40 vmstorage/
1179650 drwxr-xr-x 10 root root 4096 Aug 11 15:09 share/
      2 drwxr-xr-x 21 root root 4096 Aug 11 14:40 ../
1179649 drwxr-xr-x  4 root root 4096 Aug 11 14:40 ./

/zfsui1/vmstorage:
total 8
1179649 drwxr-xr-x 4 root root 4096 Aug 11 14:40 ../
1179651 drwxr-xr-x 2 root root 4096 Aug 11 14:40 ./

/zfsui1/share:
total 26
     34 drwxr-xr-x  2 root root    2 Aug 11 15:09 testb/
     34 drwxr-xr-x  2 root root    2 Aug 11 15:09 testa/
     34 drwxr-xr-x  2 root root    2 Aug 11 15:07 test2/
     34 drwxr-xr-x  3 root root    3 Aug 11 15:07 test1/
1179652 drwxr-xr-x  2 root root 4096 Aug 11 15:02 Software/
1179654 drwxr-xr-x  2 root root 4096 Aug 11 15:03 Projects/
1179655 drwxr-xr-x  2 root root 4096 Aug 11 15:03 junk/
1179653 drwxr-xr-x  2 root root 4096 Aug 11 15:03 Backups/
1179649 drwxr-xr-x  4 root root 4096 Aug 11 14:40 ../
1179650 drwxr-xr-x 10 root root 4096 Aug 11 15:09 ./

/zfsui1/share/testb:
total 5
     34 drwxr-xr-x  2 root root    2 Aug 11 15:09 ./
1179650 drwxr-xr-x 10 root root 4096 Aug 11 15:09 ../

/zfsui1/share/testa:
total 5
     34 drwxr-xr-x  2 root root    2 Aug 11 15:09 ./
1179650 drwxr-xr-x 10 root root 4096 Aug 11 15:09 ../

/zfsui1/share/test2:
total 5
     34 drwxr-xr-x  2 root root    2 Aug 11 15:07 ./
1179650 drwxr-xr-x 10 root root 4096 Aug 11 15:09 ../

/zfsui1/share/test1:
total 5
     34 drwxr-xr-x  2 root root    2 Aug 11 15:07 test1sub1/
     34 drwxr-xr-x  3 root root    3 Aug 11 15:07 ./
1179650 drwxr-xr-x 10 root root 4096 Aug 11 15:09 ../

/zfsui1/share/test1/test1sub1:
total 1
34 drwxr-xr-x 2 root root 2 Aug 11 15:07 ./
34 drwxr-xr-x 3 root root 3 Aug 11 15:07 ../

/zfsui1/share/Software:
total 8
1179650 drwxr-xr-x 10 root root 4096 Aug 11 15:09 ../
1179652 drwxr-xr-x  2 root root 4096 Aug 11 15:02 ./

/zfsui1/share/Projects:
total 8
1179650 drwxr-xr-x 10 root root 4096 Aug 11 15:09 ../
1179654 drwxr-xr-x  2 root root 4096 Aug 11 15:03 ./

/zfsui1/share/junk:
total 8
1179650 drwxr-xr-x 10 root root 4096 Aug 11 15:09 ../
1179655 drwxr-xr-x  2 root root 4096 Aug 11 15:03 ./

/zfsui1/share/Backups:
total 8
1179650 drwxr-xr-x 10 root root 4096 Aug 11 15:09 ../
1179653 drwxr-xr-x  2 root root 4096 Aug 11 15:03 ./
root@pve:~#

Note that the "downloads", "iso", "limited1000G", "limited2000G" folders I created following that tutorial using commands like "zfs create zfsui1/share/iso" is not shown in the ls result. But the "test1", "test2", "test1sub", "testa" and "testb" folders also created using this command (zfs create zfsui1/share/test1) did show in the ls result.

On the other hand, the "Software", "Projects", "Backups", "junk" folders I created using commands like "mkdir /zfsui1/share/Software" is not shown in the zfs list result.

It looks wired, why is this? Is this the expected behaviour or is there a bug?
 
Last edited:
Hi,
when you use zfs create you create a whole new zfs filesystem, that is mounted by default below the location one would expect. If you use mkdir you just create a new folder within an existing filesystem.

Are the filesystems that don't show up with ls simply not mounted? Check with e.g. zfs get mounted zfsui1/vmstorage/limited2000.

Now for the space usage, filesystems need to keep metadata, and with ZFS you need to factor in compression and deduplication, etc. So in general you won't necessarily get the same values with ls.