If, by loss of order, you mean /dev/sdX has become /dev/sdY, that’s totally normal. Now that sd_mod is a module, the assignment of /dev/sd* to any physical disk will vary from one boot to the next because the mapping happens asynchronously, it just depends on who wins the race on this particular boot.
So all permanent references to disk partitions must now use something other than /dev/sd*. Each UUID is unique permanent ID of the physical partition. The directory /dev/disk/by-uuid/
links the permanent UUIDs as symbolic link to the /dev/sd*
that have been assigned at this boot (and might be different from last boot), for example:
kosmos1:~ # ls -l /dev/disk/by-uuid/
total 0
lrwxrwxrwx 1 root root 10 Oct 15 07:00 22a1937f-9205-44c5-bcd2-24ae9ed4a774 -> ../../sdd1
lrwxrwxrwx 1 root root 10 Oct 15 07:00 453caaf5-5fed-43d8-b823-58f4ded3ab63 -> ../../sda2
lrwxrwxrwx 1 root root 10 Oct 15 07:00 478d16c2-5627-4899-af6d-911b6ec687c8 -> ../../sdd2
lrwxrwxrwx 1 root root 15 Oct 15 07:00 5bc9d2d6-2212-4838-aa9e-a999efda1461 -> ../../nvme0n1p4
lrwxrwxrwx 1 root root 10 Oct 15 07:00 8B2D-89F3 -> ../../sda1
lrwxrwxrwx 1 root root 15 Oct 15 07:00 A0B7-6A4E -> ../../nvme0n1p1
lrwxrwxrwx 1 root root 10 Oct 15 07:00 a83d704e-ff90-45f2-903e-63b68a24eabc -> ../../sdb1
lrwxrwxrwx 1 root root 15 Oct 15 07:00 c94208de-d084-470a-bd4a-0bf8a8518154 -> ../../nvme0n1p3
lrwxrwxrwx 1 root root 10 Oct 15 07:00 df26a260-6198-44f8-b9ea-94968bf7ead5 -> ../../sda3
lrwxrwxrwx 1 root root 10 Oct 15 07:00 e4123e0c-f1a4-4b97-a7f4-a306c595c7c9 -> ../../sdc1
All permanent references in places such as /etc/fstab
and /boot/grub2/grub.cfg
must now use indirect reference to physical partitions and disks such as UUID’s (or labels).
Additionally, when referring to entire disks, they don’t have UUID’s, so they must be identified by various other means via the directories under /dev/disk
, for example:
kosmos1:~ # ls -l /dev/disk/
total 0
drwxr-xr-x 2 root root 400 Oct 15 07:00 by-diskseq
drwxr-xr-x 2 root root 1000 Oct 15 07:00 by-id
drwxr-xr-x 2 root root 160 Oct 15 07:00 by-label
drwxr-xr-x 2 root root 80 Oct 15 07:00 by-partlabel
drwxr-xr-x 2 root root 240 Oct 15 07:00 by-partuuid
drwxr-xr-x 2 root root 680 Oct 15 07:00 by-path
drwxr-xr-x 2 root root 240 Oct 15 07:00 by-uuid
For example, I have script that idles a couple of drives at boot, I can’t use /dev/sd*
because it’s not constant and will change from one boot to the next, I have to refer to the drives indirectly:
backup_drive=/dev/disk/by-id/ata-ST3000DM008-2DM166_Z5051V50
spare_drive=/dev/disk/by-id/ata-ST4000DM004-2CV104_ZTT0XJAW
ls -l $spare_drive $backup_drivels
lrwxrwxrwx 1 root root 9 Oct 15 07:00 /dev/disk/by-id/ata-ST3000DM008-2DM166_Z5051V50 -> ../../sdd
lrwxrwxrwx 1 root root 9 Oct 15 07:00 /dev/disk/by-id/ata-ST4000DM004-2CV104_ZTT0XJAW -> ../../sdc
In other posts have described work-arounds that allow my desktops to retain a deterministic and fixed /dev/sd*
. Apparently they might not work for all systems, but they do work on all my home PC’s. Presumably building a custom kernel with a built in driver would also revert to the previous more stable situation.