Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
/dev/mapper/vg0-root is an invalid root device
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
wichtounet
Tux's lil' helper
Tux's lil' helper


Joined: 17 Mar 2012
Posts: 116

PostPosted: Fri Oct 10, 2014 9:32 am    Post subject: /dev/mapper/vg0-root is an invalid root device Reply with quote

Hi,

I have trouble installing Gentoo on a virtual machine (VMware player), with LVM,sytemd and Grub2. I performed this installation several times without any problem on other machines, I have never seen this error message.

When I boot, I got this message:

!! /dev/mapper/vg0-root is an invalid root device
!! Please file a bug report with this message

I tried genkernel-next-55 and genkernel-next-58 with the same effect. I checked genkernel-next code and it is generated because ${REAL_ROOT} is not a block device, although I don't know why. I tried configuring grub2 on /dev/dm-0, but the problem is the same. I also tried with root=/dev/ram0 and real_root=/dev/mapper/vg0-root, but again with no success.

The initramfs was generated with:

genkernel --lvm --udev --install initramfs

I don't see anything else when it boots, but perhaps I'm missing a message.

I can provide more information, but I don't really know what is relevant to this bug. Just tell me what to include and I'd be glad to provide any information.

Thanks

P.S. I've filled a bug with this problem since it was indicated by the error message (https://bugs.gentoo.org/show_bug.cgi?id=524938)


Last edited by wichtounet on Fri Oct 10, 2014 10:18 am; edited 1 time in total
Back to top
View user's profile Send private message
fpemud
Apprentice
Apprentice


Joined: 15 Feb 2012
Posts: 276

PostPosted: Fri Oct 10, 2014 9:52 am    Post subject: Reply with quote

1.
what's the USE flag of grub on your system?
grub needs to have the device-mapper USE flag to recognize LVM partition.

2.
You must add "dolvm" in the kernel command line, or else genkernel's initramfs won't probe LVM partitions.

3.
!! /dev/mapper/vgo-root is an invalid root device
Is there a typo? "vgo" or "vg0"?
Back to top
View user's profile Send private message
wichtounet
Tux's lil' helper
Tux's lil' helper


Joined: 17 Mar 2012
Posts: 116

PostPosted: Fri Oct 10, 2014 10:21 am    Post subject: Reply with quote

Hi :)

fpemud wrote:
1. what's the USE flag of grub on your system?
grub needs to have the device-mapper USE flag to recognize LVM partition.


grub has been installed with USE="device-mapper multislot nls"

fpemud wrote:
2. You must add "dolvm" in the kernel command line, or else genkernel's initramfs won't probe LVM partitions.


I did add it to Grub default config and I see it in grub.cfg

fpemud wrote:
3.!! /dev/mapper/vgo-root is an invalid root device
Is there a typo? "vgo" or "vg0"?


That's a typo, sorry, it is vg0.
Back to top
View user's profile Send private message
Roman_Gruber
Advocate
Advocate


Joined: 03 Oct 2006
Posts: 3806
Location: Austro Bavaria

PostPosted: Fri Oct 10, 2014 12:32 pm    Post subject: Reply with quote

You may post your grub.cfg section which starts with title for the entry which you use.

you need an initramfs, best generated from genkernel or genkernel-next. you need all hardware drivers in kernel.
you need an ordinary boot partition, preferred ext2.

That should do the trick.
Back to top
View user's profile Send private message
wichtounet
Tux's lil' helper
Tux's lil' helper


Joined: 17 Mar 2012
Posts: 116

PostPosted: Fri Oct 10, 2014 2:40 pm    Post subject: Reply with quote

tw04l124 wrote:
You may post your grub.cfg section which starts with title for the entry which you use.


I'll do that on monday when I'm back at work.

tw04l124 wrote:
you need an initramfs, best generated from genkernel or genkernel-next. you need all hardware drivers in kernel.
you need an ordinary boot partition, preferred ext2.


I have all that, except that I don't have a boot partition and that the root is a ext4 partition.
Back to top
View user's profile Send private message
Matthew Nowak
n00b
n00b


Joined: 07 Dec 2014
Posts: 1

PostPosted: Sun Dec 07, 2014 1:23 pm    Post subject: Reply with quote

I have very similar problem with my new Gentoo installation
(VMware Player 7 on top of Windows Technical Preview 64-bit, Intel Pentium G3258)

It looks like GRUB is trying to mount one of my logical volumes, but it isn't asking me for password before! I have only kernel panic with information that "/dev/mapper/lvgcrypt-rootfs is an invalid root device"

Here is my complete installation commands list:

Code:
fdisk /dev/sda
n ENTER ENTER ENTER +1G n e ENTER ENTER ENTER n l ENTER ENTER a 1 w
   # On 50 GB virtual disk, I have created (1GB primary sda1) and (49GB logical sda5)

cryptsetup luksFormat /dev/sda5
cryptsetup luksOpen /dev/sda5 sda5_crypt
pvcreate /dev/mapper/sda5_crypt
vgcreate lvgcrypt /dev/mapper/sda5_crypt
vgdisplay
lvcreate --size 45G --name rootfs lvgcrypt
lvcreate --size 4G --name swapfs lvgcrypt
vgchange --available y

mkfs.ext4 /dev/sda1
mkfs.ext4 /dev/mapper/lvgcrypt-rootfs
mkswap /dev/mapper/lvgcrypt-swapfs

mkdir /000
mount /dev/mapper/lvgcrypt-rootfs /000
mkdir /000/boot
mount /dev/sda1 /000/boot
swapon /dev/mapper/lvgcrypt-swapfs
cd /000
   # changing directory will make installation easier

links gentoo.org
   # Download -> amd64 multilib hardened stage3
time tar -xvpjf stage3*
rm -rf stage3*

echo 'MAKEOPTS="-j3 -l2"' >> etc/portage/make.conf
echo 'ACCEPT_KEYWORDS="amd64"' >> etc/portage/make.conf
mirrorselect -i -o >> etc/portage/make.conf
mirrorselect -i -o -r >> etc/portage/make.conf

cp /etc/resolv.conf etc/resolv.conf
for i in proc sys dev dev/pts; do mount --rbind /$i $i; done
chroot . /bin/bash

# Now we are in chrooted environment
source /etc/profile
export PS1="! $PS1"

time emerge-webrsync
time emerge --sync
time emerge --oneshot portage

echo "Europe/Warsaw" > /etc/timezone
time emerge timezone-data
for i in en_US en_GB pl_PL; do echo "${i}.UTF-8 UTF-8" >> /etc/locale.gen; done
locale-gen
eselect locale list
eselect locale set 5
exit

# Restarting chroot environment

source /etc/profile
export PS1="! $PS1"

echo "sys-boot/grub device-mapper" >> /etc/portage/package.use
echo "sys-boot/grub:2 device-mapper" >> /etc/portage/package.use
echo "sys-kernel/genkernel-next cryptsetup gpg lvm2" >> /etc/portage/package.use

time emerge -v -D --with-bdeps=y -u -N @world
time emerge hardened-sources genkernel-next cryptsetup grub

genkernel --menuconfig --install --symlink --luks --lvm --busybox all

# Now I have :
# Edited /etc/fstab (not with UUIDs, but with redirections to /dev/mapper/...)
# Edited /etc/conf.d/hostname
# Edited /etc/conf.d/keymaps with keymap="pl"

passwd
emerge syslog-ng
rc-update add syslog-ng default

grub2-install /dev/sda
# Edited /etc/default/grub with GRUB_CMDLINE_LINUX_DEFAULT="dolvm"
grub2-mkconfig -o /boot/grub/grub.cfg
exit

reboot


Kernel panic: http://s29.postimg.org/z1yz1fv0n/Screenshot_6.png
fstab: http://s22.postimg.org/8gf312tqp/Screenshot_7.png
grub.cfg: http://s9.postimg.org/y664ftk33/Screenshot_8.png (Sorry, I was only able to take screenshot)

Maybe I'm missing some USE flags? Is there any simple solution? It is my first encrypted Gentoo installation, unencrypted Gentoo was much easier to configure ;)
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 43420
Location: 56N 3W

PostPosted: Sun Dec 07, 2014 1:32 pm    Post subject: Reply with quote

Matthew Nowak,

Welcome to Gentoo.
Your problem is "No Volume Groups Found".
That suggests that there is an issue with lvm in your initrd. Until it cas find and activate your logical volumes, it does not need your password.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6228
Location: Room 101

PostPosted: Sun Dec 07, 2014 2:37 pm    Post subject: Reply with quote

NeddySeagoon wrote:
Your problem is "No Volume Groups Found". That suggests that there is an issue with lvm in your initrd. Until it cas find and activate your logical volumes, it does not need your password.

Neddy ... I think its the other way round, the lv is within the luks volume. I agree that the problem seems to be the initramfs however.

@Matthew Nowak ... please try the following:

Download better-initramfs, unpack and place the initramfs.cpio in /boot. Edit grub.cfg to point the initramfs.cpio and add the following to 'append='.

Code:
luks enc_root=/dev/sda5 lvm root=/dev/mapper/lvgcrypt-rootfs

Reboot ... you should be prompted for the luks password, and once luksOpen'd it should activate the lv and run init.

Note that as better-initramfs doesn't contain any modules you will need to check that the kernel has support for your hardware and dm_crypt ... once in place however it doesn't need rebuilt on subsequent kernel updates.

HTH & best ... khay
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 43420
Location: 56N 3W

PostPosted: Sun Dec 07, 2014 3:37 pm    Post subject: Reply with quote

I'm interested in the solution.

I'm trying to bring up a remote server with root on LMV on raid. I don't have the luxury of KVM over IP, so I have to fix it by analysis and trial and error.
I can get KVM over IP for 50 euros/month plus 150 euro set up fee.

What I don't understand is that this is a migration from another working server. The initrd was remade using the same file list and init script as the original as the UUIDs of the raids changed.
That means that the initrd has all new binaries too.
My best guess at the moment, is something in LVM has changed.

My next steps are either console over network, or change the UUIDs of the raid sets in the original initrd, which still works on the original server.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6228
Location: Room 101

PostPosted: Sun Dec 07, 2014 3:51 pm    Post subject: Reply with quote

NeddySeagoon wrote:
I'm trying to bring up a remote server with root on LMV on raid.

Neddy ... software raid? Are you using genkernel or custom rolled? You might try with better-initramfs and use the following parameters:

Code:
rootfstype=ext4 softraid lvm root=/dev/mapper/vg-rootfs

... or whatever device name, and fs, equates to rootfs.

HTH & best ... khay
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 43420
Location: 56N 3W

PostPosted: Sun Dec 07, 2014 4:15 pm    Post subject: Reply with quote

khayyam,

Yep, software raid1 and the initrd made using a file_list file and the usr/gen_init_cpio script provided by the kernel.
Thats the same way it was made for the working server. The difference is that the working server is a year old.

i don't do initrd made using black magic. When it breaks, I need to pick up the pieces, so I need to understand whats happening.
I suppose the real way forward is to make a new initrd locally and test. My main PC uses a similar setup, at least I will have a console.
I tend to treat the initrd as firmware. Its only early userspace stuff, its not an attack vector, so its never updated.

I'm tempted to cheat and roll my own initrd using the working one as a basis but then I'll never know what the problem is.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6228
Location: Room 101

PostPosted: Sun Dec 07, 2014 7:20 pm    Post subject: Reply with quote

Neddy ... well, the sources and init are there for perusal so its not exactly a "black box" (if that's what you mean). It basically just offers a method of building the initramfs from its own bootstrap (using Rob Landley's Aboriginal Linux as the build environment). It's configurable at build time (via bootstrap/bootstrap-all.conf) so you can just build those components you need/require, and like your currently working initramfs it doesn't need rebuilt when the kernel is updated.

I thought I'd suggest it as (with software raid) it covers all your needs, including a rescue shell, rescue shell over ssh (if you so require), LVM2, etc. Its easily modified if for some reason you needed to ... but I've found it JustWorks (and with far less hassle than genkernel, mkinitcpio, etc).

best ... khay
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