On 06/11/2019 16:16, Christopher Gregory via blfs-support wrote:
Sent: Wednesday, November 06, 2019 at 11:11 AM
From: "Pierre Labastie via blfs-support"
<[email protected]>
To: [email protected]
Cc: "Pierre Labastie" <[email protected]>
Subject: Re: [blfs-support] Best approach for lvm2
Le 05/11/2019 à 19:54, Christopher Gregory via blfs-support a écrit :
<< [...]
Hello Pierre,
The nightmare continues. I have now installed debian buster and it detected
the lfs installation the same way fedora does with os-prober:
menuentry 'Linux From Scratch (20191025-systemd) (on /dev/mapper/rootvg-root)'
--class linuxfromscratch --class gnu-linux --class gnu --class os
$menuentry_id_option
'osprober-gnulinux-simple-4155330c-5db1-4113-834f-afefb2d2570e' {
insmod lvm
insmod part_gpt
insmod ext2
set root='lvm/rootvg-root'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2
--hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2
099738b6-ac51-455f-9d60-fac5d900ba8b
else
search --no-floppy --fs-uuid --set=root
099738b6-ac51-455f-9d60-fac5d900ba8b
fi
linux /vmlinuz-5.3.6-lfs-20191025-systemd root=/dev/mapper/rootvg-root
initrd /initrd.img-no-kmods
I added insmod lvm and changed the set root= line. This gives me again, the
initrd shell with the error that the device that was suppose to contain the
root file system does not exist. For some reason it is proving impossible for
me to get it to work. I have no idea why.
Regards,
Christopher.
Well, not sure. Try removing the lines from "if" to "fi" (it may set root to
something else I am not sure about), and insert /boot before /vmlinuz and
/initrd.img.
Pierre
--
http://lists.linuxfromscratch.org/listinfo/blfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page
Hello Pierre,
I have made some progress in this nightmare. I have found a few things:
1) The initramfs script that is in the book is a bit too simplistic for
actually being able to fix anything with regards to lvm. It needs to have the
lvm tools actually added to it. lvm is needed, as vgscan and a few of the
other tools are needed and are indeed missing. It needs the more command
added, as you are unable to read all the screen contents if you use ls.
2) The reason that it complains about the device not existing, is because it
really does not. In /dev/mapper from within the intiramfs shell, there is only
control there, none of the rootvg-root swap home entries are present. These
are simlinks to dm-6 etc that are actually the images of the created devices.
From extensive research, other distros such as ubuntu have encountered the
exact same issue after they have upgraded lvm2. They have narrowed it down to
an issue with vgscan itself. The tools are needed to investigate it further.
I am going to add those tools and attempt the work around so that I can perhaps
solve it myself and provide the information, so that it could be added to the
book.
3) In order to solve the linux image not found issue, after a lot of messing
around in the shell, and based on the ubuntu work arounds, I have had to add
(hd0,msdos1) in front of both the vmlinuz line and initrd lines. I am about to
do another test, now that I have found them and set
root=/dev/mapper/rootvg-root on the vmlinuz line and see if that fixes it, as
they said in that ubuntu thread that this is needed to actually activate the vg
images.
Ah sorry, things which look obvious to me (not because I am smart, but
because I have been using that for ages) may not be obvious to others...
If you want lvm support in the initramfs, you need lvm2 accessible from
where you generate the initramfs!
Note that it is not vgscan, which adds the symllinks , but "vgchange -a
y", which is in the initramfs init code.
There are several places in mkinitramfs where "if [ -x /sbin/lvm ]" is
tested. If it is not there, no lvm support...
Actually, there is some misleading text: "The scripts will allow
specifying a rootfs via partition UUID or partition LABEL or a rootfs on
an LVM logical volume". But it does not tell that installing lvm is
needed for that. I think I should add some precision (after "Required
runtime dependency").
Pierre
--
http://lists.linuxfromscratch.org/listinfo/blfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page