Linux 相关scsi命令
由于前段时间存储扩容,对存储操作较多,下面记录了常用的操作;
lsscsi命令:显示scsi设备信息
#lsscsi
[0:0:0:2] disk IBM 1726-4xx FAStT 0617 /dev/sdb
[0:0:0:3] disk IBM 1726-4xx FAStT 0617 /dev/sdc
[0:0:0:4] disk IBM 1726-4xx FAStT 0617 /dev/sdd
[0:0:0:5] disk IBM 1726-4xx FAStT 0617 /dev/sde
解释:[H(hba):C(hba_channel):T(target):L(LUN ID)]
scsi_id命令:查询scsi设备id号;
#scsi_id –g –u –s /dev/sda
3600a0b80000b174b000000d63efc5c8c
或者
# /lib/udev/scsi_id --page=0x83 --whitelisted --device=/dev/sda
3600a0b80000b174b000000d63efc5c8c
HBA WWWN:cat /sys/class/fc_host/host*/node_name
DISK wwwn:ls -l /dev/disk/by_id|grep -v part
手动删除path:
先offlne
echo offline >/sys/block/device-name/device/state
然后remove
echo 1 >/sys/block/device-name/device/delete
手动增加path:
echo "c t l" > /sys/class/scsi_host/hostn/scan
echo “scsi add-single-device 0 0 0 0” > /proc/scsi/scsi