SUMMARY: command line way to determine disk size (in MB or GB)

From: Gene Matthews <>
Date: Mon Dec 30 2002 - 09:44:12 EST
Thanks to all who responded:

Peter Wallis

Mike Brown

John Riddoch

Patrick O'Reilly

Nico Wieland

Sean Burke


John Julian

Lee Webb

Juergen Waiblinger

Gurcan Erim

A. Ayhan Kanmaz

Marco Breedeveld

- A lot of the suggestions were for 'iostat -En".    That gave me what I was
looking for on Solaris 8; on my 2.6 boxes, the output wasn't reliable.

- 'df -h' was also suggest by several.  I don't have the GNU utils intalled
so I don't have that option.  I'll have to investigate that for future use,

- Another suggestion was:

format << eot | grep '^  2'





That worked also.

Finally, right after I sent the request, I was looking at the 'format' man
page and noticed the -f flag.  I used that.  I created a file called
'formatcmds' that contained the following lines:



and then used 'format -f formatcmds -d c0t0d0 .

I think the df -h command may be the way to go for the future.

Thanks again for the input.

Original post is below.


-----Original Message-----
From: Gene Matthews []
Sent: Monday, December 30, 2002 9:15 AM
To: ''
Subject: command line way to determine disk size (in MB or GB)

I feel somewhat silly having to ask this.  I must me missing something
searching with 'man -k'.

I'm looking for a way from the command line to determine the size (in MB or
GB) of a disk.

I have looked at prtvtoc and devinfo, but they seem to only give numbers
like 'blocks per cylinder', 'bytes per block', and number of cylinders.  I
know I can do the math with those numbers and come up with those commands,
but I was hoping for something that I could do from the command line and
then just grep/awk what I needed from the output.

Is there command that will provide this information?  I thought prtvtoc
might do it since with the 'format' command when you print the partition
table it will show you sizes by partition in gigabytes.  If I could get that
output from the command line, I can grep/awk out what I need.

Any thoughts?  Am I missing something obvious?


sunmanagers mailing list
Received on Mon Dec 30 09:47:47 2002

This archive was generated by hypermail 2.1.8 : Thu Mar 03 2016 - 06:43:01 EST