[Solved] Consistently mounting a device name at boot up

Kernels & Hardware, configuring network, installing services

[Solved] Consistently mounting a device name at boot up

Postby cds60601 » 2019-06-11 21:26

In general, I been having some issues with mounting devices (SATA drives connected via USB docing station - Unitek, for example) on boot up.

So here's the thing, I have read that if you want to ensure that a drive is mounted consistently, its better to use the UUID opposed it's device name (/dev/sdb1 for example).
That (for me) has not been the case. From what I have experienced, a soft boot (more often than not) will not always mount the device as I wish it to be mounted.
On the other-hand, a hard boot will (more often than not) mount the devices correctly. It does not appear to matter when using UUID or device name, miss-mounting happens more often that I wish it to.

Is there any certain way to lock in a device name on either warm/cold boot that will remain consistent?

Thanks all,
C
Last edited by cds60601 on 2019-06-22 01:59, edited 1 time in total.
Server: Debian 9, Workstation: Arch
Laptop: Debian SID (i3), Pi: Raspbian (Pi-Hole)
User avatar
cds60601
 
Posts: 177
Joined: 2017-11-25 05:58
Location: Tampa, Florida

Re: Consistantly mounting a device name at boot up

Postby sickpig » 2019-06-12 03:10

UUID always works
post the output of ur fstab and
Code: Select all
lsblk -f
haven = Sir P.G. Wodehouse's books. U havent lived unless u have read one :)
User avatar
sickpig
 
Posts: 314
Joined: 2019-01-23 10:34

Re: Consistantly mounting a device name at boot up

Postby peter_irich » 2019-06-12 05:15

I prefer mount by volume-label. It is more readable.

Peter.
peter_irich
 
Posts: 1254
Joined: 2009-09-10 20:15
Location: Saint-Petersburg, Russian Federation

Re: Consistantly mounting a device name at boot up

Postby Head_on_a_Stick » 2019-06-12 07:47

cds60601 wrote:I have read that if you want to ensure that a drive is mounted consistently, its better to use the UUID opposed it's device name (/dev/sdb1 for example).

^ This is correct, the block devices are assigned dynamically and may change from one boot to the next.

I prefer PARTUUIDs, which stay the same even if the partition is reformatted :)
User avatar
Head_on_a_Stick
 
Posts: 10346
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Consistantly mounting a device name at boot up

Postby cds60601 » 2019-06-12 11:27

Head_on_a_Stick wrote:
cds60601 wrote:I have read that if you want to ensure that a drive is mounted consistently, its better to use the UUID opposed it's device name (/dev/sdb1 for example).

^ This is correct, the block devices are assigned dynamically and may change from one boot to the next.

I prefer PARTUUIDs, which stay the same even if the partition is reformatted :)


That is what I appeared to be not using. I did this for the SATA drive I have inplace of my CD/DVD burner in a laptop. After about a dozen reboots (both warm and cold), this particular drive has held firm. Perfecto!!! here are the lines (old and new) below.

Code: Select all
#/dev/sdb1   /media/work   ext4   defaults,nofail,x-systemd.device-timeout=10000ms   0   2
PARTUUID=b12723ad-4ba3-de47-884b-ea1926d2f2e3   /media/work   ext4   defaults,nofail,x-systemd.device-timeout=10000ms   0   2


The next issue to correct was to do the same with 2 LUKS drives. Below is the current entries in /etc/fstab

Code: Select all
/dev/mapper/xa   /media/xa   ext4   defaults,nofail   0   0
/dev/mapper/xb   /media/xb   ext4   defaults,nofail   0   0


This seems to be correct, but what I did find out, is that using cryptsetup luksDump, I should have had the UUID in /etc/crypttab. Below reflects old and new entries.

Code: Select all
#xa /dev/sdc1 /root/xdky luks noauto
#xb /dev/sdd1 /root/xdky luks noauto
xa UUID=27ecc87f-7f6c-4953-9f9f-356b5e27b6fa /root/xdky luks
xb UUID=49dba909-4db0-4066-8473-1389d951c15a /root/xdky luks


So, thanks in part to HoaS and a little more investigating, I think I solved the original problems!!!

Gladly will take any advice on entries to either file mentioned above.

C
Server: Debian 9, Workstation: Arch
Laptop: Debian SID (i3), Pi: Raspbian (Pi-Hole)
User avatar
cds60601
 
Posts: 177
Joined: 2017-11-25 05:58
Location: Tampa, Florida


Return to System configuration

Who is online

Users browsing this forum: No registered users and 7 guests

fashionable