title: Using java, how do you get the amount of free space on a solaris zfs file system?
body: <p>Using java, how do you get the amount of free space on a solaris zfs file system?</p>
  
  <p>I have a SunFire x4140 with built-in hdd mounted as /. It also has a connected JBOD with 7.6TB of HDD space, configured as a ZFS file system and mounted as /app.</p>
  
  <p>I use java.io.File.getUsableSpace or java.io.File.getFreeSpace to get the amount of free space on the file system. On / (the on-board) HDD FS it works correctly.</p>
  
  <p>On /app (the zfs partition) File.getFreeSpace, File.getUsableSpace  and File.getTotalSpace all return 0 (zero). Does anyone know why? Does java.io.File.getUsableSpace work on ZFS, and if so, how?</p>
  
  <p>The following shows the zfs file system on the machine in question: </p>
  
  <blockquote>
    <p>/usr/sbin/zfs list</p>
  </blockquote>
  
  <pre><code>NAME                USED  AVAIL  REFER  MOUNTPOINT
  internal            196K  98.4G     1K  none
  internal/logs        18K  98.4G    18K  /logs
  j4200-1             442G  7.57T  2.44K  none
  j4200-1/app         442G  7.57T   153M  /app
  j4200-1/app@first   442G      -   442G  - 
  </code></pre>