Operating System - Tru64 Unix
1748010 Members
4893 Online
108757 Solutions
New Discussion юеВ

Re: how to know the disk's capacity

 
SOLVED
Go to solution
hy_3
Frequent Advisor

how to know the disk's capacity

I have two machines:alpha2100+V4.0F and es40+V5.1A.Now I want to know each disk's capacity on the two machines.Which command should I use?Thank you.
7 REPLIES 7
Ravi_8
Honored Contributor
Solution

Re: how to know the disk's capacity

Hi,

on V5.1A use
#diskconfig

which opens a GUI , click on each disks you can see the size of the disks.

in 4.0F use the tool 'sysconf' which creates a html file, open the html using netscape/IE which gives entire config of the machine.
never give up
Johan Brusche
Honored Contributor

Re: how to know the disk's capacity


On V5.x (capacity is in 512byte blocks)

hwmgr -get attrib -cat scsi | grep -e dsk -e capacity

Enjoy,
Johan.

_JB_
Hein van den Heuvel
Honored Contributor

Re: how to know the disk's capacity

V4:

for an operational disk:

disklabel -r

for a new disk:

disklabel -z
disklabel -rw
disklabel -r

Hein.
hy_3
Frequent Advisor

Re: how to know the disk's capacity

Thank you.I'll try it.
Orrin
Valued Contributor

Re: how to know the disk's capacity

Hi,
All the previous answers will work. For all the disk this can get a bit tedious, I use the following script.

disk=`/sbin/hwmgr -view dev | grep dsk | awk '{print $2}' | cut -d/ -f4`
for id in $disk
do
/sbin/disklabel -r $id
if (( $? ))
then
print " No Label for $id "
else
DISK_ID=`/sbin/disklabel -r $id | grep dsk`
let SIZE=`/sbin/disklabel -r $id | grep sectors/unit | awk '{print $2}'`
let SIZE_GB=$SIZE/2097152
echo $SIZE_GB $id
fi
done

For v4.0F the command to get the disk id's is different but you can modify the script to give you the disk id's the rest is the same.
Hope this helps..

regards,
Orrin.
hy_3
Frequent Advisor

Re: how to know the disk's capacity

Thank you for your reply.Now I have some questions.On V4.0F,how can I know how much disks a machine has and what name each disk is?On V5.1A,if there are lots of disks in a machine and I just want to know a disk's capacity(such as dsk10),how should I do?Thank you.
Hein van den Heuvel
Honored Contributor

Re: how to know the disk's capacity

The script by Orrin shoudl do fine.
However the hwmgr is designed to handle your question in one og. Please check it's man pages. hwmgr is your friend!

Here is a single command line that answers your question on V5.1

hwmgr -get attrib -cat disk -a capacity -a dev_base_name

You can massage the output to your liking. For example, if you like that listed as 'disk size' then just pipe it into awk:
| awk '/nam/{d=$3}/cap/{print d,$3}

Now I do not have a v4.0 handy. But here is a disklabel based command that should be easily adapted to V4 (change to /dev/rrz* ?)

find /dev/rdisk -follow -name "dsk1*a" -exec disklabel -r {} \; | awk '/#/{d=$2}/unit/{print d,$2}'


Cheers,
Hein.