Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

[Solved] Consistently mounting a device name at boot up

Linux Kernel, Network, and Services configuration.
Post Reply
Message
Author
User avatar
cds60601
df -h | participant
df -h | participant
Posts: 719
Joined: 2017-11-25 05:58
Location: Florida
Has thanked: 133 times
Been thanked: 63 times

[Solved] Consistently mounting a device name at boot up

#1 Post by cds60601 »

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.
Supercalifragilisticexpialidocious

User avatar
sickpig
Posts: 589
Joined: 2019-01-23 10:34

Re: Consistantly mounting a device name at boot up

#2 Post by sickpig »

UUID always works
post the output of ur fstab and

Code: Select all

lsblk -f

peter_irich
Posts: 1405
Joined: 2009-09-10 20:15
Location: Saint-Petersburg, Russian Federation
Been thanked: 11 times

Re: Consistantly mounting a device name at boot up

#3 Post by peter_irich »

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

Peter.

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 133 times

Re: Consistantly mounting a device name at boot up

#4 Post by Head_on_a_Stick »

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 :)
deadbang

User avatar
cds60601
df -h | participant
df -h | participant
Posts: 719
Joined: 2017-11-25 05:58
Location: Florida
Has thanked: 133 times
Been thanked: 63 times

Re: Consistantly mounting a device name at boot up

#5 Post by cds60601 »

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
Supercalifragilisticexpialidocious

Post Reply