Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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.

share|improve this question
1  
That doesn't look like a Grub2 configuration file, looks like plain Grub. –  Mat Jul 8 '12 at 15:36
    
Ah, my mistake, thank you. –  Jake Jul 8 '12 at 16:15
    
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 '12 at 0:44
    
Did you add the "encrypt" hook to /etc/mkinitcpio.conf and rebuilt your initramfs? –  Wieland Jul 9 '12 at 16:24

1 Answer 1

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)

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.