Hi
How can I programmatically list disks and their sizes in Solaris?
Is there a way to extract lets say scsi disks from that list?
Thanks
|
|
0
|
|
|
|
Reply
|
hamadani
|
9/30/2003 10:53:32 PM |
|
"babak" <hamadani@uclink.berkeley.edu> wrote in message
news:bb6f754a.0309301453.76cd8e82@posting.google.com...
> How can I programmatically list disks and their sizes in Solaris?
> Is there a way to extract lets say scsi disks from that list?
You would typically use the facilities provided by libdevinfo (which reads
the kernel device tree) to do this. Not sure about extracting SCSI disks
only, but I guess you could try a SCSI enquiry against each.
Cheers,
Shaun
|
|
0
|
|
|
|
Reply
|
Shaun
|
9/30/2003 11:15:30 PM
|
|
hamadani@uclink.berkeley.edu (babak) wrote in message news:<bb6f754a.0309301453.76cd8e82@posting.google.com>...
> Hi
> How can I programmatically list disks and their sizes in Solaris?
> Is there a way to extract lets say scsi disks from that list?
I doubt there is a ready command for this.
The easiest, IMHO, would be to write a script that parses
output of "format" (which can be run non-interactively and gives
the list of disks and their sizes - well, at least one can
calculate the sizes, assuming all sectors are 512 bytes).
"format" also gives the device path, from which the driver name
can be derived. Knowing which drivers are SCSI ones
(SUNW,fas SUNW,scsi etc.), helps to select the SCSI disks.
Regards,
Andrei
|
|
0
|
|
|
|
Reply
|
aryzhov
|
10/1/2003 2:40:36 PM
|
|
aryzhov@my-deja.com (aryzhov) wrote in message news:<7ca75749.0310010640.cd3ec11@posting.google.com>...
> hamadani@uclink.berkeley.edu (babak) wrote in message news:<bb6f754a.0309301453.76cd8e82@posting.google.com>...
> > Hi
> > How can I programmatically list disks and their sizes in Solaris?
> > Is there a way to extract lets say scsi disks from that list?
>
> I doubt there is a ready command for this.
> The easiest, IMHO, would be to write a script that parses
> output of "format" (which can be run non-interactively and gives
> the list of disks and their sizes - well, at least one can
> calculate the sizes, assuming all sectors are 512 bytes).
> "format" also gives the device path, from which the driver name
> can be derived. Knowing which drivers are SCSI ones
> (SUNW,fas SUNW,scsi etc.), helps to select the SCSI disks.
>
> Regards,
> Andrei
guess iostat -En might help you if you want the sizes of disks(not the
size of slices in disk).
For more info man iostat.
|
|
0
|
|
|
|
Reply
|
nicole_learning_sola
|
10/1/2003 7:46:47 PM
|
|
"Shaun Clowes" <delius@no.spam.for.me.progsoc.org> wrote in message
news:m8oeb.53$_84.3343@news.optus.net.au...
>
> "babak" <hamadani@uclink.berkeley.edu> wrote in message
> news:bb6f754a.0309301453.76cd8e82@posting.google.com...
> > How can I programmatically list disks and their sizes in Solaris?
> > Is there a way to extract lets say scsi disks from that list?
>
> You would typically use the facilities provided by libdevinfo (which reads
> the kernel device tree) to do this. Not sure about extracting SCSI disks
> only, but I guess you could try a SCSI enquiry against each.
Sorry, I missed the bit about sizes, that can be easily retrieved from the
vtoc, check out read_vtoc(3X) or the ioctl it calls (DKIOCGEOM) in dkio(7I)
Cheers,
Shaun
|
|
0
|
|
|
|
Reply
|
Shaun
|
10/1/2003 10:15:42 PM
|
|
|
4 Replies
440 Views
(page loaded in 0.058 seconds)
Similiar Articles: Listing Disks in Solaris - comp.unix.solarisHi How can I programmatically list disks and their sizes in Solaris? Is there a way to extract lets say scsi disks from that list? Thanks ... How do I list all my drives in Solaris 10? - comp.unix.solaris ...Hello. Normally in Linux one can do a "fdisk -l" to see what disks they have in their system and what the system calls them (e.g. c0d01) so one can m... Checking for the external disk in Solaris. - comp.unix.solaris ...Hi All, How do i check the number of external disks in the SUN solaris machine. Your help would be greatly appreciated. TIA Kumar ... vxdisk list - comp.unix.solarisHello, i used the command vxdisk list in order to list disk information and i got a flag "reserved", but i don't know what it means. Has anyone an i... what command for checking physical disks or partitions not being ...Hi all, what command in solaris for checking physical disks or partitions not being mounted? In aix, we can tell by lsvg or lspv? thanks V ... Can't see Serial Number in attached disks. - comp.unix.solaris ...Hi, I've got solaris 9 and some EMC disks attached to it. I've run iostat -En command: ..... c2t24d37 Soft Errors: 0 Hard Errors: 0 Transport Err... how to find the size of each disk - comp.unix.solarisListing Disks in Solaris - comp.unix.solaris how to find the size of each disk - comp.unix.solaris Listing Disks in Solaris - comp.unix.solaris how to find the size of ... How to get list of devices on Solaris? - comp.unix.solaris ...Hi, I need to know the list of devices (tape, disk, network, etc) that are attached to my Soalris system, programatically (preferable through a Shel... how to display vxvm vm disk % space usage - comp.unix.solaris ...Listing Disks in Solaris - comp.unix.solaris how to display vxvm vm disk % space usage - comp.unix.solaris ... vxdisk list - comp.unix.solaris disk serial and model ... ufsdump on remote tape drive. - comp.unix.solarisYou'll also need a listing of > >the disk layout and volume manager configuration along with the Solaris > >Install CD. > > You can do remote restores. disk probing on solaris 10 6/06 - Unix Linux Forum - Fixunix.comIs there a way to programmatically list all the hard disk devices attached to a solaris box? format command doesn't help, as it requires user input or How do I list all my drives in Solaris 10?Hello. Normally in Linux one can do a fdisk -l to see what disks they have in their system and what the system calls them (e.g. c0d01) so one can mount them. If I don ... 7/29/2012 9:08:52 AM
|