Kernel block device names changing, order became non-deterministic
This document (7015688) is provided subject to the disclaimer at the end of this document.
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
After adding a new disk and rebooting, the device name is changed. For example, sda would become sdb, or dasda would become dasdb.
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
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.
Begining 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 synchonous 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
scsi_mod.disable_async_probing=<driver>[,<driver>] e.g. scsi_mod.disable_async_probing=megaraid_sas
on the kernel command line to disable asynchronous scanning of devices. For adding this option permanently, please edit /etc/default/grub and add the option to the GRUB_CMDLINE_LINUX_DEFAULT variable, after changing the changes run
to write the option into /boot/grub2/grub.cfg.
For further details please see the respective chapter in the SUSE Linux Enterprise 15 Service Pack 2 Release Notes: https://www.suse.com/releasenotes/x86_64/SUSE-SLES/15-SP2/index.html#jsc-SLE-11117
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:26-Sep-2022
- SUSE Linux Enterprise Desktop
- SUSE Linux Enterprise Server
For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]suse.com