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 -hcontains duplicate information.
Is there any generic way to find the total disk space in Solaris 10?
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...
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.
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
iostat -Enhas no idea about how the disks are used (or not), it displays the whole device size. – jlliagre Aug 05 '13 at 05:59