Wednesday, March 7, 2012

luxadm -e dump_map is a useful command

I often need add new disks using `cfgadm -c configure ...` on solaris servers. I found a lot of times that if a new HBA port or a new Storage target is just added to the system, the `cfgadm -c configure ..` won't work properly and will encounter the "Library error".

For example:
#cfgadm -f -c configure c4
cfgadm: Library error: failed to create device node: 50xxx:
Invalid argument

( I masked off the WWNs)

with -o force_update won't make any difference either:

#cfgadm -o force_update -c configure c4
cfgadm: Library error: failed to create device node: 50xxx:
Invalid argument

Reboot the server will fix this but it usually is not an option.

In this scenario, luxadm comes to rescue. Using `luxadm -e port` to find out the disk controllers, then use `luxadm -e dump_map ....` on those controllers in question. Then the `cfgadm -f -c configure ...` will start to work properly.

For Example:

(1)
bash-3.00# luxadm -e port
/devices/pci@700/pci@0/pci@9/SUNW,qlc@0/fp@0,0:devctl CONNECTED
/devices/pci@700/pci@0/pci@c/QLGC,qlc@0/fp@0,0:devctl CONNECTED
/devices/pci@700/pci@0/pci@c/QLGC,qlc@0,1/fp@0,0:devctl CONNECTED


(2)
bash-3.00# luxadm -e dump_map /devices/pci@700/pci@0/pci@c/QLGC,qlc@0/fp@0,0:devctl
Pos Port_ID Hard_Addr Port WWN Node WWN Type
0 aa700 0 50xxx7602 50xxx7602 0x0 (Disk device)
1 aab00 0 210xxx 200xxx 0x0 (Disk device)
2 a6700 0 500xxx 500xxx 0x1f (Unknown Type,Host Bus Adapter)
bash-3.00#

(3)
bash-3.00# cfgadm -c configure c4::210xxx
bash-3.00#

Once at least one disk becomes available in that controller-target pair, we do not have to do above luxadm again for new disks added in that pair. Just do `cfgadm -c configure ...` will take care of the disk additions.

Another tip: `ls -l /dev/cfg/* ` will list all disk controller's device path, thus you can match them to the correct c#.

Recently when I have to migrate data from one disk array to a new one, I have to do above routine on solaris servers so that I do not have to reboot the server to add a new FC array.

No comments:

Post a Comment