1844201 Members
2553 Online
110229 Solutions
New Discussion

Disk sizes

 
Midrange Systems Unix
Occasional Contributor

Disk sizes

How can I find out the internal disk sizes from a command line. I need this info for a script I am writing.
6 REPLIES 6
John Carr_2
Honored Contributor

Re: Disk sizes

Tomek Gryszkiewicz
Trusted Contributor

Re: Disk sizes

ioscan -C disk
will show something like:
1/2/0/0.3.0 disk HP 36.4GMAN3367MC

This is 36.4 G disk
Robert-Jan Goossens
Honored Contributor

Re: Disk sizes

Hi,

You can use the diskinfo command

# diskinfo -v /dev/rdsk/c?t?d?

regards,
Robert-Jan
Fabio Ettore
Honored Contributor

Re: Disk sizes

Hi,

# ioscan -fnC disk
# diskinfo /dev/rdsk/cXtXdX
and see the size row.

man diskinfo
What you see is what you want!

Best regards,
Ettore
WISH? IMPROVEMENT!
Patrick Wallek
Honored Contributor

Re: Disk sizes

Yet another way:

As long as the disk is part of a VG you can use the pvdisplay command.

# pvdisplay /dev/dsk/c0t6d0
--- Physical volumes ---
PV Name /dev/dsk/c3t6d0
VG Name /dev/vg00
PV Status available
Allocatable yes
VGDA 2
Cur LV 9
PE Size (Mbytes) 16
Total PE 1093
Free PE 133
Allocated PE 960
Stale PE 0
IO Timeout (Seconds) default
Autoswitch On

To find the size take the "PE Size" x "Total PE". In this case 16 x 1093 = 17488 MB

This is the size usable by LVM. The information from diskinfo is the size reported by the disk, which may not all be usable.
Geoff Wild
Honored Contributor

Re: Disk sizes

As others have said, iocan -fnC disk and diskinfo /dev/rdsk/cXtXdX

Also, if you are SAN attached, then you may have some other tools to look at:

For example, if using EMC, check out the syminq command.

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.