device recognition or fstab issues

Questions about applications and software
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
paparucino
Level 1
Level 1
Posts: 4
Joined: Tue Jan 15, 2013 8:48 am

device recognition or fstab issues

Post by paparucino »

Hi, I'm using a PC with LM20.2 installed and I'm having problems with fstab or, more likely, with device recognition.
This is the fstab file

Code: Select all

# /boot/efi was on /dev/sda1 during installation
UUID=8374-A76C /boot/efi vfat umask=0077 0 1
/swapfile none swap sw 0 0
#/dev/sda1 /media/root ext3 defaults 0 0
/dev/sdb1 /media/root ext3 defaults 0 0
/dev/sdb6 /media/torrent ext3 defaults 0 0
/dev/sdb5 /media/miscellaneous ext3 defaults 0 0
As you can see all devices are (should) be installed as /dev/sdbx, in reality it often happens that instead of /dev/sdb1 it is recognized as /dev/sda1 while other times it is mounted correctly. If I force manual umount/mount everything works fine.
FYI;
/dev/sdb1 is an external HD
/dev/sdb5 and 6 are internal partitions
When the extarnal disk is mounted as /dev/sda1, the internal partitions are as /dev/sdb1 and viceversa
Last edited by LockBot on Mon May 29, 2023 10:00 pm, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
spamegg
Level 13
Level 13
Posts: 4782
Joined: Mon Oct 28, 2019 2:34 am
Contact:

Re: device recognition or fstab issues

Post by spamegg »

Hello paparucino welcome to the Forum.
Please share your system info by going to:
→→→→ Menu/System Reports/System Information/click "Copy"
and pasting it here.
(Equivalently, you can use the command inxi -Fxxxmprz on the Terminal.)

In your fstab file, instead of using /dev/sdxx you should be using the UUIDs of the devices which you get from blkid. This will get rid of all the inconsistencies. (This is mentioned at the top of /etc/fstab.)

You can look up your UUIDs like this (this is an example from my PC)

Code: Select all

 ➜ blkid
/dev/nvme0n1p1: UUID="2b3bfa4c-de56-427e-8edf-15e22c89b132" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="e82cf6ee-01"
/dev/sdb1: UUID="f8bcad7e-b780-49f7-86e6-73d2b846d506" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="3d29e9d7-01"
/dev/sdc1: LABEL="CrucialMX100" UUID="ad6972b2-0d5b-44b9-961b-d5b193beb0ff" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="62fa7562-01"
/dev/sda1: LABEL="SAMSUNG850EVO" UUID="9d5a914f-ff1f-4634-82ab-09a05a644ea1" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="86a3af8d-01"
Now in your /etc/fstab use these instead of the devs. For example (my fstab file):

Code: Select all

 ➜ ccat /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/nvme0n1p1 during installation
UUID=2b3bfa4c-de56-427e-8edf-15e22c89b132 /                         ext4 noatime,defaults 0 1
UUID=9d5a914f-ff1f-4634-82ab-09a05a644ea1 /media/spam/SAMSUNG850EVO ext4 noatime,defaults 0 0
UUID=ad6972b2-0d5b-44b9-961b-d5b193beb0ff /media/spam/CrucialMX100  ext4 noatime,defaults 0 0
UUID=f8bcad7e-b780-49f7-86e6-73d2b846d506 /media/spam/UbuntuStudio  ext4 noatime,defaults 0 0
#/swapfile                                 none            swap    sw              0       0
Locked

Return to “Software & Applications”