LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris
User Name
Password
Solaris / OpenSolaris This forum is for the discussion of Solaris, OpenSolaris, OpenIndiana, and illumos.
General Sun, SunOS and Sparc related questions also go here. Any Solaris fork or distribution is welcome.

Notices


Reply
  Search this Thread
Old 10-28-2004, 08:04 AM   #1
looseCannon
Member
 
Registered: Dec 2003
Location: Little Rock, AR
Distribution: Fedora Core 2, AIX, HP-UX, Solaris, Whitebox
Posts: 193

Rep: Reputation: 31
Finding installed raw disks and size


I've been given the task of running through a bunch of Solaris servers to see just how many hard drives and what sizes they are. As you can imagine this is a horrendously boring task and I want to automate it. Problem is, I'm really new to Solaris -- much more well versed in AIX and Linux.

Are there any sort of commands that are suitable for using in a script that would tell me what devices are installed?

On AIX you can issue the command 'lsdev -Cc disk' to get a list of disks the system knows about, so far I can't find anything like this in Solaris. I found the 'format' command, but that is interactive and not suitable for scripting.

Also, is there a command to display any fiber cards that are installed on the system?
 
Old 10-28-2004, 09:04 AM   #2
looseCannon
Member
 
Registered: Dec 2003
Location: Little Rock, AR
Distribution: Fedora Core 2, AIX, HP-UX, Solaris, Whitebox
Posts: 193

Original Poster
Rep: Reputation: 31
I found how to get the internal disks, and it's scripting compatible. Here's what I used:

Code:
iostat -En|grep Size|egrep -v '1.49GB|<-1'|awk '{print $2}'
That returns only the hard drive sizes, and excludes the DVD drives.

Now for finding a command to show the FC adapters.
 
Old 10-28-2004, 09:59 AM   #3
looseCannon
Member
 
Registered: Dec 2003
Location: Little Rock, AR
Distribution: Fedora Core 2, AIX, HP-UX, Solaris, Whitebox
Posts: 193

Original Poster
Rep: Reputation: 31
Guess I'll go ahead and answer all of my own questions. I managed to find the fiber cards by using this command:

Code:
prtconf|grep -c lpfc
In our enviroment we use LP fiber cards, so this works for us. Might not work for others.

The best thing about iostat and prtconf is neither one has to be run as root, so nothing has to be set up for sudo to be able to get this info if a normal user runs these commands.
 
Old 10-28-2004, 12:41 PM   #4
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
Quote:
That returns only the hard drive sizes, and excludes the DVD drives.
Is the egrep -v '1.49GB|<-1' to exclude the DVDs ?

I tried on different systems and depending on if a DVD is mounted I have replies that would pass your filter:
Code:
c0t6d0          Soft Errors: 1 Hard Errors: 0 Transport Errors: 0 
Vendor: TOSHIBA  Product: DVD-ROM SD-M1711 Revision: 1005 Serial No:  
Size: 0.00GB <0 bytes>
Media Error: 0 Device Not Ready: 0 No Device: 0 Recoverable: 0 
Illegal Request: 1 Predictive Failure Analysis: 0
or
Code:
c1t0d0           Soft Errors: 29 Hard Errors: 1 Transport Errors: 0 
Vendor: MATSHITA Product: UJDA720 DVD/CDRW Revision: 1.00 Serial No:  
Size: 0.21GB <212287488 bytes>
Media Error: 0 Device Not Ready: 1 No Device: 0 Recoverable: 0 
Illegal Request: 29 Predictive Failure Analysis: 0
 
Old 10-28-2004, 02:10 PM   #5
looseCannon
Member
 
Registered: Dec 2003
Location: Little Rock, AR
Distribution: Fedora Core 2, AIX, HP-UX, Solaris, Whitebox
Posts: 193

Original Poster
Rep: Reputation: 31
It worked on the initial system, but when I got to running that on a different server I found stuff like you did. Not sure how to keep the DVD's from showing up other than with common sense. Also, it won't keep out an SAN drives, if you have any.

So, this isn't a perfect solution, but at least it's not interactive and won't let you format a drive. Much safer than 'format'
 
Old 02-23-2005, 01:26 PM   #6
kngjms
LQ Newbie
 
Registered: Feb 2005
Posts: 1

Rep: Reputation: 0
So does anyone know a quick way to differentiate what disks are on a SAN and which are physically on the machine?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Checking raw disks brendanmcdonald Linux - General 2 04-20-2005 01:32 AM
Finding size of a directory chrisk5527 Linux - General 2 12-30-2003 08:49 AM
linux equiv. of raw disks and device paths iggymac Linux - Newbie 0 11-20-2003 10:46 PM
About finding partitions on different disks Kroenecker Linux - Newbie 3 05-16-2003 03:37 AM
Listing raw disks GOLDF1NG3R Linux - General 2 11-21-2001 11:00 AM

LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris

All times are GMT -5. The time now is 02:02 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration