luxadm. Часть 1. Посмотреть
24.11.2011
Команда luxadm используется для работы с различными fc устройствами. Создавалась она для администрирования внутренних дисков серверов sf880 и fc-al, а в дальнейшем добавился функционал и эта утилита стала основной при работе с fc (в Solaris 10 появились команды fcinfo и mpathadm ). Синтаксис у команды непростой, но попробую ее причесать.
Итак, какие аргументы можно использовать
физический путь к fc портам hba или контроллеру (типа /devices/pci@700/pci@0/pci@c/SUNW,emlxs@0,1/fp@0,0:devctl
или /dev/cfg/c6
)
WWN массива (типа 10000000c98b08d3
)
путь к диску или ленте (/dev/rdsk/c6t1d0s2
или /dev/rmt/2
)
Посмотреть состояние и пути fc-портов hba
# luxadm -e port
/devices/pci@700/pci@0/pci@c/SUNW,emlxs@0,1/fp@0,0:devctl CONNECTED
/devices/pci@400/pci@0/pci@d/SUNW,emlxs@0,1/fp@0,0:devctl CONNECTED
/devices/pci@600/pci@0/pci@c/SUNW,emlxs@0,1/fp@0,0:devctl NOT CONNECTED
/devices/pci@500/pci@0/pci@d/SUNW,emlxs@0/fp@0,0:devctl NOT CONNECTED
Соответствие между контроллером и путем fc-порта (это не luxadm, но полезно использовать)
# ls -la /dev/cfg/c*
lrwxrwxrwx 1 root root 56 Feb 2 2011 /dev/cfg/c2 -> ../../devices/pci@400/pci@0/pci@c/SUNW,emlxs@0/fp@0,0:fc
lrwxrwxrwx 1 root root 58 Feb 2 2011 /dev/cfg/c3 -> ../../devices/pci@400/pci@0/pci@c/SUNW,emlxs@0,1/fp@0,0:fc
lrwxrwxrwx 1 root root 56 Feb 2 2011 /dev/cfg/c4 -> ../../devices/pci@400/pci@0/pci@d/SUNW,emlxs@0/fp@0,0:fc
lrwxrwxrwx 1 root root 58 Feb 2 2011 /dev/cfg/c5 -> ../../devices/pci@400/pci@0/pci@d/SUNW,emlxs@0,1/fp@0,0:fc
lrwxrwxrwx 1 root root 56 Feb 2 2011 /dev/cfg/c6 -> ../../devices/pci@500/pci@0/pci@9/SUNW,emlxs@0/fp@0,0:fc
Посмотреть, что подключено на конкретном порту (можно смотреть как по физическому пути, так и по пути контроллера)
# luxadm -e dump_map /devices/pci@400/pci@1/pci@0/pci@0/SUNW,emlxs@0/fp@0,0:devctl
Pos Port_ID Hard_Addr Port WWN Node WWN Type
0 97f4c0 0 204300a0b848a702 200200a0b848a702 0x0 (Disk device)
1 97f680 0 10000000c9b1f51c 20000000c9b1f51c 0x1f (Unknown Type,Host Bus Adapter)
# luxadm -e dump_map /dev/cfg/c6
Pos Port_ID Hard_Addr Port WWN Node WWN Type
0 97f4c0 0 204300a0b848a702 200200a0b848a702 0x0 (Disk device)
1 97f680 0 10000000c9b1f51c 20000000c9b1f51c 0x1f (Unknown Type,Host Bus Adapter)
Посмотреть, какие fc диски или ленты видны в системе
# luxadm probe -p
No Network Array enclosures found in /dev/es
Found Fibre Channel device(s):
Node WWN:206000c0ff0067d9 Device Type:Disk device
Logical Path:/dev/rdsk/c14t600C0FF0000000000067D96B373B6600d0s2
Physical Path:
/devices/scsi_vhci/ssd@g600c0ff0000000000067d96b373b6600:c,raw
Node WWN:206000c0ff0067d9 Device Type:Disk device
Logical Path:/dev/rdsk/c14t600C0FF0000000000067D96B373B6601d0s2
Physical Path:
/devices/scsi_vhci/ssd@g600c0ff0000000000067d96b373b6601:c,raw
Node WWN:206000c0ff0067d9 Device Type:Disk device
Logical Path:/dev/rdsk/c14t600C0FF0000000000067D96B373B6602d0s2
Physical Path:
/devices/scsi_vhci/ssd@g600c0ff0000000000067d96b373b6602:c,raw
Посмотреть информацию по конкретному диску
# luxadm display /dev/rdsk/c14t60060E8004F236000000F23600000A00d0s2
DEVICE PROPERTIES for disk: /dev/rdsk/c14t60060E8004F236000000F23600000A00d0s2
Vendor: HITACHI
Product ID: OPEN-V -SUN
Revision: 5009
Serial Num: 50 0F2360A00
Unformatted capacity: 34091.250 MBytes
Write Cache: Enabled
Read Cache: Enabled
Minimum prefetch: 0x0
Maximum prefetch: 0x0
Device Type: Disk device
Path(s):
/dev/rdsk/c14t60060E8004F236000000F23600000A00d0s2
/devices/scsi_vhci/ssd@g60060e8004f236000000f23600000a00:c,raw
Controller /devices/pci@400/pci@0/pci@c/SUNW,emlxs@0,1/fp@0,0
Device Address 50060e8004f23674,4
Host controller port WWN 10000000c98b08d3
Class primary
State ONLINE
Controller /devices/pci@400/pci@0/pci@c/SUNW,emlxs@0,1/fp@0,0
Device Address 50060e8004f23676,4
Host controller port WWN 10000000c98b08d3
Class primary
State ONLINE
Controller /devices/pci@400/pci@0/pci@c/SUNW,emlxs@0/fp@0,0
Device Address 50060e8004f23664,4
Host controller port WWN 10000000c98b08d2
Class primary
State ONLINE
Controller /devices/pci@400/pci@0/pci@c/SUNW,emlxs@0/fp@0,0
Device Address 50060e8004f23666,4
Host controller port WWN 10000000c98b08d2
Class primary
State ONLINE
Показать inquire информацию по конкретному диску
# luxadm inquiry/dev/rdsk/c14t600C0FF00000000009208424A938CA00d0s2
INQUIRY:
Physical Path:
/devices/scsi_vhci/ssd@g600c0ff00000000009208424a938ca00:c,raw
Vendor: SUN
Product: StorEdge 3511
Revision: 421F
Serial Number 09208424A938CA00
Device type: 0x0 (Disk device)
Removable media: no
Medium Changer Element: no
ISO version: 0
ECMA version: 0
ANSI version: 3 (Device complies to SCSI-3)
Terminate task: no
Response data format: 2
Additional length: 0xf7
Command queueing: no
VENDOR-SPECIFIC PARAMETERS
Byte# Hex Value ASCII
52 00 00 00 00 ....
96 43 6f 70 79 72 69 67 68 74 20 28 43 29 20 31 39 Copyright (C) 19
39 39 20 49 6e 66 6f 72 74 72 65 6e 64 2e 20 41 99 Infortrend. A
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 00 00 00 00 00 00 00 00 00 ............
Посмотреть информацию по конкретной ленте
# luxadm -v display /dev/rmt/3
Displaying information for: /dev/rmt/3
DEVICE PROPERTIES for tape: /dev/rmt/3
Vendor: ARCHIVE
Product ID: Python
Revision: V000
Serial Num: Unsupported
Device Type: Tape device
Path(s):
/dev/rmt/3n
/devices/pci@700/pci@0/pci@c/SUNW,emlxs@0,1/fp@0,0/st@w2101001b3232ef61,0:n
LUN path port WWN: 2101001b3232ef61
Host controller port WWN: 10000000c98b07d5
Path status: Not Ready
Информация по дисковому массиву (по WWN массива), показывает также информацию по всем дискам массива
# luxadm display 226000c0ff992084
DEVICE PROPERTIES for disk: 226000c0ff992084
Vendor: SUN
Product ID: StorEdge 3511
Revision: 421F
Serial Num: 09208424A938CA00
Unformatted capacity: 956000.000 MBytes
Write Cache: Enabled
Read Cache: Enabled
Minimum prefetch: 0x0
Maximum prefetch: 0xffff
Device Type: Disk device
Path(s):
/dev/rdsk/c14t600C0FF00000000009208424A938CA00d0s2
/devices/scsi_vhci/ssd@g600c0ff00000000009208424a938ca00:c,raw
Controller /devices/pci@700/pci@0/pci@c/SUNW,emlxs@0,1/fp@0,0
Device Address 226000c0ff992084,0
Host controller port WWN 10000000c98b07d5
Class primary
State ONLINE
Controller /devices/pci@700/pci@0/pci@c/SUNW,emlxs@0/fp@0,0
Device Address 216000c0ff892084,0
Host controller port WWN 10000000c98b07d4
Class primary
State ONLINE
DEVICE PROPERTIES for disk: 226000c0ff992084
Vendor: SUN
Product ID: StorEdge 3511
Revision: 421F
Serial Num: 09208424A938CA01
Unformatted capacity: 956000.000 MBytes
Write Cache: Enabled
Read Cache: Enabled
Minimum prefetch: 0x0
Maximum prefetch: 0xffff
Device Type: Disk device
Path(s):
Список установленых Hba и версии firmware
# luxadm fcode_download -p
Found Path to 0 FC100/S Cards
Complete
Found Path to 0 FC100/P, ISP2200, ISP23xx Devices
Complete
Found Path to 0 JNI1560 Devices.
Complete
Found Path to 12 Emulex Devices.
Opening Device: /devices/pci@400/pci@0/pci@c/SUNW,emlxs@0/fp@0,0:devctl
Detected FCode Version: 3.01a1
Opening Device: /devices/pci@400/pci@0/pci@c/SUNW,emlxs@0,1/fp@0,0:devctl
Detected FCode Version: 3.01a1
Opening Device: /devices/pci@400/pci@0/pci@d/SUNW,emlxs@0/fp@0,0:devctl
Detected FCode Version: 3.01a1
Показать количество ошибок по fc порту
# luxadm -e rdls/dev/cfg/c3
Link Error Status information for loop:
al_pa lnk fail sync loss signal loss sequence err invalid word CRC
712100 1 0 0 0 293 0
713600 0 0 0 0 255 0
713700 1 0 0 0 255 0
713b00 0 0 0 0 255 0
8c0000 0 1 0 0 3 0
NOTE: These LESB counts are not cleared by a reset, only power cycles.
These counts must be compared to previously read counts.
Посмотреть состояние fc-устройства
# luxadm -e bus_getstate/dev/rdsk/c14t60060E8004F236000000F23600000300d0s2
)
/dev/rdsk/c14t60060E8004F236000000F23600000300d0s2: Active
# for i in /dev/rdsk/c14*s2 ; do luxadm -e bus_getstate $i; done
/dev/rdsk/c14t60060E8004F236000000F23600000300d0s2: Active
Error: Invalid pathname (/devices/scsi_vhci/ssd@g60060e80153438000001343800000501:c,raw)
Error: Invalid pathname (/devices/scsi_vhci/ssd@g60060e80153438000001343800000502:c,raw