如何查找dev目录下磁盘设备的iscsi来源
展开全部
1.安装udev和lsscsi
sudo apt-get install -y udev lsscsi
2.列出iscsi设备
lsscsi
输出:
[2:0:0:0] disk ATA ST3500514NS SN12 /dev/sda
[4:0:0:0] disk iSCSI IP SAN 0 /dev/sdb
可知/dev/sdb是iscsi设备
3. 查找/dev/sdb的实际路径
udevadm info -q path -n /dev/sdb
输出:
/devices/platform/host4/session1/target4:0:0/4:0:0:0/block/sdb
4.查找实际路径对应的iscsi来源
udevadm info -q env -p /devices/platform/host4/session1/target4:0:0/4:0:0:0/block/sdb
输出:
DEVLINKS=/dev/disk/by-id/scsi-169534353490000000000000003000000569e0d000f000000 /dev/disk/by-path/ip-192.168.1.12:3260-iscsi-iqn.2004-05.storos.t-3-lun-0
DEVNAME=/dev/sdb
DEVPATH=/devices/platform/host4/session1/target4:0:0/4:0:0:0/block/sdb
DEVTYPE=disk
ID_BUS=scsi
ID_MODEL=IP_SAN
ID_MODEL_ENC=IP\x20SAN\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
ID_PART_TABLE_TYPE=dos
ID_PATH=ip-192.168.1.12:3260-iscsi-iqn.2004-05.storos.t-3-lun-0
ID_PATH_TAG=ip-192_168_1_12_3260-iscsi-iqn_2004-05_storos_t-3-lun-0
ID_REVISION=0
ID_SCSI=1
ID_SERIAL=169534353490000000000000003000000569e0d000f000000
ID_SERIAL_SHORT=69534353490000000000000003000000569e0d000f000000
ID_TYPE=disk
ID_VENDOR=iSCSI
ID_VENDOR_ENC=iSCSI\x20\x20\x20
MAJOR=8
MINOR=16
SUBSYSTEM=block
UDEV_LOG=3
USEC_INITIALIZED=12779741
sudo apt-get install -y udev lsscsi
2.列出iscsi设备
lsscsi
输出:
[2:0:0:0] disk ATA ST3500514NS SN12 /dev/sda
[4:0:0:0] disk iSCSI IP SAN 0 /dev/sdb
可知/dev/sdb是iscsi设备
3. 查找/dev/sdb的实际路径
udevadm info -q path -n /dev/sdb
输出:
/devices/platform/host4/session1/target4:0:0/4:0:0:0/block/sdb
4.查找实际路径对应的iscsi来源
udevadm info -q env -p /devices/platform/host4/session1/target4:0:0/4:0:0:0/block/sdb
输出:
DEVLINKS=/dev/disk/by-id/scsi-169534353490000000000000003000000569e0d000f000000 /dev/disk/by-path/ip-192.168.1.12:3260-iscsi-iqn.2004-05.storos.t-3-lun-0
DEVNAME=/dev/sdb
DEVPATH=/devices/platform/host4/session1/target4:0:0/4:0:0:0/block/sdb
DEVTYPE=disk
ID_BUS=scsi
ID_MODEL=IP_SAN
ID_MODEL_ENC=IP\x20SAN\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
ID_PART_TABLE_TYPE=dos
ID_PATH=ip-192.168.1.12:3260-iscsi-iqn.2004-05.storos.t-3-lun-0
ID_PATH_TAG=ip-192_168_1_12_3260-iscsi-iqn_2004-05_storos_t-3-lun-0
ID_REVISION=0
ID_SCSI=1
ID_SERIAL=169534353490000000000000003000000569e0d000f000000
ID_SERIAL_SHORT=69534353490000000000000003000000569e0d000f000000
ID_TYPE=disk
ID_VENDOR=iSCSI
ID_VENDOR_ENC=iSCSI\x20\x20\x20
MAJOR=8
MINOR=16
SUBSYSTEM=block
UDEV_LOG=3
USEC_INITIALIZED=12779741
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询