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,如需转载请自行联系原作者
目录
相关文章
|
SQL 存储 关系型数据库
一文搞懂SQL优化——如何高效添加数据
**SQL优化关键点:** 1. **批量插入**提高效率,一次性建议不超过500条。 2. **手动事务**减少开销,多条插入语句用一个事务。 3. **主键顺序插入**避免页分裂,提升性能。 4. **使用`LOAD DATA INFILE`**大批量导入快速。 5. **避免主键乱序**,减少不必要的磁盘操作。 6. **选择合适主键类型**,避免UUID或长主键导致的性能问题。 7. **避免主键修改**,保持索引稳定。 这些技巧能优化数据库操作,提升系统性能。
741 4
一文搞懂SQL优化——如何高效添加数据
|
机器学习/深度学习 并行计算 算法
YOLOv8改进 | 卷积篇 |手把手教你添加动态蛇形卷积(Dynamic Snake Convolution)
YOLOv8改进 | 卷积篇 |手把手教你添加动态蛇形卷积(Dynamic Snake Convolution)
1184 0
|
12月前
|
安全 算法 文件存储
共享资料下载,自动转PDF并添加隐形水印
云盒子企业网盘增强文件安全,支持下载时自动转PDF并加水印。管理员可配置目录规则,选择明水印、隐形水印或点阵水印。明水印直观防复制,隐形水印用于隐蔽追踪,点阵水印不影响阅读。文件格式支持度和水印类型取决于设置。此功能适用于文档安全、版权保护等场景。欲知详情或测试,访问[云盒子官网](yhz66.com)咨询客服。
277 1
|
7月前
|
Unix Linux 开发工具
git中有关old mode 100644、new mode 10075的问题解决小结
在 Git 中处理文件权限变更时,理解 `old mode 100644` 和 `new mode 100755` 的含义是解决问题的关键。通过确认变更的合理性、修改不必要的权限变更,以及配置 Git 忽略权限变更,可以有效管理文件权限,确保版本库的稳定性和一致性。
750 3
|
11月前
|
Cloud Native 安全 Devops
核心系统转型问题之数字化韧性的定义如何解决
核心系统转型问题之数字化韧性的定义如何解决
|
11月前
|
存储 Java 数据库
基于全志H713 Android 11:给TvSettings添加default.xml默认值
本文介绍了在全志H713 Android 11平台上为TvSettings应用添加HDMI CEC功能的默认设置值的方法,通过修改SettingsProvider的源码和配置文件来实现默认值的设置,并提供了详细的步骤和测试结果。
358 0
基于全志H713 Android 11:给TvSettings添加default.xml默认值
|
11月前
|
存储 数据管理 API
OpenStack的块存储卷管理快照与克隆
【8月更文挑战第27天】
238 4
|
11月前
|
JSON Go 数据格式
Golang 对象深拷贝的方案以及性能比较
文章讨论了Golang中实现对象深拷贝的三种方案:gob序列化反序列化、json序列化反序列化和定制化拷贝,并进行了性能比较,结论是在性能要求高时推荐使用定制化拷贝,性能要求不高时可以使用gob方法,而json方法在性能和代码复杂度之间提供了一个折中方案。
199 0
|
开发框架 Java Linux
本地部署GeoServe服务并结合内网穿透实现任意浏览器远程访问
本地部署GeoServe服务并结合内网穿透实现任意浏览器远程访问
|
搜索推荐 UED Python
动态多条件查询:理解`filter_by`与`filter`提升Web应用搜索功能
了解SQLAlchemy中`filter_by`与`filter`对提升Web应用搜索功能至关重要。`filter_by`简化了等值查询,而`filter`则支持复杂的表达式和逻辑组合。通过动态获取用户输入,构建基础查询并根据条件应用过滤,可以创建灵活的搜索系统。结合分页和排序,为用户提供定制化搜索体验。掌握这两者,能增强应用的交互性和实用性。
227 0
动态多条件查询:理解`filter_by`与`filter`提升Web应用搜索功能