SCSI硬盘设备到/dev/sd设备的映射关系

简介:

1,操作系统:centos或redhat


2,查看scsi设备到/dev/sd的映射

# ll /dev/disk/by-path/
total 0
lrwxrwxrwx 1 root root 9 2014-10-30 12:38 pci-0000:02:00.0-scsi-0:2:0:0 -> ../../sda
lrwxrwxrwx 1 root root 10 2014-10-30 12:38 pci-0000:02:00.0-scsi-0:2:0:0-part1 -> ../../sda1
lrwxrwxrwx 1 root root 10 2014-10-30 18:37 pci-0000:02:00.0-scsi-0:2:0:0-part2 -> ../../sda2
lrwxrwxrwx 1 root root 10 2014-10-30 12:38 pci-0000:02:00.0-scsi-0:2:0:0-part3 -> ../../sda3
lrwxrwxrwx 1 root root 10 2014-10-30 12:38 pci-0000:02:00.0-scsi-0:2:0:0-part5 -> ../../sda5
lrwxrwxrwx 1 root root 9 2014-10-30 12:38 pci-0000:02:00.0-scsi-0:2:1:0 -> ../../sdb
lrwxrwxrwx 1 root root 9 2014-10-30 12:38 pci-0000:02:00.0-scsi-0:2:10:0 -> ../../sdk
lrwxrwxrwx 1 root root 9 2014-10-30 12:38 pci-0000:02:00.0-scsi-0:2:2:0 -> ../../sdc
lrwxrwxrwx 1 root root 9 2014-10-30 12:38 pci-0000:02:00.0-scsi-0:2:3:0 -> ../../sdd
lrwxrwxrwx 1 root root 9 2014-10-30 12:38 pci-0000:02:00.0-scsi-0:2:4:0 -> ../../sde
lrwxrwxrwx 1 root root 9 2014-10-30 12:38 pci-0000:02:00.0-scsi-0:2:5:0 -> ../../sdf
lrwxrwxrwx 1 root root 9 2014-10-30 12:38 pci-0000:02:00.0-scsi-0:2:6:0 -> ../../sdg
lrwxrwxrwx 1 root root 9 2014-10-30 12:38 pci-0000:02:00.0-scsi-0:2:7:0 -> ../../sdh
lrwxrwxrwx 1 root root 9 2014-10-30 12:38 pci-0000:02:00.0-scsi-0:2:8:0 -> ../../sdi
lrwxrwxrwx 1 root root 9 2014-11-03 17:08 pci-0000:02:00.0-scsi-0:2:9:0 -> ../../sdj

pci-0000:02:00.0-scsi-0:2:9:0 -> ../../sdj为例进行分析:

0:2:9:0分别表示:

PCI identifier of the host bus adapter (HBA)
channel number on that HBA
the remote SCSI target address(Target Id)
the Logical Unit Number (LUN)


This path-based address is not persistent. It may change any time the system is reconfigured (either by on-line reconfiguration, as described in this manual, or when the system is shutdown, reconfigured, and rebooted). It is even possible for the path identifiers to change when no physical reconfiguration has been done, as a result of timing variations during the discovery process when the system boots, or when a bus is re-scanned.
The operating system provides several non-persistent names to represent these access paths to storage devices. One is the /dev/sd name; another is the major:minor number. A third is a symlink maintained in the /dev/disk/by-path/ directory. This symlink maps from the path identifier to the current /dev/sd name.


参见:https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/5/html/Online_Storage_Reconfiguration_Guide/persistent_naming.html

https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Storage_Administration_Guide/persistent_naming.html


3,通过Megcli查看target ID来和/dev/sd对应上

# MegaCli64 -cfgdsply -aALL|grep 'Target'
Virtual Drive: 0 (Target Id: 0)
Virtual Drive: 1 (Target Id: 1)
Virtual Drive: 2 (Target Id: 2)
Virtual Drive: 4 (Target Id: 4)
Virtual Drive: 5 (Target Id: 5)
Virtual Drive: 6 (Target Id: 6)
Virtual Drive: 7 (Target Id: 7)
Virtual Drive: 8 (Target Id: 8)
Virtual Drive: 9 (Target Id: 9)
Virtual Drive: 10 (Target Id: 10)
Virtual Drive: 3 (Target Id: 3)


这样的话,如果我们通过Megcli查到有坏道需要维修更换的磁盘,我们就能知道对应的/dev/sd的设备是哪一个了










本文转自 leejia1989 51CTO博客,原文链接:http://blog.51cto.com/leejia/1571396,如需转载请自行联系原作者
目录
相关文章
|
固态存储 内存技术
SCSI命令下发方式<续>:对NVMe硬盘如何实现SCSI命令转换?
我们前面有对SATA硬盘下发SCSI命令,其实对NVMe硬盘下发SCSI的方式大同小异。下面我们就来试一下,这里我们用到的SCSI命令是READ CAPACITY。
|
SQL 移动开发 C++
PCIe-SSD卡下的xfs vs ext4对比fileio及TpmC测试
PCIe-SSD卡下的xfs vs ext4对比fileio及TpmC测试
160 0
|
C#
C# 获得设备usb信息
原文:C# 获得设备usb信息 本文告诉大家如何获得设备的usb来进行判断是否有哪些usb和找不到usb可能是什么。 需要在项目右击引用,点击程序集,搜索 System.
1578 0
|
存储 开发工具 IDE
存储基础:ATA、SATA、SCSI、SAS、FC
一、概述 关于存储,作为一名运维工程师我觉得是很有必要去花点时间去了解一下的!磁盘是服务器、存储设备的主要存储媒介之一,非常重要! 按照存储介质类型一般分为机械磁盘(HDD、传统磁性硬盘)、固态磁盘(SSD,主要使用闪存颗粒来存储)、混合磁盘(HHD,磁性硬盘和闪存集成到一起的硬盘)。
2254 0

热门文章

最新文章