Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Grub, lvm and luks problems
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
pantyraffle
n00b
n00b


Joined: 03 May 2017
Posts: 1

PostPosted: Wed May 03, 2017 5:33 pm    Post subject: Grub, lvm and luks problems Reply with quote

I'm a gentoo newbie and trying to do my first install. I've followed the guide except when setting up the disks. My problem is that I don't know how to set up grub to decrypt the third partition and mount the lvm. I am booting in bios mode. This is what my laptop's (thinkpad t420) disk looks like

Code:
Partition Table: gpt
Disk Flags:

Number  Start   End     Size    File system  Name  Flags
 1      1049kB  3146kB  2097kB               grub  bios_grub
 2      3146kB  137MB   134MB   ext2         boot
 3      137MB   320GB   320GB                root

root@sysresccd /root % lsblk
NAME          MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINT
sr0            11:0    1  1024M  0 rom
loop0           7:0    0 390.3M  1 loop  /livemnt/squashfs
sda             8:0    0 298.1G  0 disk
├─sda2          8:2    0   128M  0 part
├─sda3          8:3    0   298G  0 part
│ └─gentoo    253:0    0   298G  0 crypt
│   ├─vg-swap 253:1    0    12G  0 lvm
│   ├─vg-root 253:2    0    50G  0 lvm
│   └─vg-home 253:3    0   236G  0 lvm
└─sda1          8:1    0     2M  0 part
sr1            11:1    1 462.6M  0 rom   /livemnt/boot


sda1 is the 2mb partition the handbook told me to make
sda2 is the boot partition
sda3 is everything else encrypted

I just set up the disks like they were in my old debian install. I've tried setting up /etc/default/grub, running grub-mkconfig, grub-install, but clearly my /etc/default/grub is clearly a load of rubbish, I've tried adding things from google searches but I'm making no progress.

Code:
grub-install --target i386-pc /dev/sda
genkernel --luks --lvm initramfs

/etc/default/grub contents, I am 100% sure I need to add more stuff, but what?
Code:
GRUB_PRELOAD_MODULES="luks cryptodisk"
GRUB_COMDLINE_LINUX_DEFAULT="dolvm"
GRUB_CMDLINE_LINUX="cryptdevice=/dev/sda3 ro root=/dev/mapper/vg-root"

Code:
grub-mkconfig -o /boot/grub/grub.cfg


When I reboot, I get to the bootloader, I am told /dev/mapper/gentoo is not a valid root device before I get to enter the decryption password. Grub seems to be trying to look for vg-root before decrypting. What should I do?
Back to top
View user's profile Send private message
quilosaq
Veteran
Veteran


Joined: 22 Dec 2009
Posts: 1329

PostPosted: Thu May 04, 2017 12:48 am    Post subject: Reply with quote

If you are working with dm-crypt and openrc, you must setup a
Code:
/etc/conf.d/dmcrypt
file.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo 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