Determining number of hard disks in the system


 
Thread Tools Search this Thread
Operating Systems Solaris Determining number of hard disks in the system
# 8  
Old 03-20-2014
/dev/hd* /dev/sd* is a very linux-specific answer. Not all systems use those device names. For that matter, even Linux doesn't use those all the time -- some RAID cards will give funny names. In Linux, you can check for all block devices in /sys/class/block, and filter out irrelevant ones by looking deeper in /sys/class/block/[device].

Any good answer will have to be system-specific, because this is a management question, not a system environment one.

Last edited by Corona688; 03-20-2014 at 04:30 PM..
# 9  
Old 03-20-2014
This is a Solaris box but is it SPARC or x86?

If SPARC does it have a System Controller? (SC> prompt)
# 10  
Old 03-20-2014
This will give you the count and some more information about each disk on a Solaris machine:
Code:
iostat -En|awk '/^c[0-9]/{printf("\n%3d : ",++d)}{gsub("  *"," ");gsub("[A-Za-z ][A-Za-z ]*: 0 ","");printf("%s ",$0)}END{printf("\n")}'

This User Gave Thanks to jlliagre For This Post:
# 11  
Old 03-21-2014
you should be able to use
Code:
iostat -En

This User Gave Thanks to ossupport55 For This Post:
# 12  
Old 03-24-2014
Blade

Thank you all for the feedback. However this last command didn't help me.
In fact I was trying this command: df -lk, and when execute this command I get this results:

File system 1024-blocks Used Available Capacitiy Mounted on
/dev/dsk/c0t0d0s0 ............................................................................... /
/devices ................................................................................................ /devices
ctfs .................................................................................................... ......./system/contract
.
.
.
.
.
.
.
/dev/dsk/c0t0d0s3 ....................................................................................../tmp
/dev/dsk/c0t1d0s0 ....................................................................................../inglog
/dev/dsk/c0t0d0s5......................................................................................
/dev/dsk/c0t0d0s4......................................................................................
/dev/dsk/c0t1d0s1



So how can I recognize from this output how many disks there are in the system?

Thank you
# 13  
Old 03-24-2014
Quote:
Originally Posted by Mick
So how can I recognize from this output how many disks there are in the system?
There are at least two disks on your system, c0t0d0 and c0t1d0.

Please explain why
Code:
iostat -En|awk '/^c[0-9]/{printf("\n%3d : ",++d)}{gsub("  *"," ");gsub("[A-Za-z ][A-Za-z ]*: 0 ","");printf("%s ",$0)}END{printf("\n")}'

doesn't answer your question ?
# 14  
Old 03-24-2014
Quote:
Originally Posted by jlliagre
There are at least two disks on your system, c0t0d0 and c0t1d0.

Please explain why
Code:
iostat -En|awk '/^c[0-9]/{printf("\n%3d : ",++d)}{gsub("  *"," ");gsub("[A-Za-z ][A-Za-z ]*: 0 ","");printf("%s ",$0)}END{printf("\n")}'

doesn't answer your question ?
Yes, it does answer my question. Sorry, I was refering to /dev/hd* /dev/sd* command.
iostat -En works perfectly. Thank you.


BTW, is c0t0d0 and c0t1d0 this number tx.... indicator how many disks there is in the system?
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. AIX

How to reclaim hard disks and IP's in AIX?

Hello I recently received a request to reclaim hard disks and IP addresses within an AIX system(s). THe file systems are no longer in use and the client has indicated that it is OK to remove them and reclaim the disks and release the IP's. Now, since the file systems belong to a Volume group I... (8 Replies)
Discussion started by: Joseph Sabo
8 Replies

2. UNIX for Advanced & Expert Users

Separated hard disks for Operating System and applications - better IO performance ?

Dear all, I would like to ask if there are any positive effects from having a dedicated hard disk for the operating system. The scenario would be to have a dedicated disk for the OS and a dedicated disk for the applications. Do you see any advantages in such a configuration such as better... (9 Replies)
Discussion started by: petrospis
9 Replies

3. Shell Programming and Scripting

How to get number of attached hard disks in HP-UX

how do i get the number of attached hard disks in HP-UX (1 Reply)
Discussion started by: achak01
1 Replies

4. Solaris

Hard/Transfer errors in disks

Could you please explain us what are these transport/hard errors... when i ran the following command, iostat -E | grep Errors i got the following: sd240 Soft Errors: 37 Hard Errors: 1144 Transport Errors: 0 sd578 Soft Errors: 0 Hard Errors: 890 Transport Errors: 0 Please... (5 Replies)
Discussion started by: sundar3350
5 Replies

5. AIX

Mount points to hard disks

Hi I am oracle DBA and sometimes need to see on which disks oracle data files are residing . How can we check that . The file system is jfs on aix 5.2.0.0 The method is use is to use mount |grep oracle_dir_name or lsfs mount_point_name command to see what /dev/logical_volume_name is mounted... (1 Reply)
Discussion started by: clifford
1 Replies

6. Solaris

Get onyl local hard disks

How can I get only the local hard disks in Solaris? I've tried iostat -x, iostat -E, etc, but it shows the cdroms, dvds, external storage... I want only the local physical hard disks. Thanks. (2 Replies)
Discussion started by: psimoes79
2 Replies

7. Solaris

Hard disks in solaris

I need to insert a new hard disk into a Sun Fire v210 machine. The (only) internal disk which is already in the machine is part number XRA-SC1CB-73G10K (DISK DRIVE ASSY. 73GB, 10K RPM, with SPUD BRACKET). I also have nearly endless access to IBM hard disks at extremely low prices and would there... (2 Replies)
Discussion started by: sprellari
2 Replies

8. Filesystems, Disks and Memory

External Lacie USB hard disks

I'm trying to mount a USB Lacie external hardrive in my Linux system but am having trouble doing so, I'm also having trouble mounting my USB ZIP 250 drive. It is totally me being stupid, but I'm new to unix and am having a few teathing problems. the command I'm using is the following mount... (4 Replies)
Discussion started by: electrode101
4 Replies
Login or Register to Ask a Question