LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Gentoo
User Name
Password
Gentoo This forum is for the discussion of Gentoo Linux.

Notices

Reply
 
Search this Thread
Old 08-07-2009, 05:06 PM   #1
CoderMan
Member
 
Registered: Jan 2009
Location: Gemini Capsule 25164
Distribution: Gentoo
Posts: 375
Blog Entries: 24

Rep: Reputation: 43
Unhappy root on lvm on dm-crypt


Hi. I am a fairly new gentoo user, and building a system on my laptop using the root filesystem layered on top of lvm layered on top of dm-crypt encryption. I know that sounds a little difficult for a new user, but I am not willing to use gentoo if I can not set that up.

There are two partitions on my system:
/dev/hda1 xfs /boot
/dev/hda2 dm-encrypted partition

I encrypted /dev/hda2 with dm-crypt, and then created volume group 'vg' on top of that. Boot files go into /boot on /dev/hda1, and all system files are on the logical volume 'system'.

I compiled and installed my kernel with using genkernel and with --luks and --lvm support, and had all needed-components statically compiled in, and installed grub.

However, I can not get successful boot into the new system. I can manually boot into it using the install cd + cryptsetup + mounting everything myself, but I can't do it with just Grub.

I keep trying recommended menu.lst entries provided by pages all over the Internet, but only this one comes close to working:

Code:
title Gentoo Kernel
root (hd0,0)
kernel /boot/kernel-genkernel-x86-2.6.30-gentoo-r4 crypt_root=/dev/hda2 real_root=/dev/mapper/vg-system
initrd /boot/initramfs-genkernel-x86-2.6.30-gentoo-r4
When I boot, this entry will ask for my passphrase and decrypt /dev/hda2, but then it says it cannot find /dev/mapper/vg-system.

As far as I can tell, it seems that I am missing some parameter or something that causes the kernel to detect the volume group. (Like I would get when I run vgchange -ay). I dropped to shell and /dev/mapper/root is there but no /dev/mapper/vg-*, which seems to confirm this.

Does anyone know how I would modify this so it works?
 
Old 08-07-2009, 08:54 PM   #2
CoderMan
Member
 
Registered: Jan 2009
Location: Gemini Capsule 25164
Distribution: Gentoo
Posts: 375
Blog Entries: 24

Original Poster
Rep: Reputation: 43
Cool Solved!!!

After dropping to the ash shell, and reading the init file in the initramfs image for 20 minutes, I found out that there is a parameter called 'dolvm'. Passing that in to the kernel causes it to run vgchange after Luks but before mounting the lvm.

So the modified entry:

Code:
title Gentoo Kernel
root (hd0,0)
kernel /boot/kernel-genkernel-x86-2.6.30-gentoo-r4 crypt_root=/dev/hda2 dolvm real_root=/dev/mapper/vg-system
initrd /boot/initramfs-genkernel-x86-2.6.30-gentoo-r4
Side note: When I dropped to the ash shell inside the initramfs, I couldn't find a text editor. Is there one in there?

Last edited by CoderMan; 08-11-2009 at 06:50 PM. Reason: typo in the example code
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Debian Lenny dm-crypt LVM Frozen w33k Linux - Software 1 06-26-2009 10:52 AM
root on LVM maxy7710 Linux - Newbie 4 05-13-2009 05:11 AM
Root on lvm serge Linux - Server 2 02-09-2009 03:15 PM
LVM and dm-crypt -- best way to encrypt a logical volume? nyle Linux - Newbie 4 01-31-2009 02:53 PM
Encrypted Root Filesystem (dm-crypt/loopAES +ext3fs) - Problem dragoncity99 Slackware 6 08-01-2005 01:14 AM


All times are GMT -5. The time now is 06:34 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration