Gaëtan Lehmann wrote:

Hi,

On opensolaris, I use du with the -b option to get the uncompressed size of a directory):

  r...@opensolaris:~# du -sh /usr/local/
  399M    /usr/local/
  r...@opensolaris:~# du -sbh /usr/local/
  915M    /usr/local/
  r...@opensolaris:~# zfs list -o space,refer,ratio,compress data/local
NAME AVAIL USED USEDSNAP USEDDS USEDREFRESERV USEDCHILD REFER RATIO COMPRESS data/local 228G 643M 249M 394M 0 0 394M 2.51x on
  r...@opensolaris:~# which du
  /usr/gnu/bin/du

but on Solaris 10, there is no such option.

So what is the best way to get the uncompressed size of a directory on Solaris 10?

Install GNU du on solaris 10? Although the answer will be just as (in)accurate as GNU du on solaris 10. Note that it reports the compression ratio as 915/399 = 2.29x, actual is 2.51x. This could be due to sparse files, or metadata like directories, whose "apparent size" (st_size) is not what GNU du expects.

Took me a minute to realize you were talking about the space used under a subdirectory, not the space consumed by the directory itself! I guess I'm the only one creating 400MB directories :-)

--matt
_______________________________________________
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss

Reply via email to