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

 

 

 

How to fix bad partition UUID?

Linux Kernel, Network, and Services configuration.
Post Reply
Message
Author
ralphb
Posts: 20
Joined: 2022-05-27 09:09
Has thanked: 1 time

How to fix bad partition UUID?

#1 Post by ralphb »

I've installed Debian 11 on my notebook, with one boot partition and an encrypted root partition. Everything was well.

Overnight, my notebook wouldn't start anymore and displayed this message instead:
cryptsetup: waiting for encrypted source device UUID=....
I don't have the slightest clue why this UUID could disappear, especially since I still have all my partitions.

Next, I used the rescue image to boot into my system, and I removed all UUIDs from

Code: Select all

/etc/fstab
and

Code: Select all

/etc/crypttab
followed by

Code: Select all

update-grub && update-initramfs
But the problem persists (including that message). Where else do I need to look for that UUID?

User avatar
NorthEast
Posts: 348
Joined: 2018-11-18 04:35
Has thanked: 12 times
Been thanked: 30 times

Re: How to fix bad partition UUID?

#2 Post by NorthEast »

Perhaps: /dev/disk/by-uuid/

ralphb
Posts: 20
Joined: 2022-05-27 09:09
Has thanked: 1 time

Re: How to fix bad partition UUID?

#3 Post by ralphb »

Thanks for the suggestion! That seems to be the mapping from UUID to device, which I didn't know about, so I guess I could just add a new link for the missing UUID.

But in terms of eliminating the usage of all UUIDs, this probably doesn't help.

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

Re: How to fix bad partition UUID?

#4 Post by p.H »

ralphb wrote: 2022-06-03 15:23 I don't have the slightest clue why this UUID could disappear
When failing to mount the root filesystem, the initramfs spawns a basic shell which allows you to investigate with blkid and so on.
ralphb wrote: 2022-06-03 15:23 I removed all UUIDs from /etc/fstab and /etc/crypttab
What do you mean exactly by "remove" ?
ralphb wrote: 2022-06-03 15:23 update-grub && update-initramfs
update-grub is pointless for this.
update-initramfs needs -u to update an existing initramfs and -k <version> if the target kernel version is different from the running one.

ralphb
Posts: 20
Joined: 2022-05-27 09:09
Has thanked: 1 time

Re: How to fix bad partition UUID?

#5 Post by ralphb »

By "removing UUIDs" I meant replacing them with /dev/XXX. There were only two entries anyway.

And yes, I meant

Code: Select all

update-initramfs -u -k all
but omitted it. I also didn't use &&, but wanted to avoid having too many code blocks to improve legibility.

But I finally decided to reinstall Debian on that machine, and hopefully I won't have UUID issue again.

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

Re: How to fix bad partition UUID?

#6 Post by p.H »

ralphb wrote: 2022-06-04 10:32 By "removing UUIDs" I meant replacing them with /dev/XXX
Be careful, /dev/sd* names are not persistent across reboots and must not be relied on. This is a reason why UUIDs are used instead.
ralphb wrote: 2022-06-04 10:32 wanted to avoid having too many code blocks to improve legibility.
Completeness and exactness must not be sacrificed for legibility.
ralphb wrote: 2022-06-04 10:32 But I finally decided to reinstall Debian on that machine, and hopefully I won't have UUID issue again.
You do not know why it happened and you are expecting that it will not happen again ? Prepare to be disappointed.

ralphb
Posts: 20
Joined: 2022-05-27 09:09
Has thanked: 1 time

Re: How to fix bad partition UUID?

#7 Post by ralphb »

You do not know why it happened and you are expecting that it will not happen again ? Prepare to be disappointed.
*sigh* I fully agree with you here! And I know which problem UUIDs are meant to solve, but so far, my experience has been the other way around.

User avatar
fabien
Forum Helper
Forum Helper
Posts: 604
Joined: 2019-12-03 12:51
Location: Anarres (Toulouse, France actually)
Has thanked: 60 times
Been thanked: 141 times

Re: How to fix bad partition UUID?

#8 Post by fabien »

p.H wrote: 2022-06-04 11:01Be careful, /dev/sd* names are not persistent across reboots and must not be relied on. This is a reason why UUIDs are used instead.
I fully agree with that. Not long ago when checking a SSD with 'smartctl -a /dev/sda' I had the surprise to get results for an HDD that usually is /dev/sdb. I absolutely don't know why the letter had changed this time, stray cosmic ray being surely the most convincing hypothesis.
ralphb wrote: 2022-06-04 11:41*sigh* I fully agree with you here! And I know which problem UUIDs are meant to solve, but so far, my experience has been the other way around.
I don't know what triggered the problem you experienced, but it certainly has nothing to do with UUID and would have happened anyway (unless UUID has actually changed, but you'd know it, UUIDs don't change on their own. You are mistaken by the fact that the error message uses UUID to refer to the disk). So IMHO you'd better stick to UUID.

ralphb
Posts: 20
Joined: 2022-05-27 09:09
Has thanked: 1 time

Re: How to fix bad partition UUID?

#9 Post by ralphb »

fabien wrote: 2022-06-04 13:17 You are mistaken by the fact that the error message uses UUID to refer to the disk).
I'm not sure I understand. Are you saying that the UUID in the error message does not refer to a disk device? If so, what else could it be?

User avatar
fabien
Forum Helper
Forum Helper
Posts: 604
Joined: 2019-12-03 12:51
Location: Anarres (Toulouse, France actually)
Has thanked: 60 times
Been thanked: 141 times

Re: How to fix bad partition UUID?

#10 Post by fabien »

Sorry for not being clear enough. First, I should have said "refer to disk partition".
What I meant is that the error message uses UUID because that's how the partition is referred to but it would have used for instance /dev/sdx otherwise.

Was 'cryptsetup: waiting for encrypted source device UUID=....' (four dots instead of the UUID) the actual message or did you replace the UUID with dots? I assumed that you replaced the real UUID with dots, hence my possible misunderstanding.

ralphb
Posts: 20
Joined: 2022-05-27 09:09
Has thanked: 1 time

Re: How to fix bad partition UUID?

#11 Post by ralphb »

Yes, since I didn't remember the UUID, I just wrote "...", and yes, I assumed it's waiting for a partition.

I still don't understand why the system waited for an invalid UUID, but I then wanted to replace UUID references by devices, but the message remained.

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

Re: How to fix bad partition UUID?

#12 Post by p.H »

fabien wrote: 2022-06-04 13:17 when checking a SSD with 'smartctl -a /dev/sda' I had the surprise to get results for an HDD that usually is /dev/sdb. I absolutely don't know why the letter had changed this time
There is no need for a reason. /dev/sd* names are not stable by design.
ralphb wrote: 2022-06-04 15:31 I still don't understand why the system waited for an invalid UUID
How do you know the UUID was invalid ?

ralphb
Posts: 20
Joined: 2022-05-27 09:09
Has thanked: 1 time

Re: How to fix bad partition UUID?

#13 Post by ralphb »

fabien wrote: 2022-06-04 13:17 How do you know the UUID was invalid ?
You're right, that was just an assumption, since the machine waited and waited until the emergency shell came up.

Usually, there'd be a prompt for my LUKS password.

User avatar
fabien
Forum Helper
Forum Helper
Posts: 604
Joined: 2019-12-03 12:51
Location: Anarres (Toulouse, France actually)
Has thanked: 60 times
Been thanked: 141 times

Re: How to fix bad partition UUID?

#14 Post by fabien »

ralphb wrote: 2022-06-05 07:59
fabien wrote: 2022-06-04 13:17 How do you know the UUID was invalid ?
@p.H wrote this, but I may have asked the same question.

You can output all UUID (and also PARTUUID but I think they are less likely to be used) with

Code: Select all

lsblk -o +UUID,PARTUUID
and compare with UUIDs used in your config files.

'man 8 mount' also states:
Don't forget that there is no guarantee that UUIDs and labels are really unique, especially if you move, share or copy the device. Use lsblk -o +UUID,PARTUUID to verify that the UUIDs are really unique in your system.

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

Re: How to fix bad partition UUID?

#15 Post by p.H »

lsblk is not available by default in the initramfs. blkid is.

ralphb
Posts: 20
Joined: 2022-05-27 09:09
Has thanked: 1 time

Re: How to fix bad partition UUID?

#16 Post by ralphb »

I've used my notebook extensively over the past two weeks, but so far everything is still working (while still using UUIDs). But this discussion is very handy to have in case something goes wrong again.

peer
Posts: 441
Joined: 2017-03-26 10:14
Has thanked: 7 times
Been thanked: 19 times

Re: How to fix bad partition UUID?

#17 Post by peer »

UIID can be changed with gparted

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

Re: How to fix bad partition UUID?

#18 Post by p.H »

peer wrote: 2022-06-21 07:18 UIID can be changed with gparted
In other words, use a sledgehammer to crack a nut. Bloatware power.

Post Reply