Talk:HOWTO Install Gentoo on an LVM2 root partition
From Gentoo Linux Wiki
Contents |
[edit] Missing files
The shell script and static binaries seem to be unavailable right now... Is there someplace else I could download them? I need them so that I can, well, reboot after installing gentoo. Afterwards, if I get a webserver running properly, I'd be happy to host the files myself.
Miles Strombach, gentoo@4915.net
- I had a copy of the shell script/static binary laying around, so, I mirrored them and I updated the link in the tutorial. Hope this helps :-)
Nick Devito, ndevito@atarack.com
[edit] Problems when booting II.
Hello all,
I have gone all the steps in setting up LVM2 as mentioned in HOWTO Install Gentoo on an LVM2 root partition#The Second Easiest Way:
- I have enabled LVM in the kernel together with device-mapper:
| File: kernel settings |
|
Device Drivers ---> Multi-device support (RAID and LVM) ---> [*] Multiple devices driver support (RAID and LVM) < > RAID support <*> Device mapper support |
- I have compiled Device-mapper statically in to the kernel:
USE="static" emerge device-mapper
- I have enabled ramdisk and initial ramdisk support - I have modified the lvm.conf in following way to avoid scanning all devices:
filter = [ "a|^/dev/hda[12]|", "a|^/dev/vg01$|", "r/.*/" ]
- I have edited lvm2create_initrd so as to set its size (to 8192kB) and I have created initrd with it:
sh ./lvm2create_initrd -c /etc/lvm/lvm.conf 2.6.11-gentoo-r3
| File: /etc/fstab |
/dev/hda1 /boot ext2 noauto,noatime 1 2 /dev/hda2 none swap sw 0 0 /dev/mapper/vg01-lvol1 / xfs noatime 0 1 /dev/mapper/vg01-lvol2 /home xfs noatime 0 0 none /proc proc defaults 0 0 none /dev/shm tmpfs nodev,nosuid,noexec 0 0 |
| File: /boot/grub/grub.conf |
title Gentoo with LVM
kernel /boot/kernel-lvm2-2.6.11-gentoo-r3 root=/dev/ram0 lvm2root=/dev/vg01/lvol1 video=vesafb:ywrap,mtrr,1024x768-16@85 splash=silent,theme:emergence
initrd /boot/initrd-lvm2-2.6.11-gentoo-r3.gz
|
Unfortunatelly when booting, the corresponding logical volumes are not found - the system prompts with lvm2rescue but there is no command to rescue lvm2.
Could you please help?
Dusan, dusankm@yahoo.com
--218.111.121.81 03:23, 24 October 2007 (UTC) IMO, your lvm2root should be lvm2root=/dev/mapper/vg01-lvol1
[edit] Problems when booting I
It took a while but I figured out lilo (I think). It would be helpful to supply examples of both lilo and grub.
Nevertheless, I am still having problems getting my lvm root partition to boot. I have the device-mapper compiled into the kernel (not as a module) but I still get an error message that /dev/sys/root is not a valid root partition. Once I drop into a shell and type:
lvm vgscan lvm vgchange -ay
then exit back to the program and type
/dev/sys/root
then it works. I installed initrd with the following command:
genkernel initrd --lvm2
and I can get it to work with the 2.6 kernel (2.6.10-r4) but not the 2.4 kernel (2.4.28-r5). The 2.4 kernel gives a bizarre error message as it gives a reiserfs error message for the root partition... yet I have no partitions that use reiserfs. All of the lvm partitions use ext3.
A few things I noticed when dropped to a shell was that I had to type
lvm vgscan
instead of just
vgscan
I don't know why but that worked.
Did you remember to add the lines to /etc/init.d/localmount - you need to put stuff in there for the volume group to be initialized. You need to type "lvm vgscan" as "vgscan", "pvcreate", etc, are all just symlinks to the lvm binary. These symlinks are created in the initrd, so you have to give the name of the action as an argument to lvm.
I added a section on using lvm2create_initrd to make the initrd -- let me know what you think.
[edit] Good Work!
Thanks guys for working on my article, everything looks good. If anybody is interested, I can add a 2.4.x series kernel section and redo the cowboy way to a more sane system. Talk back if anyone is interested. Oh btw, I changed my setup so I no longer have root on lvm2, it was getting to be a pain to upgrade kernels.
- I found this page very useful as well as I upgraded my system to use LVM2, including on the root partition. In particular, I used "The Second Easiest Way" of using the LVM2 script lvm2create_initrd to create the initrd image. Looking inside the generated initrd image, I see nothing that ties it to the kernel or really even to my system in particular. I expect when I upgrade my kernel next that I will not need to update the initrd image.
[edit] Something i don't understand
Why does USE="static" and CC="static" break the current installed Versions of the packages? I mean, there are different installed versions then, static ones, but they should just work the same way the others did.
[edit] 3 Correct "root (hd0,4)" in section 4.1?
In 4.1 The Easiest Way , it is written:
root (hd0,4)
Does that match the /etc/fstab from section 3.1? There, it is written:
/dev/hda1 /boot ext2 noauto,noatime 0 0
Shouldn't that be "root (hd0,0)" in 4.1?
I'll change it this way - undo that change, if you think I'm wrong.
[edit] Removed wikify
I removed the wikify as it looks to me properly formatted. Infirit 19:16, 10 December 2006 (UTC)infirit
[edit] Why wikify - a nit-pick
I'm not 100% sure what "wikify" means... Regardless, imo, there is a problem with this HOWTO's markup: the hierarchical structure does not reflect the hierarchy of ideas in the HOWTO.
Specifically, TOC item 4.1.1, "Adding RAID with genkernel", effectively starts a new "sub-HOWTO" in which several alternatives are proposed for booting an md → lvm2 → root-fs system. This tangent continues through several layers of organization (some "pushes" and some "pops," if you get my drift) and clearly ends with TOC item 4.3.1, where the more general, non-md-related HOWTO content resumes.
Presumably this is just a consequence of incremental editing (and genkernel regression).
I'd fix this myself but (a) I'm lazy and (b) I don't want to step on anyone's toes.... mostly (a), I guess. Should I just ignore (b) and "go for it"? I'd propose making the above-indicated sections their own "== blah =="-level chapter.
Rice - 20 June 2007
