Video content has been moved to the official Red Hat YouTube channel, which you can find here.

Translated message

A translation of this page exists in English.

每次重启时,如何使磁盘字母 /dev/sdX 更有可能保持一致

Solution In Progress - Updated -

Issue

  • 在每次引导时,磁盘字母可能会有所变化,例如,在一次重现引导时,一个相同的硬盘被检测为 /dev/sda,而在下一次重启时被检测为 /dev/sdc。
  • 如何确保在每次重启时,相同的驱动器都被标识为 /dev/sdX?

Environment

  • Red Hat Enterprise Linux 8
  • Red Hat Enterprise Linux 7
  • Red Hat Enterprise Linux 6

请小心!   这不适用于 RHEL 9,因为它添加了 PROBE_PREFER_ASYNCHRONOUS,用于实现完整的异步 lun 发现/探测。 相关信息请参阅 "Unreliable disk detection order in 5.x"。 特别是它的结论部分 "...even with {scsi_mod.scan=} synchronous scanning, device names are not reliable and there are no guarantees that one particular device will always have the same name".

请小心!   在 RHEL 8 和更早版本中,当流失或添加一个设备,添加 USB 设备、保留冲突、替换和移动一个存储控制器,以及其他一些事件都可能会导致 sdX 分配的名称与预期有所变化,即使在 grub 引导行中指定了 scsi_mod.scan=sync。首选和推荐的访问设备方法是,在 /dev/disk/by-id 中使用具有持久性的磁盘名称,或者使用自定义 udev 规则来创建自己的持久性磁盘名称(尽管您无法使用 sdX 命名空间来这样做)。

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content