Score:0

Drive designations changing every reboot when no hardware is changed

hu flag

My Lubuntu machine is changing the way it designates the hard drives every time I change /etc/fstab and reboot it. For example, if I have the definition below the /media/WD2Tb and /media/Elements4Tb drives are not mounted:

/dev/sda1   /media/Samsung2Tb1    ext4    defaults,nofail   0    0
/dev/sdb1   /media/Hitachi2Tb    ext4    defaults,nofail  0    0
/dev/sdd1   /media/WD2Tb    ext3    defaults,nofail   0    0
/dev/sdg2   /media/Hitachi3Tb    ntfs    defaults,nofail   0    0
/dev/sde2   /media/USB4Tb    ntfs    defaults,nofail   0    0
/dev/sdc1   /media/Elements4Tb    ntfs    defaults,nofail   0    0

(The first 4 drives are internally mounted. The last 2 are external USB drives).

When I look at the disks in settings I see that the WD2Tb drive is designated as /dev/sdc1, and the Elements4Tb is designated as /dev/sdd1. So I edit /etc/fstab to change it to this:

/dev/sda1   /media/Samsung2Tb1    ext4    defaults,nofail   0    0
/dev/sdb1   /media/Hitachi2Tb    ext4    defaults,nofail  0    0
/dev/sdc1   /media/WD2Tb    ext3    defaults,nofail   0    0
/dev/sdg2   /media/Hitachi3Tb    ntfs    defaults,nofail   0    0
/dev/sde2   /media/USB4Tb    ntfs    defaults,nofail   0    0
/dev/sdd1   /media/Elements4Tb    ntfs    defaults,nofail   0    0

...but after a reboot the /media/WD2Tb and /media/Elements4Tb drives are not mounted again. This time when I look at the Disks in Settings I see that the WD2Tb drive is now designated as /dev/sdd1, and the Elements4Tb is designated as /dev/sdc1 (which is how I had them defined in the first place).

I can repeat this process ad infinitum - whenever I edit fstab, revert the designations of those two drives, and reboot the designation of the drives reverts back to its previous value. If I reboot without editing fstab then the designations stay the same. So it's basically whack-a-mole.

I know that the designations are arbitrary, but I don't understand why these two drives are having their designations changed whenever I edit fstab and reboot, despite no changes being made to the hardware.

in flag
The device names are assigned based on the order they report themselves to the host operating system, so it’s natural for them to change. I would suggest [using UUIDs in your `fstab` file](https://help.ubuntu.com/community/UsingUUID) to ensure the file systems are consistently mounted in the correct locations
Ian M avatar
hu flag
Thanks - I'll use UUID's instead. As a matter of interest, do you know why the /dev/sd* designations were changing even when none of the hardware had changed?
guiverc avatar
cn flag
The order they are seen by the OS is determined by your hardware/firmware.. It maybe the order power was turned on, but you'll need to explore the details of your actual hardware (off-topic; eg. *some drives have a random delay on power up so if multiple are turned on at the same time they don't all 'spin up' at the same time & struggle for power risking early failure*) as this site is about Ubuntu OS (inc. Lubuntu).
Ian M avatar
hu flag
Yes - many thanks
karel avatar
sa flag
@IanM If the above link answered your question please click "Yes" in the line after "Does this answer your question?" in the light blue banner above your question.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.