Back in late 2017, I encountered the following issue in Fedora WS (I think it was version 27 then).
In my desktop PC, I had a SSD disk with 250 GB and three mechanical HDDs (each one of 1 TB)
I installed fedora in the SSD drive (250 GB). The device names were like below and it remained the same across several reboots.
[adrian@duffy ~]$ lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 970G 0 disk /data1 sdb 8:16 0 970G 0 disk /data2 sdc 8:32 0 970G 0 disk /data3 sdd 8:48 0 232.9G 0 disk ├─sdd1 8:49 0 500M 0 part /boot/efi ├─sdd2 8:50 0 1.3G 0 part /boot ├─sdd3 8:51 0 110G 0 part /home └─sdd4 8:52 0 110G 0 part /
After a month, I purchased two new 1 TB HDDs and attached these new hard drives to the SATA ports of the motherboard. Upon reboot, all the block device names went berserk. Even the ones where Fedora OS was installed got changed (from
sdf as shown below) and ended up something like below.
lsblk output was showing something like below
[adrian@duffy ~]$ lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 970G 0 disk |---------> The newly attached unformatted disk sdb 8:16 0 970G 0 disk /data1 sdc 8:32 0 970G 0 disk |---------> The newly attached unformatted disk sdd 8:0 0 970G 0 disk /data2 sde 8:0 0 970G 0 disk /data3 sdf 8:48 0 232.9G 0 disk ├─sdf1 8:49 0 500M 0 part /boot/efi ├─sdf2 8:50 0 1.3G 0 part /boot ├─sdf3 8:51 0 110G 0 part /home └─sdf4 8:52 0 110G 0 part /
/etc/fstab looks only at the UUID of a device and mounts it on the mount point specified in the file. So, it didn’t cause any real harm for me. I guess this ‘issue’ exists in Fedora even today. Its Fedora 34 at the time of writing this post (19-June-2021)
Last week, my friend who was running Chia crypto farming in Ubuntu 20.04.2.0 LTS PC faced a similair scenario and he formatted the wrong disk by mistake. And this prompted me to post this.
I have 3 questions :
Question1. Why can’t Mr Torvalds and team fix this device name/drive letter changing upon reboot issue?
I know this is not a Fedora or an Ubuntu issue, as the Linux kernel just names block devices as
/dev/sdb randomly in the order they are discovered. But, don’t you think it is better to have device name/drive letters persistent across reboots to avoid unwanted headaches ?
Question2. In my above example from 2017, the device names did not change for a month (across several reboots). It changed only when I attached 2 new HDDs to the motherboard’s SATA ports. Why ? What suddenly forced Linux kernel to freshly name all the SATA disks ?
Question3. Does adding
/dev/sd* device names in
/etc/fstab entries a recommended way to make the
/dev/sd* names persistent across reboots ? Well, if this actually worked, we wouldn’t be needing to configure udev for this. Right ?
Apologies for my first post for being a long one