getting number of disks in solaris

Thread Tools Search this Thread
Top Forums Shell Programming and Scripting getting number of disks in solaris
# 1  
Old 10-13-2009
getting number of disks in solaris

i have used the following code to get the number of disks in solaris
echo | pfexec format | egrep -v "Searching|AVAILABLE|Specify|^$|@" | wc -l

is there a better way to get the same result
# 2  
Old 10-13-2009
/etc/mnttab has all of the mounted volumes and devices as well as /proc and /dev/fd
# 3  
Old 10-13-2009
cd /proc
bash-3.00# ls
0      118    12926  13537  17128  18485  2      217    23168  304    355    426    665    897    97
1      1198   13499  13538  18202  18508  206    220    23178  306    368    432    678    898
1023   120    13505  13539  18205  18735  210    226    234    327    395    433    679    9
112    12357  13529  13668  18209  18738  215    227    237    331    396    489    7      960
1167   12923  13533  17113  18472  18742  216    228    3      3458   397    4990   710    963
bash-3.00# cat /etc/mnttab
/dev/dsk/c0t0d0s0       /       ufs     rw,intr,largefiles,logging,xattr,onerror=panic,dev=800000       1254981644
/devices        /devices        devfs   dev=51c0000     1254981638
ctfs    /system/contract        ctfs    dev=5200001     1254981638
proc    /proc   proc    dev=5240000     1254981638
mnttab  /etc/mnttab     mntfs   dev=5280001     1254981638
swap    /etc/svc/volatile       tmpfs   xattr,dev=52c0001       1254981638
objfs   /system/object  objfs   dev=5300001     1254981638
/platform/sun4u-us3/lib/libc_psr/   /platform/sun4u-us3/lib/   lofs    dev=800000      1254981643
/platform/sun4u-us3/lib/sparcv9/libc_psr/   /platform/sun4u-us3/lib/sparcv9/   lofs    dev=800000      1254981643
/dev/dsk/c0t0d0s5       /var    ufs     rw,intr,largefiles,logging,xattr,onerror=panic,dev=800005       1254981645
swap    /tmp    tmpfs   xattr,dev=52c0002       1254981645
swap    /var/run        tmpfs   xattr,dev=52c0003       1254981645
/dev/dsk/c0t0d0s3       /export/home    ufs     rw,intr,largefiles,logging,xattr,onerror=panic,dev=800003       1254981648
-hosts  /net    autofs  nosuid,indirect,ignore,nobrowse,dev=5500001     1254981651
auto_home       /home   autofs  indirect,ignore,nobrowse,dev=5500002    1254981651
amsun1:vold(pid327)     /vol    nfs     ignore,noquota,dev=54c0001      1254981653  /ovnis  nfs     rw,xattr,dev=54c0002    1255081083

# 4  
Old 10-13-2009
from what I see, you have one physical disk, three slices of which is being used in /, /var, /export/home mountpoints

also - try to use format command
# 5  
Old 10-13-2009
iostat -En

is commonly use to get disk information on Solaris.
# 6  
Old 11-09-2009
get # of disks

this works well:

format < /dev/null | grep c[1-9]

and you get the list of disks already numbered for you.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

Determining number of hard disks in the system

Hello to all, what is the command in Solaris/Unix which I can use to determine how many hard disks exist in the system? I have tried with different command such as df -lk and similar but cannot know for sure how many actual disks are installed. Commands like # fdisk -l | grep Disk and #... (14 Replies)
Discussion started by: Mick
14 Replies

2. AIX

Safe Number of Disks Assigned to a VIO Server

Is there any sort of best practice as to how many disks should be assigned to a VIO server? I currently have around 190-ish. All of my VIO servers can see those disks. Can anyone tell me how many you have on your VIO servers? (3 Replies)
Discussion started by: kah00na
3 Replies

3. Shell Programming and Scripting

getting number of disks inside a solaris zone

Friends, I am really stuck on this one. In solaris i can get the number of disks using this command --> pfexec format | egrep -v "Searching|AVAILABLE|Specify|^$|@" | wc -l But when applying this command inside a solaris zone ,the format command doesnt work. any ideas on how i can go about it (1 Reply)
Discussion started by: achak01
1 Replies

4. 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

5. Solaris

SAN DISKS - Number of slices ?

Good morning to one and all :-) Thank god its Friday, as its bee na rubbish week for me ! So, a quick question. Disks ! Ive got a few local disks, and a few SAN disks used on my solaris server. Whats confusing me, and Im not sure if there's an issue at the SAN end, or my end, regarding the... (3 Replies)
Discussion started by: sbk1972
3 Replies

6. Solaris

disks in solaris

whats the command to find name of all disks. Is it iostat -En ? (1 Reply)
Discussion started by: vikashtulsiyan
1 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. Solaris

Solaris x86 - 2 new disks

Have a compaq dl380 proliant installed with solaris.. It has a smart array 5i controller.. currently I have 2 18gb disks - mirrored as far as I can see... I have just put in 2 36gb disks (just physically put in) How do I get solaris to recognise them so I can use them? format command - only... (2 Replies)
Discussion started by: frustrated1
2 Replies

9. Filesystems, Disks and Memory

re-partition disks on solaris

hi all, i was wondering if i have some volume manager and i want to format all partitions/disks and re-create new slices can i use regular format command or what? i think veritas volume manager is already installed. (2 Replies)
Discussion started by: Bashar
2 Replies

10. Filesystems, Disks and Memory

Number of disks, space available, files systems ?

Hello, When I am logged on a Unix machine, I would like get a maximum of informations related to the number of disks used, the space available, the description of the different files systems. I'm using Unix OSF1 V4.0. Thanks in advance for your help. Geoffrey (2 Replies)
Discussion started by: geogeo
2 Replies
Login or Register to Ask a Question