6

I'm using ArchLinux, I followed their tutorial on encrypting your root filesystem:

https://wiki.archlinux.org/index.php/Using_DM-Crypt

But I cannot get grub to boot the encrypted partition.

My grub file looks like this:

root (hd0,2)
kernel /vmlinuz-linux cryptdevice=/dev/sda4:root root=/dev/mapper/root ro
initramfs /intiramfs-linux.img

I've tried editing this to everything I could think of, and everything I could find online, but nothing will boot. It always gives me this error:

ERROR: device '/dev/mapper/root' not found. Skipping fsck.
ERROR: unable to find root device '/dev/mapper/root'.

Any help would be greatly appreciated.

3
  • 2
    That doesn't look like a Grub2 configuration file, looks like plain Grub.
    – Mat
    Jul 8, 2012 at 15:36
  • 1
    This isn't a grub issue per se; it is your initramfs that does not seem to understand how to open the encrypted volume.
    – psusi
    Jul 9, 2012 at 0:44
  • Did you add the "encrypt" hook to /etc/mkinitcpio.conf and rebuilt your initramfs?
    – Wieland
    Jul 9, 2012 at 16:24

1 Answer 1

2

As Wieland said, you must inform a ramfs image to decrypt the root partition.

Which means to add the encrypt hook to /etc/mkinitcpio.conf before filesystems hook by changing this line (this should be default setting in vanilla Arch installation):

HOOKS="base udev autodetect modconf block filesystems keyboard fsck"

to this:

HOOKS="base udev autodetect modconf block encrypt filesystems keyboard fsck"

(For more details, see: https://wiki.archlinux.org/index.php/Dm-crypt/Encrypting_an_entire_system#Configuring_mkinitcpio)

And then recompile ramfs image with following command (in arch-chroot with /boot mounted):

# mkinitcpio -p linux

(Again, for more details, see: https://wiki.archlinux.org/index.php/mkinitcpio#Image_creation_and_activation)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .