Solaris / OpenSolarisThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
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.
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'
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.