Identifier les disques dans une baie ... le bordel pour savoir où se trouve le disque foutu dénommé c3t2d0 ?
Script !
=>
http://hardforum.com/showpost.php?p=103 ... tcount=207Citation :
With my MSA70's and using plain ol SAS controllers... not SAS2 chipped controllers... identifying drives is and can be a challenge. For several reasons.
Reason 1 = as I have 68 Bays to play with.... compared to having just a controller with say 4 or 8 ports... picking which drive to add to or remove from a vdev can be rather interesting.
Before with just 8 ports on the ol SAS controller it was sort of easy...eg a drive would be called say c3t2d0
So to find out which drive was which was also easy... as you could enumerate it down sort of simply
c3t2d0 broke down into
c3 = controller number 3
t2 = Target number 2 (or port 2 if you like)
d0 = Drive 0
So if I added / removed a drive it was simple to identify which was which
Now Moving t using an expander based chassis and things move around a bit and are detected differently
A Drive that was c3t2d0 becomes...(if it is in the 2nd bay) c3t36d0
MSA70 has 25 bays which seem to get numbered from t35 thru to t58 (yeah I don't know either why it starts @ 35 ?? and also no idea why 35 + 25 somehow = 58 ??
anyways it can get confusing.... and No I don't know what the second chassis drive numbering goes when it is daisychained....yet.
But...on with the show
So to organise it a little more simply
Enter the lovely command "croinfo"
cro means
Chassis
Recepticle
Occupant
DESCRIPTION
The diskinfo and croinfo utility share the same binary executable. At runtime, the utility checks to see how it was invoked, and adjusts defaults.
The croinfo utility allows users to query and display specific aspects of a system's configuration. Queries are performed against a record-oriented dataset that captures the relationship between physical location and various aspects of the device currently at that physical location.
This relationship is expressed in terms of Chassis, Receptacle, and Occupant (thus the cro prefix).
Citation :
So now instead of using the format command to try and identify a drive eg
Code :
root@solaris:~# format
Searching for disks...done
AVAILABLE DISK SELECTIONS:
0. c3t35d0 <HP-DG072A8B54-HPD7-68.37GB>
/pci@0,0/pci8086,25f7@2/pci8086,3500@0/pci8086,3514@1/pci103c,3229@0/sd@23,0
/dev/chassis/HP-MSA70.5001438000408100/Bay__________________________1/disk
1. c3t36d0 <HP-DG072A9BB7-HPD0-68.37GB>
/pci@0,0/pci8086,25f7@2/pci8086,3500@0/pci8086,3514@1/pci103c,3229@0/sd@24,0
/dev/chassis/HP-MSA70.5001438000408100/Bay__________________________2/disk
2. c3t37d0 <HP-DG072A9BB7-HPD0-68.37GB>
/pci@0,0/pci8086,25f7@2/pci8086,3500@0/pci8086,3514@1/pci103c,3229@0/sd@25,0
/dev/chassis/HP-MSA70.5001438000408100/Bay__________________________3/disk
3. c3t38d0 <HP-DG072A4951-HPD4-68.37GB>
/pci@0,0/pci8086,25f7@2/pci8086,3500@0/pci8086,3514@1/pci103c,3229@0/sd@26,0
/dev/chassis/HP-MSA70.5001438000408100/Bay__________________________4/disk
4. c3t39d0 <HP-DG072A9BB7-HPD0-68.37GB>
/pci@0,0/pci8086,25f7@2/pci8086,3500@0/pci8086,3514@1/pci103c,3229@0/sd@27,0
/dev/chassis/HP-MSA70.5001438000408100/Bay__________________________5/disk
5. c3t40d0 <HP-DG072A8B54-HPD7-68.37GB>
/pci@0,0/pci8086,25f7@2/pci8086,3500@0/pci8086,3514@1/pci103c,3229@0/sd@28,0
/dev/chassis/HP-MSA70.5001438000408100/Bay__________________________6/disk
6. c3t41d0 <HP-DG072A8B54-HPD7-68.37GB>
/pci@0,0/pci8086,25f7@2/pci8086,3500@0/pci8086,3514@1/pci103c,3229@0/sd@29,0
/dev/chassis/HP-MSA70.5001438000408100/Bay__________________________7/disk
7. c3t42d0 <HP-DG072A8B54-HPD7-68.37GB>
/pci@0,0/pci8086,25f7@2/pci8086,3500@0/pci8086,3514@1/pci103c,3229@0/sd@2a,0
/dev/chassis/HP-MSA70.5001438000408100/Bay__________________________8/disk
8. c3t58d0 <ATA-ST91000430AS-CC9D-931.51GB>
/pci@0,0/pci8086,25f7@2/pci8086,3500@0/pci8086,3514@1/pci103c,3229@0/sd@3a,0
/dev/chassis/HP-MSA70.5001438000408100/Bay__________________________24/disk
9. c3t43d0 <HP-DG072A8B54-HPD7-68.37GB>
/pci@0,0/pci8086,25f7@2/pci8086,3500@0/pci8086,3514@1/pci103c,3229@0/sd@2b,0
10. c3t59d0 <ATA-ST91000430AS-CC9D-931.51GB>
/pci@0,0/pci8086,25f7@2/pci8086,3500@0/pci8086,3514@1/pci103c,3229@0/sd@3b,0
11. c4t0d0 <HP-LOGICAL VOLUME-1.86 cyl 4420 alt 2 hd 255 sec 63>
/pci@0,0/pci8086,25e5@5/pci1166,103@0/pci103c,3211@8/sd@0,0
Specify disk (enter its number):
Citation :
Lovely output isn't it...
now lets run croinfo command by itself and see what we get instead
Code :
root@solaris:~# croinfo
D:devchassis-path t:occupant-type c:occupant-compdev
--------------------------------------------------------------------------- --------------- ------------------
/dev/chassis/HP-MSA70.5001438000408100/Bay__________________________0 - -
/dev/chassis/HP-MSA70.5001438000408100/Bay__________________________1/disk disk c3t35d0
/dev/chassis/HP-MSA70.5001438000408100/Bay__________________________2/disk disk c3t36d0
/dev/chassis/HP-MSA70.5001438000408100/Bay__________________________3/disk disk c3t37d0
/dev/chassis/HP-MSA70.5001438000408100/Bay__________________________4/disk disk c3t38d0
/dev/chassis/HP-MSA70.5001438000408100/Bay__________________________5/disk disk c3t39d0
/dev/chassis/HP-MSA70.5001438000408100/Bay__________________________6/disk disk c3t40d0
/dev/chassis/HP-MSA70.5001438000408100/Bay__________________________7/disk disk c3t41d0
/dev/chassis/HP-MSA70.5001438000408100/Bay__________________________8/disk disk c3t42d0
/dev/chassis/HP-MSA70.5001438000408100/Bay__________________________9 - -
/dev/chassis/HP-MSA70.5001438000408100/Bay__________________________10 - -
/dev/chassis/HP-MSA70.5001438000408100/Bay__________________________11 - -
/dev/chassis/HP-MSA70.5001438000408100/Bay__________________________12 - -
/dev/chassis/HP-MSA70.5001438000408100/Bay__________________________13 - -
/dev/chassis/HP-MSA70.5001438000408100/Bay__________________________14 - -
/dev/chassis/HP-MSA70.5001438000408100/Bay__________________________15 - -
/dev/chassis/HP-MSA70.5001438000408100/Bay__________________________16 - -
/dev/chassis/HP-MSA70.5001438000408100/Bay__________________________17 - -
/dev/chassis/HP-MSA70.5001438000408100/Bay__________________________18 - -
/dev/chassis/HP-MSA70.5001438000408100/Bay__________________________19 - -
/dev/chassis/HP-MSA70.5001438000408100/Bay__________________________20 - -
/dev/chassis/HP-MSA70.5001438000408100/Bay__________________________21 - -
/dev/chassis/HP-MSA70.5001438000408100/Bay__________________________22 - -
/dev/chassis/HP-MSA70.5001438000408100/Bay__________________________23 - -
/dev/chassis/HP-MSA70.5001438000408100/Bay__________________________24/disk disk c3t58d0
Citation :
Thats a little better, but now lets tidy it up a little, for even more readability.
So now we introduce the fmadm command "fmadm - fault management configuration tool" .... yes seems a weird tool to tidy up the output of a Chassis Recepticle Occupant output...
But when you run the fmadm command by itself we see, part of it's use is to manage Chassis alias's :
Code :
root@solaris:~# fmadm
Usage: fmadm [-P prog] [-q] [cmd [args ... ]]
Fault Status and Administration
fmadm faulty [-afgiprsv] [-n <max_fault>] [-u <uuid>]
display list of faulty resources
fmadm acquit <fmri> [<uuid>] | <label> [<uuid>] | <uuid>
acquit resource or acquit case
fmadm replaced <fmri> | <label>
notify fault manager that resource has been replaced
fmadm repaired <fmri> | <label>
notify fault manager that resource has been repaired
Chassis Alias Administration
fmadm add-alias <product-id>.<chassis-id> <alias-id> ['comment']
add alias to /etc/dev/chassis_aliases database
fmadm remove-alias <alias-id> | <product-id>.<chassis-id>
remove mapping from /etc/dev/chassis_aliases database
fmadm lookup-alias <alias-id> | <product-id>.<chassis-id>
lookup mapping in /etc/dev/chassis_aliases database
fmadm list-alias
list current /etc/dev/chassis_aliases database
fmadm sync-alias
verify /etc/dev/chassis_aliases contents and sync
Caution: Documented Fault Repair Procedures Only...
Module Administration
fmadm config
display fault manager configuration
fmadm load <path>
load specified fault manager module
fmadm unload <module>
unload specified fault manager module
fmadm reset [-s serd] <module>
reset module or sub-component
Log Administration
fmadm rotate <logname>
rotate log file
Fault Administration
fmadm flush <fmri> ...
flush cached state for resource
Citation :
Which is what we will have a go at now.
My 1st chassis is identified as /dev/chassis/HP-MSA70.5001438000408100
So I am going to make it something smaller and more readable / sensible
Let say as I have two MSA70's I will call one MSA70A and the Other MSA70B (makes sense to me)
Code :
root@solaris:~# fmadm add-alias HP-MSA70.5001438000408100 MSA70A 'MSA70 Top'
Citation :
Now whats it look like?
Code :
root@solaris:~# croinfo
D:devchassis-path t:occupant-type c:occupant-compdev
-------------------------------------------------------- --------------- ------------------
/dev/chassis/MSA70A/Bay__________________________0 - -
/dev/chassis/MSA70A/Bay__________________________1/disk disk c3t35d0
/dev/chassis/MSA70A/Bay__________________________2/disk disk c3t36d0
/dev/chassis/MSA70A/Bay__________________________3/disk disk c3t37d0
/dev/chassis/MSA70A/Bay__________________________4/disk disk c3t38d0
/dev/chassis/MSA70A/Bay__________________________5/disk disk c3t39d0
/dev/chassis/MSA70A/Bay__________________________6/disk disk c3t40d0
/dev/chassis/MSA70A/Bay__________________________7/disk disk c3t41d0
/dev/chassis/MSA70A/Bay__________________________8/disk disk c3t42d0
/dev/chassis/MSA70A/Bay__________________________9 - -
/dev/chassis/MSA70A/Bay__________________________10 - -
/dev/chassis/MSA70A/Bay__________________________11 - -
/dev/chassis/MSA70A/Bay__________________________12 - -
/dev/chassis/MSA70A/Bay__________________________13 - -
/dev/chassis/MSA70A/Bay__________________________14 - -
/dev/chassis/MSA70A/Bay__________________________15 - -
/dev/chassis/MSA70A/Bay__________________________16 - -
/dev/chassis/MSA70A/Bay__________________________17 - -
/dev/chassis/MSA70A/Bay__________________________18 - -
/dev/chassis/MSA70A/Bay__________________________19 - -
/dev/chassis/MSA70A/Bay__________________________20 - -
/dev/chassis/MSA70A/Bay__________________________21 - -
/dev/chassis/MSA70A/Bay__________________________22 - -
/dev/chassis/MSA70A/Bay__________________________23 - -
/dev/chassis/MSA70A/Bay__________________________24/disk disk c3t58d0
Citation :
Thats better.... no idea yet how to change the silly HP Bay numbering...eg get rid of the annoying ______________ bits.
You will notice my chassis obviously doesn't fully use the SES2 standard... so Bays are a little weird... in that Bay________0 is the
Chassis itself??.... and Bay___25 is not represented as a bay... just as c3t58d0 outside of a bay??
So it's not perfect... but it's definately easier to manage.
Naturally when you have racks and racks of storage chassis, the above tools would come in very handy.
You could instead label an alias from
HP-MSA70.5001438000408100
to something helpful
Lets say it's sitting in Rack #10 and racked @ a level of 26RU High
We could call / alias it something smarter
HPMSA70.Asset#128934 MSA70@RACK10__U26-U27
Make finding the right drive in a large Data Centre quite helpful eh?
BTW
/dev/chassis
should contain your chassis / backplane info
a line gets added to
/etc/dev/chassis_aliases
When you use fmadm to add an alias
Now I am off to destroy some more shit
as I see /dev/chassis/MSA70A contains folders/directories called
Code :
root@solaris:/dev/chassis/MSA70A# ls
Bay__________________________0 Bay__________________________15 Bay__________________________21 Bay__________________________6
Bay__________________________1 Bay__________________________16 Bay__________________________22 Bay__________________________7
Bay__________________________10 Bay__________________________17 Bay__________________________23 Bay__________________________8
Bay__________________________11 Bay__________________________18 Bay__________________________24 Bay__________________________9
Bay__________________________12 Bay__________________________19 Bay__________________________3
Bay__________________________13 Bay__________________________2 Bay__________________________4
Bay__________________________14 Bay__________________________20 Bay__________________________5
root@solaris:/dev/chassis/MSA70A#
_________________
Kévin, sor deux sec or !!