Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] rootfs on a logical volume - kernel hangs
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
AaylaSecura
Tux's lil' helper
Tux's lil' helper


Joined: 09 Jun 2011
Posts: 122

PostPosted: Wed Jun 25, 2014 11:39 pm    Post subject: [SOLVED] rootfs on a logical volume - kernel hangs Reply with quote

Greetings! I decided to transition to LVM2, so as a start I created a logical group for my gentoo installation alone with three separate logical volumes - for /, /home and /usr/local. It all went fine, I mounted them and I copied my root filesystem (currently all of it is on a single partition) onto them using rsync. No problems so far, I am able to mount them automatically at boot by adding lvm to the boot runlevel.
I continued on to building an initramfs (I currently do not use one) using dracut - I added only a basic set of modules (including lvm) and tried booting with it from my current rootfs (that is not on a logical volume) - it booted fine, so I went ahead and tried to boot from the root copy on the logical volumes. I edited /etc/fstab accordingly:
from currently:
Code:

/dev/sda2                     /                       xfs             defaults,noatime                                        0 1

to:
Code:

/dev/mapper/gentoo-root         /                       ext4            defaults,noatime                                        0 1
/dev/mapper/gentoo-home         /home                   ext4            defaults,noatime                                        0 2
/dev/mapper/gentoo-usrlocal     /usr/local              ext4            defaults,noatime                                        0 2


I needed to update the root UUID in the grub configuration to point to /dev/mapper/gentoo-root rather than /dev/sda2. I chrooted in the root that's on the logical volume, recreated the initram image (just in case it holds information about the root device), reinstalled GRUB2 and regenerated grub.cfg. I double checked that everything now points to /dev/mapper/gentoo-root and rebooted. It booted the initramfs and started loading the kernel but it just hanged at some point (no error, nothing special - it had just detected some USB devices). I am lost at this point...

P.S. I'm running linux-3.12.21-r1-gentoo x86_64. I have Device mapper support and initramfs/initrd support built into it.
My kernel config is here, the menuentry in grub.cfg is here
The dracut modules I've included in the initram image are: bash, kernel-modules, lvm, rootfs-block, udev-rules, syslog, base, fs-lib, img-lib, shutdown


Last edited by AaylaSecura on Thu Jun 26, 2014 9:02 pm; edited 1 time in total
Back to top
View user's profile Send private message
AaylaSecura
Tux's lil' helper
Tux's lil' helper


Joined: 09 Jun 2011
Posts: 122

PostPosted: Thu Jun 26, 2014 6:53 pm    Post subject: Reply with quote

Bump - I solved some of the problems I had, namely specifying the root UUID in the kernel command line - I had forgotten I have to do all of this while being chrooted into the root on the logical volume. Now dracut reported the correct root device and after reinstalling GRUB2 from within the chroot, it now pointed to /boot that's on the logical volume).

But the kernel still hangs during boot - which leads me to believe I have missed some essential module.
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


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

PostPosted: Thu Jun 26, 2014 7:08 pm    Post subject: Reply with quote

AaylaSecura ...

are you set on using dracut? If you just want this to work I can suggest a (possibly) better-initramfs.

best ... khay
Back to top
View user's profile Send private message
AaylaSecura
Tux's lil' helper
Tux's lil' helper


Joined: 09 Jun 2011
Posts: 122

PostPosted: Thu Jun 26, 2014 9:02 pm    Post subject: Reply with quote

khayyam wrote:
AaylaSecura ...

are you set on using dracut? If you just want this to work I can suggest a (possibly) better-initramfs.

best ... khay


Many thanks, khay - that indeed fixed whatever was wrong. I guess dracut was missing modules and/or external tools. better-initramfs worked, but our of curiosity I also installed and tried genkernel and that worked as well.
Thanks once again!
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


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

PostPosted: Fri Jun 27, 2014 12:20 am    Post subject: Reply with quote

AaylaSecura wrote:
Many thanks, khay - that indeed fixed whatever was wrong. I guess dracut was missing modules and/or external tools. better-initramfs worked, but our of curiosity I also installed and tried genkernel and that worked as well. Thanks once again!

AaylaSecura ... you're welcome. Note that with better-initramfs you won't need to build lvm2 (and other packages) with the static useflag, and you won't need to rebuild on kernel updates (as no modules are involved). Also, lvm can be removed from the runlevel (as its setup at the initramfs stage) ... it wasn't clear from the above if you'd removed this subsequent to using an initramfs so I thought it worth mentioning.

best ... khay
Back to top
View user's profile Send private message
AaylaSecura
Tux's lil' helper
Tux's lil' helper


Joined: 09 Jun 2011
Posts: 122

PostPosted: Fri Jun 27, 2014 8:54 am    Post subject: Reply with quote

khayyam wrote:
AaylaSecura wrote:
Many thanks, khay - that indeed fixed whatever was wrong. I guess dracut was missing modules and/or external tools. better-initramfs worked, but our of curiosity I also installed and tried genkernel and that worked as well. Thanks once again!

AaylaSecura ... you're welcome. Note that with better-initramfs you won't need to build lvm2 (and other packages) with the static useflag, and you won't need to rebuild on kernel updates (as no modules are involved). Also, lvm can be removed from the runlevel (as its setup at the initramfs stage) ... it wasn't clear from the above if you'd removed this subsequent to using an initramfs so I thought it worth mentioning.

best ... khay


Hi, khay - yes, I did remove lvm from the boot level as I figured it's not needed (and it even displayed an error on shutdown because it was trying to deactivate the root volume and it clearly couldn't). I hadn't built lvm2 with the static USE flag either way - it still worked under both better-initramfs and genkernel. In any case, thank you for the info!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware 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