Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
    
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.

eg:

$ zpool list
NAME   SIZE  ALLOC   FREE    CAP  DEDUP  HEALTH  ALTROOT
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...

share|improve this answer
    
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 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 at 16:51
    
Usable, yes. It’s not the space available for data though. See here. – Daniel B Jan 26 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
share|improve this answer
df

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.

share|improve this answer
    
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

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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