You are not logged in.

#1 2019-06-25 23:07:02

vlad_ilyich
Member
Registered: 2019-06-25
Posts: 5

[SOLVED]Device not found when attempting to boot to new LUKS partition

Hi all, I've hit a bit of a bump in the road here. I installed arch on my Macbook following the wiki, with success, and have been playing around with it for a while. I have a boot partition on /dev/sda4 and a root partition on /dev/sda5. I'd like to encrypt my system.

Actually, I have successfully encrypted my root partition, and can mount it from a live USB and see all my files! The trouble I'm having is actually booting to it. Here's what I did to get here:

  • Copied my root filesystem to a backup partition. Chrooted into this partition and configured GRUB to boot to it.

  • Restarted into this new backup partition.

  • Formatted my original boot and root partitions.

  • Set up LUKS on the root partition, following the "Preparing non-boot partitions" steps in the wiki.

  • Copied root filesystem back over to the newly-encrypted root partition.

  • Mounted and chrooted into the encrypted root partition.

  • Mounted /boot and installed grub.

  • Added the hooks to mkinitcpio.conf called for in "Configuring mkinitcpio," then generated the images.

  • Added "cryptdevice=UUID=<dev/sda5 UUID>:cryptroot root=/dev/mapper/cryptroot" to /etc/default/grub.

  • Generated grub.cfg with "grub-mkconfig -o /boot/grub/grub.cfg"

  • Rebooted and hoped for the best!

So that gets me to my error. I'm making it to the GRUB menu, where I can choose to boot into Arch. Then I get no password prompt, a few seconds delay, and eventually this error:

Starting version 242.29-3-arch
ERROR: device 'UUID=<UUID of LUKS fs>' not found. Skipping fsck.
mount: /new_root: can't find UUID=<UUID of LUKS fs>.
You are now being dropped into an emergency shell.

To be clear, the UUID in the error is NOT that of the physical root partition (i.e. the UUID of /dev/sda5, which is specified in /etc/default/grub). Rather, it's the UUID of the LUKS filesystem inside of it. Which, of course, can't be found, because it's encrypted!

I'm not sure why GRUB (or has the kernel taken over at this point?) is looking for the wrong device here. My generated grub.cfg also has a ton of references to the LUKS UUID rather than the partition UUID that I specified in the config.

Any advice would be appreciated! Let me know if there's more info that would be helpful.

Last edited by vlad_ilyich (2019-06-26 16:39:39)

Offline

#2 2019-06-26 08:28:56

nl6720
The Evil Wiki Admin
Registered: 2016-07-02
Posts: 714

Re: [SOLVED]Device not found when attempting to boot to new LUKS partition

This is long past GRUB, it's in the initramfs stage.
Did you perhaps forgot to update /etc/fstab with the new values?

Offline

#3 2019-06-26 14:49:20

JeanLucJ
Member
Registered: 2019-03-08
Posts: 59

Re: [SOLVED]Device not found when attempting to boot to new LUKS partition

Hello,

Could you please provide your :
* /etc/mkinitcpio.conf
* /etc/default/grub
* output of 'lsblk -f'

And also the *exact* commands and outputs you have when you generate your initramfs & grub.cfg

It seems that almost all problems on this subjects boils down to a mistake in those files and commands.

Offline

#4 2019-06-26 15:16:02

vlad_ilyich
Member
Registered: 2019-06-25
Posts: 5

Re: [SOLVED]Device not found when attempting to boot to new LUKS partition

I appreciate the help! Just ran genfstab from the install media to get a fresh fstab, and regenerated initramfs and /boot/grub/grub.cfg for good measure. Still the same error.

Here's my disk layout, fstab, grub config and mkinitcpio.conf for reference:
https://pastebin.com/tiEr9EVv

EDIT: Just saw your post, JeanLucJ. Give me a sec to get that stuff together...

Last edited by vlad_ilyich (2019-06-26 15:17:07)

Offline

#5 2019-06-26 15:26:28

JeanLucJ
Member
Registered: 2019-03-08
Posts: 59

Re: [SOLVED]Device not found when attempting to boot to new LUKS partition

Try the following hook order :
HOOKS=(base udev autodetect keyboard modconf block encrypt filesystems  fsck)

I'm not sure it's the problem, though.

Last edited by JeanLucJ (2019-06-26 15:30:18)

Offline

#6 2019-06-26 15:58:34

vlad_ilyich
Member
Registered: 2019-06-25
Posts: 5

Re: [SOLVED]Device not found when attempting to boot to new LUKS partition

JeanLucJ wrote:

And also the *exact* commands and outputs you have when you generate your initramfs & grub.cfg

Here's a recording of my session when generating these two files that I grabbed with `screen`:
https://pastebin.com/kX6ayiVH

Offline

#7 2019-06-26 16:13:35

vlad_ilyich
Member
Registered: 2019-06-25
Posts: 5

Re: [SOLVED]Device not found when attempting to boot to new LUKS partition

JeanLucJ wrote:

Try the following hook order :
HOOKS=(base udev autodetect keyboard modconf block encrypt filesystems  fsck)

I'm not sure it's the problem, though.

This didn't do it, which is maybe a good thing because I was going to lose my mind if it did wink

Offline

#8 2019-06-26 16:21:12

nl6720
The Evil Wiki Admin
Registered: 2016-07-02
Posts: 714

Re: [SOLVED]Device not found when attempting to boot to new LUKS partition

Your /etc/default/grub is wrong. The cryptdevice parameter must be placed in GRUB_CMDLINE_LINUX. I.e.:

GRUB_CMDLINE_LINUX="cryptdevice=UUID=362ce198-43cc-4f9a-8d37-09dc0cf0040f:cryptroot"

(The root= parameter can be omitted when using grub-mkconfig)

Offline

#9 2019-06-26 16:39:23

vlad_ilyich
Member
Registered: 2019-06-25
Posts: 5

Re: [SOLVED]Device not found when attempting to boot to new LUKS partition

nl6720 wrote:

Your /etc/default/grub is wrong. The cryptdevice parameter must be placed in GRUB_CMDLINE_LINUX. I.e.:

GRUB_CMDLINE_LINUX="cryptdevice=UUID=362ce198-43cc-4f9a-8d37-09dc0cf0040f:cryptroot"

(The root= parameter can be omitted when using grub-mkconfig)


My hero!

This isn't made clear in the "LUKS on a partition" section of the "Encrypting an entire system" article. Other sections do mention that this stuff should go inside GRUB_CMDLINE_LINUX, so I'm going to look later today at just adding a clarifying sentence to that section of the wiki.

Thanks a ton!

Offline

#10 2020-05-27 03:21:54

xunilhcra
Member
Registered: 2017-06-25
Posts: 1

Re: [SOLVED]Device not found when attempting to boot to new LUKS partition

vlad_ilyich, did you get around to editing the wiki? This caught me out today but luckily your post saved me hours of troubleshooting.

Offline

Board footer

Powered by FluxBB