Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] MD-Raid + LVM2 chroot
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
shuuraj
n00b
n00b


Joined: 13 Jan 2014
Posts: 38

PostPosted: Tue Jan 14, 2014 10:36 am    Post subject: [SOLVED] MD-Raid + LVM2 chroot Reply with quote

After installing my system and going for the first boot my root partition was not detected.
I booted the live cd, mounted the partitions which worked so far.
But when I try to open the grub config I get an error message.
I'm not at home at the moment, but I will provide you with the exact message when I'm back home.

My question for now is: How do I correctly chroot into my environment which uses LVM and MD-Raid?
The boot partition is a md raid 1.
/home is md raid 0.
And an other md raid 0 partition where my lv's like /var etc. are located.


Last edited by shuuraj on Wed Jan 29, 2014 9:37 am; edited 2 times in total
Back to top
View user's profile Send private message
Kompi
Apprentice
Apprentice


Joined: 05 Oct 2002
Posts: 252
Location: Germany

PostPosted: Thu Jan 23, 2014 12:49 pm    Post subject: Re: MD-Raid + LVM2 chroot Reply with quote

shuuraj wrote:
How do I correctly chroot into my environment which uses LVM and MD-Raid?

Basically, like you would do without LVM and MD raid. You get everything mounted to you chroot directory and then chroot into it.

With the liveCD you may have to manually detect the RAID array and LVs first. Something like this:

Code:
mdadm --assemble --scan
vgscan
vgchange -ay

Then mount everything:
Code:
# mount root & boot (plus any other volume you want to work with)
mount /dev/<ROOT> /mnt/gentoo
mount /dev/<BOOT> /mnt/gentoo/boot

# bind mount kernel pseudo fs'es
mount -o bind /dev /mnt/gentoo/dev
mount -o bind /proc /mnt/gentoo/proc
mount -o bind /sys /mnt/gentoo/sys

# and chroot into it
chroot /mnt/gentoo /bin/bash


Quote:
After installing my system and going for the first boot my root partition was not detected.

According to https://raid.wiki.kernel.org/index.php/RAID_setup#7._Misc you must create mirrored RAID boot partitions with metadata version 1.0, so that GRUB can find it. Maybe you used metadata v1.2?
Back to top
View user's profile Send private message
szatox
Advocate
Advocate


Joined: 27 Aug 2013
Posts: 3136

PostPosted: Thu Jan 23, 2014 5:31 pm    Post subject: Reply with quote

If I get you right:
you have at least those partitions:

/
/boot
/home

and when you attempted to boot, grub loaded kernel to RAM, but failed to mount /

Is it correct? There are 2 possible reasons:
1) wrong params provided to kernel
i'm using: root=/dev/ram0 ramdisk=8192 dolvm lvmraid=/dev/md2 real_root=/dev/mapper/vg0-gentoo, change values to match your setup
2) you don't have lvm support in your initramfs
genkernel --lvm --no-clean all

Quote:
According to https://raid.wiki.kernel.org/index.php/RAID_setup#7._Misc you must create mirrored RAID boot partitions with metadata version 1.0, so that GRUB can find it. Maybe you used metadata v1.2?
unlikely, AFAIR instaling grub would fail if metadata format was unsupported. - You're right, it should be 1.0 though.
Back to top
View user's profile Send private message
shuuraj
n00b
n00b


Joined: 13 Jan 2014
Posts: 38

PostPosted: Mon Jan 27, 2014 7:06 pm    Post subject: Reply with quote

Actually it worked with the uuid....
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