SUSE Support

Here When You Need Us

Kernel block device names changing, order became non-deterministic

This document (7015688) is provided subject to the disclaimer at the end of this document.

Environment

SUSE Linux Enterprise Server 15
SUSE Linux Enterprise Server 12
SUSE Linux Enterprise Server 11
SUSE Linux Enterprise Server 10
SUSE Linux Enterprise Desktop 15
SUSE Linux Enterprise Desktop 12
SUSE Linux Enterprise Desktop 11
SUSE Linux Enterprise Desktop 10

Situation

After adding a new disk and rebooting, the device name is changed. For example, sda would become sdb, or dasda would become dasdb.

Resolution

Use persistent names whenever possible. By navigating under /dev/disk/ you will see several directories. Each directory will use a different method of assigning a persistent names do a device. Using these persistent names will ensure device names aren't changing on reboot.


YaST makes it easy to make this change for disks in fstab:\
  • log in as root
  • start YaST2 and start the Partitioner module located in the System section
  • select the mount point and click 'edit'
  • open 'fstab-options'
  • change the device to the preferred mount mechanism
  • repeat above steps for all mount points

Cause

Before kernel 5.3, devices would always be probed in the order in which they exist on the bus, resulting in the first device being named 'sda', the second device 'sdb', and so on. Controllers could be probed in parallel but the devices would still appear in the same order on a per-controller basis. If there was only one controller, they'd be predictable as long as new devices weren't added in the middle.

Beginning with kernel 5.3 the order in which SCSI devices are probed and named has become non-deterministic. This is a result of a change that was submitted to add asynchronous device probing. The probing happens asynchronously on a per-device basis, so even devices on a single bus can appear in "random" order. The logic behind the change is that if you will have dozens of disks, one wants them to start as early as possible, instead of probing/failing/waiting in a synchronous way; in an environment where there are hundreds of disks, and even more partitions, this change is even more important.

An administrator may create the following setup:
 

# cat /etc/fstab
/dev/sda2 swap swap defaults 0 0
/dev/sda3 / ext3 acl,user_xattr 1 1
/dev/sda1 /boot ext2 acl,user_xattr 1 2


If the system is set to boot from sda, but your /boot directory is now seen as sdb1, your system will fail to boot.

SLE uses udev to create additional device names. These will be created under /dev/disk/.
 

SLE:/dev/disk # ls
by-id  by-partlabel  by-partuuid  by-path  by-uuid


Under each of these paths you will find a list of devices and can view which kernel device they are currently linked to.
 

SLE:/dev/disk/by-path # ls -l
total 0
lrwxrwxrwx 1 root root  9 Sep 24 08:48 pci-0000:00:1f.2-scsi-0:0:0:0 -> ../../sda
lrwxrwxrwx 1 root root 10 Sep 24 08:48 pci-0000:00:1f.2-scsi-0:0:0:0-part1 -> ../../sda1
lrwxrwxrwx 1 root root 10 Sep 24 08:48 pci-0000:00:1f.2-scsi-0:0:0:0-part2 -> ../../sda2
lrwxrwxrwx 1 root root  9 Sep 24 08:48 pci-0000:00:1f.2-scsi-1:0:0:0 -> ../../sr0


By using these device names, you can ensure that on each boot, the name will point to the same device.

 

# cat /etc/fstab
/dev/disk/by-id/ata-ST3500630AS_9QG02WJ3-part2 swap swap defaults 0 0
/dev/disk/by-id/ata-ST3500630AS_9QG02WJ3-part3 / ext3 acl,user_xattr 1 1
/dev/disk/by-id/ata-ST3500630AS_9QG02WJ3-part1 /boot ext2 acl,user_xattr 1 2
proc /proc proc defaults 0 0
sysfs /sys sysfs noauto 0 0

 

Additional Information

Between SUSE Linux Enterprise 15 Service Pack 2 and SUSE Linux Enterprise 15 Service Pack 5 we had scsi_mod.disable_async_probing kernel options which can help (but is still NO GUARANTEE) disabling asynchronous scanning of devices. SUSE Linux Enterprise 15 Service Pack 2 Release Notes.

Note: Starting with SUSE Linux Enterprise 15 Service Pack 6,, this option is no longer available. Disabling asynchronous probing is no longer supported. The SCSI disk driver (sd_mod) is loaded before all SCSI host adapter drivers, which results in more stable SCSI disk numbering in practice

 

Disclaimer

This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.

  • Document ID:7015688
  • Creation Date: 24-Sep-2014
  • Modified Date:14-May-2024
    • SUSE Linux Enterprise Desktop
    • SUSE Linux Enterprise Server

< Back to Support Search

For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]suse.com

tick icon

SUSE Support Forums

Get your questions answered by experienced Sys Ops or interact with other SUSE community experts.

tick icon

Support Resources

Learn how to get the most from the technical support you receive with your SUSE Subscription, Premium Support, Academic Program, or Partner Program.

tick icon

Open an Incident

Open an incident with SUSE Technical Support, manage your subscriptions, download patches, or manage user access.