How do I get the total disk space available in Solaris 10?

  • I used iostat -En, but it is not showing the correct data.
  • df -h contains duplicate information.

Is there any generic way to find the total disk space in Solaris 10?

  • iostat -En has no idea about how the disks are used (or not), it displays the whole device size. – jlliagre Aug 5 '13 at 5:59
  • Hi jlliagre, you are right, i have given it wrong. Correct command is df -k, But,it contains duplicate info. How to remove it and get exact disk space. – prasanna Aug 19 '13 at 9:30

Assuming that by duplicate information, you mean you are confused by df available space column reporting the same value for different ZFS file systems located in the same pool, I would suggest to use the zpool list command to get disk statistics similar to what df outputs for traditional file systems.


$ zpool list
zp    97.5G  46.0G  51,5G    47%  1.00x  ONLINE  -

Note that the reported numbers are directly usable only when a single backend device is used for the pool, or if it built on concatenated disks only. When using mirroring or any form of raidz, it is much more complex to estimate the actual free space, not to mention if compression and/or deduplication is activated...

  • Thanks for the command, it worked well in 5.11, will check in some other versions of solaris. – prasanna Aug 20 '13 at 5:28
  • This command definitely works with all versions of Solaris supporting ZFS and more generally with any OS supporting ZFS. – jlliagre Aug 20 '13 at 5:49
  • If the pool is using RAID vdevs, this doesn’t display the usable capacity/free but backend capacity/free, which is much greater, depending on RAID level. – Daniel B Jan 26 '16 at 16:26
  • @DanielB Double check, zpool does display the usable capacity regardless of the raid level, or lack of, not the backend one. – jlliagre Jan 26 '16 at 16:51
  • Usable, yes. It’s not the space available for data though. See here. – Daniel B Jan 26 '16 at 21:43

You may use the -t <filesys> option of df, to limit its output to some types of file system, As an example, on my system df -h gives :

Filesystem      Size  Used Avail Use% Mounted on
rootfs           63G   19G   42G  31% /
/dev/sda3        63G   19G   42G  31% /
devtmpfs        2.0G     0  2.0G   0% /dev
tmpfs           2.0G  804K  2.0G   1% /run
shm             2.0G     0  2.0G   0% /dev/shm
cgroup_root      10M     0   10M   0% /sys/fs/cgroup
/dev/sda2        16G  4.0G   11G  27% /var
/dev/sda6       834G   52G  741G   7% /home

while df -h -t ext4 gives :

Filesystem      Size  Used Avail Use% Mounted on
/dev/sda3        63G   19G   42G  31% /
/dev/sda2        16G  4.0G   11G  27% /var
/dev/sda6       834G   52G  741G   7% /home

If you want to sum over more than one type of partition, just add an other -t option, like :

df -h -t ext4 -t ext3 -t vfat
  • This does not look like Solaris output. – jww Jul 9 '16 at 18:00

Use the df command to show the amount of free disk space on each mounted disk.

df -k  

Use the df -k command to display disk space information in Kbytes.

  • df -k command shows disk space in bytes, while summing up the size gives wrong data, since it lists every logical mount. The below command will not give the unique list, i need to get a unique mount list, so that, i can get the correct size df -k | awk 'NR>1' | awk '{x+=$2} END {print x}' – prasanna Aug 5 '13 at 6:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.