On Wednesday 11 October 2023, Michael Hamilton wrote:
On Tuesday 10 October 2023, Martin Wilck via openSUSE Factory wrote:
....
`scsi_mod.disable_async_probing=ahci` affects the ordering for a given SCSI host (i.e. SATA port) using the ahci driver. This still doesn't guarantee a stable global ordering, because the ordering of SCSI hosts remains unreliable. It depends on the order in which drivers are loaded (e.g. USB devices may be detected first). You can try to enforce a loading order for SCSI drivers using modprobe.d, like this for usb:
softdep usb_storage pre: ahci
Furthermore, the SCSI host ordering depends on the discovery of the upper level devices such as PCI devices and SATA ports, which may or may not be deterministic.
I don't work with booting very often, so to confirm the procedure, it should be something like (as root):
% echo 'softdep usb_storage pre: ahci' >/etc/modprobe.d/10-ahci-scsi.conf % dracut -f --regenerate-all
I first just ran dracut -f and the boot order still varied. But after adding the --regenerate-all both a hot and cold boot reverted to the old ordering. Others reading this might also want to note that mkinitrd is no longer available, so do use dracut.
I know the order shouldn't be relied on, but I think for many normal desktop PC's it's probably worked OK since v0.10 in 1992, so this is bound to trip up a few people, at least until all the examples on the web and in various config files get updated (probably never going to happen). It's good to have a documented work around.
Thanks for sorting this out.
Michael
For anyone interested in this thread, there is now a bug report in which Martin Wilck has provided a more definitive work around: https://bugzilla.opensuse.org/show_bug.cgi?id=1216070#c14 Basically, as root: echo sd_mod > /etc/modules-load.d/sd_mod.conf dracut -f --regenerate-all Loading sd_mod earlier seems to revert the detection order. This work around has worked for every boot (at least 10 boots) since I put it in place. The proper solution is to remove permanent references to /dev/sd* from where ever they might be found. In my case /etc/fstab was already mostly using labels (just had to label swap), but grub wasn't using UUIDs. I've also had to track down scripts using hdparm and smartctrl which I've changed to refer to whole disks by /dev/disk/by-id/*, for example: find /dev/disk/by-id/ -type l \! -name '*-part[0-9]' | grep SATA I'm still going to use the work around. The ordering has been fixed/deterministic on my desktops for 30+ years. I prefer to see a more fixed output when I do df, lsblk, and similar. Michael