Krister Joas
2005-Nov-23 11:19 UTC
[zfs-discuss] Files from other files systems "leaks" when using du
Hi, I''m running Nevada 27a (upgraded from source from 26) on an x86 machine and am using zfs. I''m observing strange behaviour when using /bin/du to check space on a zfs file system. I''m also using snapshots. For example: % df -kh -F zfs Filesystem size used avail capacity Mounted on fs 110G 13K 63G 1% /fs fs/backup 110G 34G 63G 35% /fs/backup fs/cvs 110G 12K 63G 1% /fs/cvs fs/cvs/dragonflybsd 1.0G 658M 361M 65% /fs/cvs/dragonflybsd fs/cvs/freebsd 4.0G 2.6G 1.3G 67% /fs/cvs/freebsd fs/cvs/netbsd 4.0G 3.6G 390M 91% /fs/cvs/netbsd fs/cvs/openbsd 4.0G 2.5G 1.5G 64% /fs/cvs/openbsd fs/cvs/opendarwin 4.0G 1.0G 3.0G 27% /fs/cvs/opendarwin fs/cvs/xfree86 4.0G 857M 3.2G 21% /fs/cvs/xfree86 fs/cvs/xorg 4.0G 915M 3.1G 23% /fs/cvs/xorg fs/distfiles 4.0G 228M 3.8G 6% /fs/distfiles fs/home 16G 8K 16G 1% /fs/home fs/home/krister 4.0G 8K 4.0G 1% /fs/home/krister fs/local 650M 8K 590M 1% /fs/local fs/src 650M 420M 230M 65% /fs/src fs/var 650M 8K 649M 1% /fs/var fs/work 650M 8K 397M 1% /fs/work % cd /fs/local % ls -la total 4 drwxr-xr-x 2 root sys 2 Nov 20 05:45 . drwxr-xr-x 10 root sys 10 Nov 19 13:50 .. dr-xr-xr-x 3 root root 3 Nov 23 20:14 .zfs % /bin/du 2 ./.zfs/snapshot/original/emul 4 ./.zfs/snapshot/original 4 ./.zfs/snapshot 4 ./.zfs 0 ./backup/.zfs/snapshot 0 ./backup/.zfs 72 ./backup/cvs/wine/wine/controls/Attic 3759 ./backup/cvs/wine/wine/controls 813 ./backup/cvs/wine/wine/windows/Attic 1632 ./backup/cvs/wine/wine/windows/x11drv/Attic 1634 ./backup/cvs/wine/wine/windows/x11drv 130 ./backup/cvs/wine/wine/windows/ttydrv/Attic 132 ./backup/cvs/wine/wine/windows/ttydrv 10875 ./backup/cvs/wine/wine/windows 1213 ./backup/cvs/wine/wine/loader/Attic 288 ./backup/cvs/wine/wine/loader/dos/Attic 290 ./backup/cvs/wine/wine/loader/dos 305 ./backup/cvs/wine/wine/loader/ne/Attic 822 ./backup/cvs/wine/wine/loader/ne 3357 ./backup/cvs/wine/wine/loader ^C Using truss on du it seems that maybe chdir("..") in the snapshot directories is the culprit because du also doesn''t get the size of the snapshot directory correct. -- Krister