On Fri, 2023-10-27 at 09:25 +0200, Johannes Meixner wrote:
In practice it causes "interesting user experience" when booting from USB disk results that this one becomes /dev/sda and the system disk becomes /dev/sdb.
usb-storage is a low level SCSI driver like any other. If there are multiple LLDs, the disk ordering will depend on the order in which the LLDs are loaded an initialized. If you create an initrd for booting from USB, this initrd must contain "usb-storage". If you want your sd device ordering to remain stable when booting from the USB device, you must make sure that the driver for your "normal" boot disk (e.g. ahci) is also included the initrd, _and_ is loaded _before_ usb-storage. The first requirement can be fulfilled by using "--add-drivers ahci" on the dracut command line. The second would be achieved by creating a modprobe.d file like this: softdep usb-storage pre: ahci and making sure it's included in the initrd, too. As distribution, we can't enforce this automatically. We would have to create softdeps like this for every SCSI LLD. This would imply that loading usb-storage would pull in dozens of unnecessary SCSI drivers on every system. We can't do this. Therefore, if a user creates a USB boot disk for his system, he must take care of the above steps himself, specifying the drivers that his particular system needs in the softdep directive. Note that in order for this to be reliable (too the extent possible), sd_mod should be loaded before all LLDs, as enforced by the forthcoming suse-module-tools update. Thanks Martin