Look man for
prtvtoc
and
du -k
Main Topics
Browse All TopicsWhich command to find total hard disk space in most Solaris platform? df -k isn't enough.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Another easy way is to run "iostat -En" If the disk is a Sun supported disk, it usually says it's size in the "Product" field.
eg... This disk is a 36GB disk in a V480
c1t1d0 Soft Errors: 0 Hard Errors: 0 Transport Errors: 0
Vendor: SEAGATE Product: ST336704FSUN36G Revision: 0826 Serial No: 0102D1E7DA Size: 36.42GB <36418595328 bytes>
Media Error: 0 Device Not Ready: 0 No Device: 0 Recoverable: 0
Illegal Request: 0 Predictive Failure Analysis: 0
Note how the product code ends in SUN36G - that's the size of the disk.
FYI: format shows the same product code info, but without the error counts etc.
There is one problem with this...older IDE disks didn't have the size part of the product code. However, you can always take the product code and stick it into the
"Search handbook" field at http://sunsolve.sun.com
Oh, and one more thing... if you use Solaris 9, you can use the -h flag for "human readable" in the du, df and ls commands... it makes things so much easier to read file and disk sizes.
Of course, if you want the total space for the system, you would need to add all the values you have collected manually.
Hi,
To see all of the slices on all of the disks the easiest thing is:
prtvtoc /dev/rdsk/*s2
To see all disks do this:
format < /dev/null
Both command should be run as root.
Regards, Nisus
http://www.omnimodo.com
Use this script to get the total diskspace, Used disk space and available disk space.
#!/bin/sh
count=0
for i in `df -k|tail +2|awk '{print $2}'`
do
count=`expr $count + $i`
done
echo "Total Disk Space : $count"
count1=0
for i in `df -k|tail +2|awk '{print $3}'`
do
count1=`expr $count1 + $i`
done
echo "Total Disk Used : $count1"
count2=0
for i in `df -k|tail +2|awk '{print $4}'`
do
count2=`expr $count2 + $i`
done
echo "Total Available Space : $count2"
Do you want to know the total space mounted, total space formatted, or total space available on the hard disks?
df -k will show total space mounted
du -k shows the space used and I don't think you asked for that
to get the space formatted and the total space available on the disks themselves you really need to use the command format and select each disk one at a time.
For example, on one of my older servers, I select disk 0, p for partition, then p for print to get;
Total disk cylinders available: 2733 + 2 (reserved cylinders)
Part Tag Flag Cylinders Size Blocks
0 root wm 0 - 67 50.47MB (68/0/0) 103360
1 swap wu 68 - 404 250.12MB (337/0/0) 512240
2 backup wm 0 - 2732 1.98GB (2733/0/0) 4154160
3 var wm 405 - 836 320.62MB (432/0/0) 656640
4 usr wm 837 - 1510 500.23MB (674/0/0) 1024480
5 unassigned wm 1511 - 2022 380.00MB (512/0/0) 778240
6 unassigned wm 0 0 (0/0/0) 0
7 home wm 2023 - 2732 526.95MB (710/0/0) 1079200
Slice 2 represents the whole drive and we can see this drive has 1.98 GB space available in 2,733 blocks.
Slice (Part) 0 is the root partition taking 50.47MB
Slice 1 is the swap taking 250.12MB
and so on...
To see which slices are mounted you can issue the command...
cat /etc/vfstab
# cat /etc/vfstab
#device device mount FS fsck mount mount
#to mount to fsck point type pass at boot options
#
#/dev/dsk/c1d0s2 /dev/rdsk/c1d0s2 /usr ufs 1 yes -
fd - /dev/fd fd - no -
/proc - /proc proc - no -
/dev/dsk/c0t1d0s1 - - swap - no -
/dev/dsk/c0t0d0s0 /dev/rdsk/c0t0d0s0 / ufs 1 no -
/dev/dsk/c0t0d0s4 /dev/rdsk/c0t0d0s4 /usr ufs 1 no -
/dev/dsk/c0t0d0s3 /dev/rdsk/c0t0d0s3 /var ufs 1 no -
/dev/md/dsk/d0 /dev/md/rdsk/d0 /export/home ufs 2 yes -
/dev/md/dsk/d1 /dev/md/rdsk/d1 /data ufs 2 yes -
/dev/dsk/c0t0d0s5 /dev/rdsk/c0t0d0s5 /opt ufs 2 yes -
swap - /tmp tmpfs - yes -
Hello,
To see total disk space used on Solaris 8 and before you can use du -k {some mount point} as in du -k /var On Solaris 9 or later you can use du -k also, but you can also use du -h which displays a number in a human understandable format (k,m,g).
One caveot (There is always one). If you execute this command on a mount point which has another mount point below it, it will add all sub mount points up also.
I.e. du -k / will add all disk space used on you system.
I would like to add to this ,
If you give the command
iostat -E
it will show you every disk on the system with size , and make . You can grep , awk the fields you like for processing . Also will show the disk errors if any , and does not require root access either .
I feel this is the most effective command to get disk space
Business Accounts
Answer for Membership
by: jleviePosted on 2003-07-31 at 21:51:48ID: 9046152
Since you say that 'df -k' isn't suitable, I'd assume that you wan to know the actual disk size as opposed to the usage of file systems on the disk(s). To find the disk size I'd just run format on each disk and get the total disk size by looging at the partition table or the disk ID if it shows the size.