Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[workaround] luks-device not recognized via UUID anymore
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
freifunk_connewitz
Apprentice
Apprentice


Joined: 08 Feb 2006
Posts: 231

PostPosted: Thu Nov 02, 2023 2:01 pm    Post subject: [workaround] luks-device not recognized via UUID anymore Reply with quote

Hi,

rebooting after yesterdays updates left me with a failing decryption by dmcrypt: the luks-encrypted usb device that normally gets unlocked and mounted during boot failed to do so. The device is configured in /etc/conf.d/dmcrypt like this:
Code:
source=UUID=xxxxx
.
It gets mounted automatically according to an entry in /etc/fstab pointing to the unlocked partition under /dev/mapper/xyz.

But now the boot process halts with a dmcrypt error message: "Device /dev/sdb1 already contains a superblock signature." and a warning that continuing would erase data. If I type YES, the password prompt shows up, after entering the password fsck on the unlocked device fails and mounting as well.

The normal behaviour until yesterday: request password>unlock>fsck>mount.

After some testing I found out the problem lies in the UUID determination of the partition. When I issue manually:
Code:
cryptsetup luksOpen UUID=XXXXX crypt-usb
dmcrypt fails with "UUID=XXX ist not a valid Luks device".
But when I use the dev location it works without problems.

So the solution to my problem was to change the entry in /etc/conf.d/dmcrypt from
Code:
source=UUID=XXX

to
Code:
source=/dev/sdb1


(although many manuals say one should avoid the automatically enumbered dev names, I know).

Just in case somebody else has the same problem.

Since the only change to my system was a world update, probably one of these packages is behind this regress:

Quote:
genlop --list --date yesterday
* packages merged:

Wed Nov 1 11:40:48 2023 >>> sys-apps/hwdata-0.374
Wed Nov 1 11:41:26 2023 >>> media-libs/libraw-0.21.1-r1
Wed Nov 1 11:41:34 2023 >>> app-office/libreoffice-l10n-7.5.6.2
Wed Nov 1 11:42:33 2023 >>> sys-apps/systemd-utils-254.5-r1
Wed Nov 1 11:42:58 2023 >>> net-dns/libidn2-2.3.4-r1
Wed Nov 1 11:43:06 2023 >>> dev-python/typing-extensions-4.8.0
Wed Nov 1 11:43:14 2023 >>> dev-python/zipp-3.17.0
Wed Nov 1 11:43:40 2023 >>> sys-apps/file-5.45-r3
Wed Nov 1 11:44:17 2023 >>> dev-libs/libsodium-1.0.19-r1
Wed Nov 1 11:44:31 2023 >>> www-plugins/chrome-binary-plugins-118.0.5993.117
Wed Nov 1 11:44:40 2023 >>> dev-python/setuptools-scm-8.0.4
Wed Nov 1 11:44:49 2023 >>> dev-python/trove-classifiers-2023.9.19
Wed Nov 1 11:45:03 2023 >>> dev-python/cffi-1.16.0
Wed Nov 1 11:45:41 2023 >>> dev-python/cryptography-41.0.4
Wed Nov 1 11:45:50 2023 >>> dev-python/urllib3-2.0.6
Wed Nov 1 11:47:31 2023 >>> media-libs/harfbuzz-8.2.0
Wed Nov 1 11:47:47 2023 >>> media-fonts/urw-fonts-20230503-r1
Wed Nov 1 11:49:00 2023 >>> x11-base/xorg-server-21.1.9
Wed Nov 1 11:49:15 2023 >>> x11-drivers/xf86-input-libinput-1.4.0
Wed Nov 1 11:49:57 2023 >>> x11-drivers/xf86-video-intel-2.99.917_p20230201
Wed Nov 1 11:50:17 2023 >>> net-im/signal-desktop-bin-6.35.0
Wed Nov 1 11:50:30 2023 >>> www-client/opera-104.0.4944.36
Wed Nov 1 11:50:50 2023 >>> www-client/vivaldi-6.2.3105.58
Wed Nov 1 11:52:50 2023 >>> app-text/poppler-23.09.0
Wed Nov 1 11:55:31 2023 >>> dev-libs/protobuf-21.12
Wed Nov 1 11:55:59 2023 >>> sys-apps/iproute2-6.5.0
Wed Nov 1 11:56:32 2023 >>> app-crypt/keysmith-23.04.3
Wed Nov 1 11:57:43 2023 >>> app-crypt/gpgme-1.22.0
Wed Nov 1 11:58:04 2023 >>> sys-apps/smartmontools-7.4
Wed Nov 1 11:58:16 2023 >>> dev-java/openjdk-bin-17.0.8.1_p1
Wed Nov 1 11:58:26 2023 >>> dev-java/openjdk-bin-8.382_p05
Wed Nov 1 14:30:31 2023 >>> app-office/libreoffice-7.5.6.2
Wed Nov 1 14:34:45 2023 >>> media-video/ffmpeg-6.0-r9
Wed Nov 1 14:35:05 2023 >>> mail-client/thunderbird-bin-115.4.1
Wed Nov 1 14:35:38 2023 >>> net-im/zoom-5.16.5.303
Wed Nov 1 14:35:58 2023 >>> www-client/firefox-bin-119.0-r2
Wed Nov 1 14:46:19 2023 >>> media-libs/tg_owt-0_pre20230428
Back to top
View user's profile Send private message
grknight
Retired Dev
Retired Dev


Joined: 20 Feb 2015
Posts: 1662

PostPosted: Thu Nov 02, 2023 2:50 pm    Post subject: Reply with quote

I doubt this script has changed at all in years.

Your manual test is faulty because, very early on, dmcrypt service executes blkid -l -t "${source}" -o device when given a UUID=, or PARTUUID=, etc. to translate to real device.

Then it does cryptsetup isLuks ${source_dev} to figure out what if it should open the device or create a plain crypt (e.g. for swap)

Who knows what is going on in the time. If there are other options involved or if it is just some race condition.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum