Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to determine the size of a raw device? 1

Status
Not open for further replies.

whn

Programmer
Oct 14, 2007
265
US
Hi, Experts,

I wonder if there is a simple command that can show the size of a raw device.

For instance,

Code:
% pwd
/dev/rdsk
% ls -l c3t5006016839A02025d8s2
lrwxrwxrwx   1 root     root          83 Jul 31 11:29 c3t5006016839A02025d8s2 -> ../../devices/pci@7c0/pci@0/pci@9/QLGC,qlc@0,1/fp@0,0/ssd@w5006016839a02025,8:c,raw

How do I tell the size of c3t5006016839A02025d8s2?

One command I know is 'newfs'. However, I might get an IO error, if this device was not labeled.

The other command is 'format' which requires user interaction, so that I can not use it in my perl script.

Is there other commands that I can use?

Many thanks.
 
The command "prtvtoc" will give you how the device was partitioned, assuming it was partitioned. This is whether a filesystem has been put on it or not.

If it's had a filesystem put on any partition, "df" should show you usage, but that would require it to be mounted.

Format can be used without it requiring user interaction. Just look at the "man" page for "format". You can give it a device to look at on the command line, as well as a file containing commands to use.


 
luxadm right?

/usr/sbin/luxadm display /dev/rdsk/c3t5006016839A02025d8s2
 
I love this forum. I can never pick up these commands like luxadm from a book! Thank you, elgrandeperro!

Thank you too, SamBones. I just figured out how to use 'format' w/o user interaction. But I still like elgrandeperro's method.
 
For info, there are some more 'fibre' commands that you might find useful:
man mpathadm
man fcinfo (Solaris 10 only)


I hope that helps.

Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top