Mounting a drive is chaotic with the two NVMe SSD drives
Thanks to guiverc for pointing out the solution. It's simply to mount using UUID and not drive path. This is the way to do it:
- Get the list of your drives:
$ lsblk
returns:
nvme1n1 259:0 0 1,8T 0 disk
└─nvme1n1p1 259:5 0 1,8T 0 part /mnt/data
- Get the UUID of the drive you're interested in:
$ sudo blkid | grep -i nvme1n1p1
Now change my fstab line from this:
/dev/nvme1n1p1 /mnt/data auto defaults 0 1
to this:
UUID=388f4772-1f41-4b13-9c74-9ed56c4bacc5 /mnt/data auto defaults 0 1
And that does it.
Related videos on Youtube
The Quantum Physicist
Updated on September 18, 2022Comments
-
The Quantum Physicist over 1 year
My new computer has two NVMe SSD chips. Both are on the motherboard (no PCIe cards involved). On one of them there's the operating system and the other is for large data storage. For that, I wrote this on
/etc/fstab
:/dev/nvme1n1p1 /mnt/data auto defaults 0 1
However, which of them is
nvme0n1p1
and which isnvme1n1p1
? That's totally random, and potentially changes on every restart of my system.Because of that
fstab
line, some times the right drive is mounted on/mnt/data
, and some times the system drive. So to fix this, I have to manually go tofstab
and change the numbers from 0 to 1 or the opposite, thensudo umount /mnt/data
then
sudo mount -a
And that fixes the problem. But I have to do this every now and then MANUALLY. This makes it impossible to associate anything on from the data drive with startup, because I'll never know which of them will be mounted on
/mnt/data
.What do you think? Where is this problem coming from?
I'm using Ubuntu 18.04.
-
guiverc over 4 yearsWhat are you using to mount them in your /etc/fstab? UUIDs are used because they are Unique (one of the U's). Change your /dev reference to use the UUID= so it's unique and always the same. Use
blkid
to get the UUID for each device/partition, and code that in your /etc/fstab -
The Quantum Physicist over 4 years@guiverc Correct. I'm using the line you see up there as it's. I'll try to get UUIDs. Sounds like a good solution.
-
-
oldfred over 4 yearsYou can see both mount & UUID with lsblk
lsblk -f