"not a valid root device" on boot, grub crypt lvm [Solved]

If you are new to Linux or new to Sabayon Linux and just not sure where to post, here ya go. Post without fear of being told to RTFM :-)

Moderator: Moderators

"not a valid root device" on boot, grub crypt lvm [Solved]

Postby catinthebox » Sat Feb 02, 2013 6:44

Today I go to boot my shit and I get some not a valid root device error with red exclamation marks. Now I've dealt with this before and forgot what I did so I thought I'd post this here incase an upgrade caused this and people need help (I havent checked any logs to know if GRUB was updated or anything).

Anyways, I have three partitions, the boot is unencrypted and the root is LVM and encrypted, so I've had to deal with adding kernel boot parameters previously. The code below is my /boot/grub/grub.cfg that I fixed with a backup (which solved the issue). The code is to show you the area i nthe file you want

You're basically pointing GRUB to the /dev/sd* and telling it its an encrypted root partition and then telling it where the real root is for when it can read the data and its been unencrypted. Now this line
Code: Select all
 root=/dev/mapper/vg-root
isnt going to be the same for you, because you probably named your volume group differently, if you used the auto installer they have unruly retarded names probably located in your fstab file. I left the UUID for the 'crypt_root=' line cause it was already there and works but you would try pointing it directly to the partition located and deduced via
Code: Select all
sudo fdisk -l


Anyways dont waste your time using vgchange -a y to activate the inactive group, it doesnt stick after booting again, and dont add lvmwait= commands because i didnt and it works without it, these are the things i came across on da net and it was difficult to figure out with a bunch of bullshit.

If you need to copy over a grub and need to mount the volume fro ma live cd environment instead of just booting and pressing 'e' on the OS choice screen and editing the grub there (which doesnt write to the file so you have to do it once you boot again) SO to mount this shit you get into your live cd and then run al lthis shit
Code: Select all
#We are gonna mount the boot partition
mkdir /mnt/boot
mount /dev/sda1 /mnt/boot(whatever your boot partition is, its the one with the * when you sudo fdisk -l)
nano /mnt/boot/grub.cfg (probably have to sudo for most most of this)

#Now we gonna mount your root that wouldnt mount because thats where you idiotically saved your grub.cfg backup instead of saving it to the grub folder in /boot
cryptsetup luksOpen /dev/sd* crypt-root
mkdir /crypt
#not sure if this will work in order, you might need to use vgchange -ay first, anyways heres some useful commands!
mount /dev/mapper/crypt-root /crypt/crypt-root
vgchange -a y (should activate volume groups, use lvchange -ay if you want specific volumes
vgscan (or vgdisplay) (will tell you what the volume group is called)
lvdisplay (shows the volume names)


ALSO i just figured out that /etc/default/sabayon-grub is gonna need to be edited to stop grub.cfg from being overwritten retardedly all day, atleast i think... this is untested ive make the kernel line switch but who knows if this is gonna work lol... i ran grub-mkconfig and grub2mkconfig and it the grub.cfg still has the stuff in it but when i deleted the file mkconfig didnt create it ... oh well we'll find out the hard way? if anyone knows how to test this please let me know

Anyways, I thought I'd post this incase someone else has an issue.

Code: Select all
### BEGIN /etc/grub.d/10_linux ###
menuentry 'Sabayon GNU/Linux' --class sabayon --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-9158c5c7-4ba4-4d49-9a7e-0fc40dbd37a7' {
   load_video
   insmod gzio
   insmod part_msdos
   insmod ext2
   set root='hd0,msdos2'
   if [ x$feature_platform_search_hint = xy ]; then
     search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos2 --hint-efi=hd0,msdos2 --hint-baremetal=ahci0,msdos2  d78c1cf8-70c2-4dff-91d9-8b9272ea7ce1
   else
     search --no-floppy --fs-uuid --set=root d78c1cf8-70c2-4dff-91d9-8b9272ea7ce1
   fi
   echo   'Loading Linux x86-3.5.0-sabayon ...'
   linux   /kernel-genkernel-x86-3.5.0-sabayon ro  init=/linuxrc splash=verbose,theme:sabayon video=vesafb:ywrap,mtrr:3 vga=791 gfxpayload=1024x768x16 console=tty1 quiet dokeymap keymap=us domdadm resume=swap:UUID=5a8b4274-29c3-46b5-bd71-e4b674211459 real_resume=UUID=5a8b4274-29c3-46b5-bd71-e4b674211459 dolvm root=/dev/mapper/vg-root crypt_root=UUID=d9180b76-b3fe-41cb-87d9-f5bbea2abd69 docrypt
catinthebox
Baby Hen
 
Posts: 18
Joined: Tue Jul 10, 2007 10:13

Return to Beginners|Newbies Area

Who is online

Users browsing this forum: No registered users and 2 guests