Dennis Clarke
2006-Oct-13 20:31 UTC
[zfs-discuss] no tool to get "expected" disk usage reports
----------------------------- Original Message ----------------------------- Subject: no tool to get "expected" disk usage reports From: "Dennis Clarke" <dclarke at blastwave.org> Date: Fri, October 13, 2006 14:29 To: zfs-discuss at opensolaris.org ---------------------------------------------------------------------------- given : bash-3.1# uname -a SunOS mars 5.11 snv_46 sun4u sparc SUNW,Ultra-2 bash-3.1# zfs list NAME USED AVAIL REFER MOUNTPOINT zfs0 89.4G 110G 24.5K legacy zfs0/backup 65.8G 6.19G 65.8G /export/zfs/backup zfs0/kayak 23.3G 8.69G 23.3G /export/zfs/kayak zfs0/zoner 279M 63.7G 24.5K legacy zfs0/zoner/common 53K 16.0G 24.5K legacy zfs0/zoner/common/postgres 28.5K 4.00G 28.5K /export/zfs/postgres zfs0/zoner/postgres 279M 7.73G 279M /export/zfs/zone/postgres bash-3.1# bash-3.1# zfs get all zfs0/kayak NAME PROPERTY VALUE SOURCE zfs0/kayak type filesystem - zfs0/kayak creation Sun Oct 1 23:42 2006 - zfs0/kayak used 23.3G - zfs0/kayak available 8.69G - zfs0/kayak referenced 23.3G - zfs0/kayak compressratio 1.19x - zfs0/kayak mounted yes - zfs0/kayak quota 32G local zfs0/kayak reservation none default zfs0/kayak recordsize 128K default zfs0/kayak mountpoint /export/zfs/kayak local zfs0/kayak sharenfs off default zfs0/kayak checksum on default zfs0/kayak compression on inherited from zfs0 zfs0/kayak atime on default zfs0/kayak devices on default zfs0/kayak exec on default zfs0/kayak setuid on default zfs0/kayak readonly off default zfs0/kayak zoned off default zfs0/kayak snapdir hidden default zfs0/kayak aclmode groupmask default zfs0/kayak aclinherit secure default bash-3.1# pwd /export/zfs/kayak bash-3.1# ls c d e f g bash-3.1# du -sk c 1246404 c bash-3.1# find c -type f -ls | awk ''BEGIN{ ttl=0 }{ ttl+=$7 }END{ print "Total size " ttl }'' Total size 1752184261 Due to compression there is no easy way to get the "expected" total size of a tree of files and directories. worse, there may be various ways to get a sum total of files in a tree but the results may be wildly different from what du reports thus : bash-3.1# find f -type f -ls | awk ''BEGIN{ ttl=0 }{ ttl+=$7 }END{ print "Total size " ttl }'' Total size 3387278008853146 bash-3.1# du -sk f 22672288 f bash-3.1# Is there a way to modify du or perhaps create a new tool ? Dennis