Re: [blfs-support] Best approach for lvm2
> Sent: Saturday, November 09, 2019 at 9:05 PM > From: "Pierre Labastie via blfs-support" > > To: "Christopher Gregory via blfs-support" > > Cc: "Pierre Labastie" > Subject: Re: [blfs-support] Best approach for lvm2 > > Hi, > > Le 09/11/2019 à 00:32, Christopher Gregory via blfs-support a écrit : > > > > > >> Sent: Thursday, November 07, 2019 at 4:54 PM > >> From: "Christopher Gregory via blfs-support" > >> > >> To: blfs-support@lists.linuxfromscratch.org > >> Cc: "Christopher Gregory" > >> Subject: Re: [blfs-support] Best approach for lvm2 > >> > >> > >> > >>> Sent: Thursday, November 07, 2019 at 7:49 AM > >>> From: "Christopher Gregory via blfs-support" > >>> > >>> To: blfs-support@lists.linuxfromscratch.org > >>> Cc: "Christopher Gregory" > >>> Subject: Re: [blfs-support] Best approach for lvm2 > >>> > >>> > >>> > >>>> Sent: Thursday, November 07, 2019 at 4:59 AM > >>>> From: "Pierre Labastie via blfs-support" > >>>> > >>>> To: blfs-support@lists.linuxfromscratch.org > >>>> Cc: "Pierre Labastie" > >>>> Subject: Re: [blfs-support] Best approach for lvm2 > >>>> > >>>> 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" > >>>>>> > >>>>>> To: blfs-support@lists.linuxfromscratch.org > >>>>>> Cc: "Pierre Labastie" > >>>>>> 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 > >>>&
Re: [blfs-support] Best approach for lvm2
Hi, Le 09/11/2019 à 00:32, Christopher Gregory via blfs-support a écrit : > > >> Sent: Thursday, November 07, 2019 at 4:54 PM >> From: "Christopher Gregory via blfs-support" >> >> To: blfs-support@lists.linuxfromscratch.org >> Cc: "Christopher Gregory" >> Subject: Re: [blfs-support] Best approach for lvm2 >> >> >> >>> Sent: Thursday, November 07, 2019 at 7:49 AM >>> From: "Christopher Gregory via blfs-support" >>> >>> To: blfs-support@lists.linuxfromscratch.org >>> Cc: "Christopher Gregory" >>> Subject: Re: [blfs-support] Best approach for lvm2 >>> >>> >>> >>>> Sent: Thursday, November 07, 2019 at 4:59 AM >>>> From: "Pierre Labastie via blfs-support" >>>> >>>> To: blfs-support@lists.linuxfromscratch.org >>>> Cc: "Pierre Labastie" >>>> Subject: Re: [blfs-support] Best approach for lvm2 >>>> >>>> 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" >>>>>> >>>>>> To: blfs-support@lists.linuxfromscratch.org >>>>>> Cc: "Pierre Labastie" >>>>>> 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 nee
Re: [blfs-support] Best approach for lvm2
> Sent: Thursday, November 07, 2019 at 4:54 PM > From: "Christopher Gregory via blfs-support" > > To: blfs-support@lists.linuxfromscratch.org > Cc: "Christopher Gregory" > Subject: Re: [blfs-support] Best approach for lvm2 > > > > > Sent: Thursday, November 07, 2019 at 7:49 AM > > From: "Christopher Gregory via blfs-support" > > > > To: blfs-support@lists.linuxfromscratch.org > > Cc: "Christopher Gregory" > > Subject: Re: [blfs-support] Best approach for lvm2 > > > > > > > > > Sent: Thursday, November 07, 2019 at 4:59 AM > > > From: "Pierre Labastie via blfs-support" > > > > > > To: blfs-support@lists.linuxfromscratch.org > > > Cc: "Pierre Labastie" > > > Subject: Re: [blfs-support] Best approach for lvm2 > > > > > > 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" > > > >> > > > >> To: blfs-support@lists.linuxfromscratch.org > > > >> Cc: "Pierre Labastie" > > > >> 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
Re: [blfs-support] Best approach for lvm2
> Sent: Thursday, November 07, 2019 at 7:49 AM > From: "Christopher Gregory via blfs-support" > > To: blfs-support@lists.linuxfromscratch.org > Cc: "Christopher Gregory" > Subject: Re: [blfs-support] Best approach for lvm2 > > > > > Sent: Thursday, November 07, 2019 at 4:59 AM > > From: "Pierre Labastie via blfs-support" > > > > To: blfs-support@lists.linuxfromscratch.org > > Cc: "Pierre Labastie" > > Subject: Re: [blfs-support] Best approach for lvm2 > > > > 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" > > >> > > >> To: blfs-support@lists.linuxfromscratch.org > > >> Cc: "Pierre Labastie" > > >> 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
Re: [blfs-support] Best approach for lvm2
> Sent: Thursday, November 07, 2019 at 4:59 AM > From: "Pierre Labastie via blfs-support" > > To: blfs-support@lists.linuxfromscratch.org > Cc: "Pierre Labastie" > Subject: Re: [blfs-support] Best approach for lvm2 > > 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" > >> > >> To: blfs-support@lists.linuxfromscratch.org > >> Cc: "Pierre Labastie" > >> 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 fi
Re: [blfs-support] Best approach for lvm2
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" To: blfs-support@lists.linuxfromscratch.org Cc: "Pierre Labastie" 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
Re: [blfs-support] Best approach for lvm2
Hallo, > 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. I'm not using lvm in LFS myself but I had to investigate a dracut problem in RHEL 7.7 just today. In the dracut man page there is a nice example on how to manually mount an encrypted LVM volume from the dracut emergency shell, then continue with the normal boot process. Maybe this helps a bit for your investigations. = 1. Inspect your partitions using parted # parted /dev/sda -s p Model: ATA HTS541060G9AT00 (scsi) Disk /dev/sda: 60.0GB Sector size (logical/physical): 512B/512B Partition Table: msdos Number Start End SizeType File system Flags 1 32.3kB 10.8GB 107MB primary ext4 boot 2 10.8GB 55.6GB 44.7GB logicallvm 2. You recall that your root volume was a LVM logical volume. Scan and activate any logical volumes. # lvm vgscan # lvm vgchange -ay 3. You should see any logical volumes now using the command blkid: # blkid /dev/sda1: UUID="3de247f3-5de4-4a44-afc5-1fe179750cf7" TYPE="ext4" /dev/sda2: UUID="Ek4dQw-cOtq-5MJu-OGRF-xz5k-O2l8-wdDj0I" TYPE="LVM2_member" /dev/mapper/linux-root: UUID="def0269e-424b-4752-acf3-1077bf96ad2c" TYPE="crypto_LUKS" /dev/mapper/linux-home: UUID="c69127c1-f153-4ea2-b58e-4cbfa9257c5e" TYPE="ext3" /dev/mapper/linux-swap: UUID="47b4d329-975c-4c08-b218-f9c9bf3635f1" TYPE="swap" 4. From the output above, you recall that your root volume exists on an encrypted block device. Following the guidance disk encryption guidance from the Installation Guide, you unlock your encrypted root volume. # UUID=$(cryptsetup luksUUID /dev/mapper/linux-root) # cryptsetup luksOpen /dev/mapper/linux-root luks-$UUID Enter passphrase for /dev/mapper/linux-root: Key slot 0 unlocked. 5. Next, make a symbolic link to the unlocked root volume # ln -s /dev/mapper/luks-$UUID /dev/root 6. With the root volume available, you may continue booting the system by exiting the dracut shell # exit Tschau...Thomas -- Do you wanna be a legend or a passing footprint on the sands of time? -- http://lists.linuxfromscratch.org/listinfo/blfs-support FAQ: http://www.linuxfromscratch.org/blfs/faq.html Unsubscribe: See the above information page
Re: [blfs-support] Best approach for lvm2
> Sent: Wednesday, November 06, 2019 at 11:11 AM > From: "Pierre Labastie via blfs-support" > > To: blfs-support@lists.linuxfromscratch.org > Cc: "Pierre Labastie" > 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. Regards, Christopher. -- http://lists.linuxfromscratch.org/listinfo/blfs-support FAQ: http://www.linuxfromscratch.org/blfs/faq.html Unsubscribe: See the above information page
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
Re: [blfs-support] Best approach for lvm2
> Sent: Wednesday, November 06, 2019 at 3:56 AM > From: "Christopher Gregory via blfs-support" > > To: blfs-support@lists.linuxfromscratch.org > Cc: "Christopher Gregory" > Subject: Re: [blfs-support] Best approach for lvm2 > > > > > Sent: Wednesday, November 06, 2019 at 3:30 AM > > From: "Christopher Gregory via blfs-support" > > > > To: blfs-support@lists.linuxfromscratch.org > > Cc: "Christopher Gregory" > > Subject: Re: [blfs-support] Best approach for lvm2 > > > > > > > > > Sent: Wednesday, November 06, 2019 at 2:54 AM > > > From: "Pierre Labastie via blfs-support" > > > > > > To: blfs-support@lists.linuxfromscratch.org > > > Cc: "Pierre Labastie" > > > Subject: Re: [blfs-support] Best approach for lvm2 > > > > > > Le 05/11/2019 à 06:00, Christopher Gregory via blfs-support a écrit : > > > > > > > > > > > >> Sent: Sunday, October 27, 2019 at 3:20 AM > > > >> From: "Pierre Labastie via blfs-support" > > > >> > > > >> To: blfs-support@lists.linuxfromscratch.org > > > >> Cc: "Pierre Labastie" > > > >> Subject: Re: [blfs-support] Best approach for lvm2 > > > >> > > > >> On 26/10/2019 14:46, Christopher Gregory via blfs-support wrote: > > > >>> Hello, > > > >>> > > > >>> I am about to install another version of lfs/blfs on a new ssd hard > > > >>> drive, and I am wanting to move all my drives to using lvm2. What I > > > >>> need to know is the best approach for this. I understand that it > > > >>> needs to happen at the partitioning stage of installing lfs. > > > >>> > > > >>> I was wondering if I used a distro such as fedora from a live dvd if > > > >>> I would be able to achieve this on the new hard drive and then be > > > >>> able to use jhalf as normal to install lfs. I was hoping to avoid > > > >>> having to have a seperate /boot and having to use an initramfs image > > > >>> if at all possible, but do not know if this would be achieveable or > > > >>> not. > > > >>> > > > >>> I am wanting to continue using guid partitions as well. I have not > > > >>> seen antyhing on the lists that show that anyone has been able to > > > >>> install lfs on an lvm2 controlled drive. > > > >>> > > > >> > > > >> Maybe I've not communicated much on it, by I have done that :) here is > > > >> the > > > >> partition layout (you can have something simpler, but I need Windows > > > >> [1] for > > > >> my job). Note that there is nothing special with dos partitioning, and > > > >> certainly gpt is OK: > > > >> > > > >> Device Boot Start End Sectors Size Id Type > > > >> /dev/sda1 * 2048 2101247 20992001G 7 HPFS/NTFS/exFAT > > > >> /dev/sda2 2101248 197413747 195312500 93.1G 7 HPFS/NTFS/exFAT > > > >> /dev/sda3 197414910 620937215 423522306 202G 5 Extended > > > >> /dev/sda4 620937216 625131519 41943042G b W95 FAT32 > > > >> /dev/sda5 197414912 620937215 423522304 202G 8e Linux LVM > > > >> > > > >> Now, the lvm layout is: > > > >> /dev/mapper/vg-debian64: 37.26 GiB > > > >> /dev/mapper/vg-swap: 7.46 GiB > > > >> /dev/mapper/vg-home: 37.26 GiB > > > >> /dev/mapper/vg-lfs: 60 GiB > > > >> > > > >> I first installed debian on /dev/mapper/vg-debian64, mounting > > > >> /dev/mapper/vg-home on /home. Actually, I used the partitioning tool > > > >> coming > > > >> with the debian installer to shrink the NTFS partition and create the > > > >> lvm > > > >> setup. I installed grub onto the disk. Grub can perfectly well boot > > > >> from an > > > >> lvm partition. > > > >> > > > >> From debian, I mounted /dev/vg/lfs on /mnt/lfs, and installed lfs on > > > >> it. Then > > > >> I made an initramfs. The reason why it _is_ needed (no way without it, > > > >> unless > > > >> you have the root filesystem on a regular pa
Re: [blfs-support] Best approach for lvm2
> Sent: Wednesday, November 06, 2019 at 3:30 AM > From: "Christopher Gregory via blfs-support" > > To: blfs-support@lists.linuxfromscratch.org > Cc: "Christopher Gregory" > Subject: Re: [blfs-support] Best approach for lvm2 > > > > > Sent: Wednesday, November 06, 2019 at 2:54 AM > > From: "Pierre Labastie via blfs-support" > > > > To: blfs-support@lists.linuxfromscratch.org > > Cc: "Pierre Labastie" > > Subject: Re: [blfs-support] Best approach for lvm2 > > > > Le 05/11/2019 à 06:00, Christopher Gregory via blfs-support a écrit : > > > > > > > > >> Sent: Sunday, October 27, 2019 at 3:20 AM > > >> From: "Pierre Labastie via blfs-support" > > >> > > >> To: blfs-support@lists.linuxfromscratch.org > > >> Cc: "Pierre Labastie" > > >> Subject: Re: [blfs-support] Best approach for lvm2 > > >> > > >> On 26/10/2019 14:46, Christopher Gregory via blfs-support wrote: > > >>> Hello, > > >>> > > >>> I am about to install another version of lfs/blfs on a new ssd hard > > >>> drive, and I am wanting to move all my drives to using lvm2. What I > > >>> need to know is the best approach for this. I understand that it needs > > >>> to happen at the partitioning stage of installing lfs. > > >>> > > >>> I was wondering if I used a distro such as fedora from a live dvd if I > > >>> would be able to achieve this on the new hard drive and then be able to > > >>> use jhalf as normal to install lfs. I was hoping to avoid having to > > >>> have a seperate /boot and having to use an initramfs image if at all > > >>> possible, but do not know if this would be achieveable or not. > > >>> > > >>> I am wanting to continue using guid partitions as well. I have not > > >>> seen antyhing on the lists that show that anyone has been able to > > >>> install lfs on an lvm2 controlled drive. > > >>> > > >> > > >> Maybe I've not communicated much on it, by I have done that :) here is > > >> the > > >> partition layout (you can have something simpler, but I need Windows [1] > > >> for > > >> my job). Note that there is nothing special with dos partitioning, and > > >> certainly gpt is OK: > > >> > > >> Device Boot Start End Sectors Size Id Type > > >> /dev/sda1 * 2048 2101247 20992001G 7 HPFS/NTFS/exFAT > > >> /dev/sda2 2101248 197413747 195312500 93.1G 7 HPFS/NTFS/exFAT > > >> /dev/sda3 197414910 620937215 423522306 202G 5 Extended > > >> /dev/sda4 620937216 625131519 41943042G b W95 FAT32 > > >> /dev/sda5 197414912 620937215 423522304 202G 8e Linux LVM > > >> > > >> Now, the lvm layout is: > > >> /dev/mapper/vg-debian64: 37.26 GiB > > >> /dev/mapper/vg-swap: 7.46 GiB > > >> /dev/mapper/vg-home: 37.26 GiB > > >> /dev/mapper/vg-lfs: 60 GiB > > >> > > >> I first installed debian on /dev/mapper/vg-debian64, mounting > > >> /dev/mapper/vg-home on /home. Actually, I used the partitioning tool > > >> coming > > >> with the debian installer to shrink the NTFS partition and create the lvm > > >> setup. I installed grub onto the disk. Grub can perfectly well boot from > > >> an > > >> lvm partition. > > >> > > >> From debian, I mounted /dev/vg/lfs on /mnt/lfs, and installed lfs on it. > > >> Then > > >> I made an initramfs. The reason why it _is_ needed (no way without it, > > >> unless > > >> you have the root filesystem on a regular partition) is because the > > >> kernel > > >> does not know about lvm, so it needs some help to be able to mount an > > >> lvm root > > >> partition. The initramfs in the book works well for lvm. > > >> > > >> I created /boot/grub/grub.cfg on /dev/vg/lfs with > > >> > > >> # Begin /boot/grub/grub.cfg > > >> set default=0 > > >> set timeout=5 > > >> > > >> insmod ext2 > > >> insmod lvm > > >> set root='lvm/vg/lfs' > > >> > > >> menuentry "GNU/Linux, Linux 5.3.6-lfs-SVN-20191017" { > > >> li
Re: [blfs-support] Best approach for lvm2
> Sent: Wednesday, November 06, 2019 at 2:54 AM > From: "Pierre Labastie via blfs-support" > > To: blfs-support@lists.linuxfromscratch.org > Cc: "Pierre Labastie" > Subject: Re: [blfs-support] Best approach for lvm2 > > Le 05/11/2019 à 06:00, Christopher Gregory via blfs-support a écrit : > > > > > >> Sent: Sunday, October 27, 2019 at 3:20 AM > >> From: "Pierre Labastie via blfs-support" > >> > >> To: blfs-support@lists.linuxfromscratch.org > >> Cc: "Pierre Labastie" > >> Subject: Re: [blfs-support] Best approach for lvm2 > >> > >> On 26/10/2019 14:46, Christopher Gregory via blfs-support wrote: > >>> Hello, > >>> > >>> I am about to install another version of lfs/blfs on a new ssd hard > >>> drive, and I am wanting to move all my drives to using lvm2. What I need > >>> to know is the best approach for this. I understand that it needs to > >>> happen at the partitioning stage of installing lfs. > >>> > >>> I was wondering if I used a distro such as fedora from a live dvd if I > >>> would be able to achieve this on the new hard drive and then be able to > >>> use jhalf as normal to install lfs. I was hoping to avoid having to have > >>> a seperate /boot and having to use an initramfs image if at all possible, > >>> but do not know if this would be achieveable or not. > >>> > >>> I am wanting to continue using guid partitions as well. I have not seen > >>> antyhing on the lists that show that anyone has been able to install lfs > >>> on an lvm2 controlled drive. > >>> > >> > >> Maybe I've not communicated much on it, by I have done that :) here is the > >> partition layout (you can have something simpler, but I need Windows [1] > >> for > >> my job). Note that there is nothing special with dos partitioning, and > >> certainly gpt is OK: > >> > >> Device Boot Start End Sectors Size Id Type > >> /dev/sda1 * 2048 2101247 20992001G 7 HPFS/NTFS/exFAT > >> /dev/sda2 2101248 197413747 195312500 93.1G 7 HPFS/NTFS/exFAT > >> /dev/sda3 197414910 620937215 423522306 202G 5 Extended > >> /dev/sda4 620937216 625131519 41943042G b W95 FAT32 > >> /dev/sda5 197414912 620937215 423522304 202G 8e Linux LVM > >> > >> Now, the lvm layout is: > >> /dev/mapper/vg-debian64: 37.26 GiB > >> /dev/mapper/vg-swap: 7.46 GiB > >> /dev/mapper/vg-home: 37.26 GiB > >> /dev/mapper/vg-lfs: 60 GiB > >> > >> I first installed debian on /dev/mapper/vg-debian64, mounting > >> /dev/mapper/vg-home on /home. Actually, I used the partitioning tool coming > >> with the debian installer to shrink the NTFS partition and create the lvm > >> setup. I installed grub onto the disk. Grub can perfectly well boot from an > >> lvm partition. > >> > >> From debian, I mounted /dev/vg/lfs on /mnt/lfs, and installed lfs on it. > >> Then > >> I made an initramfs. The reason why it _is_ needed (no way without it, > >> unless > >> you have the root filesystem on a regular partition) is because the kernel > >> does not know about lvm, so it needs some help to be able to mount an lvm > >> root > >> partition. The initramfs in the book works well for lvm. > >> > >> I created /boot/grub/grub.cfg on /dev/vg/lfs with > >> > >> # Begin /boot/grub/grub.cfg > >> set default=0 > >> set timeout=5 > >> > >> insmod ext2 > >> insmod lvm > >> set root='lvm/vg/lfs' > >> > >> menuentry "GNU/Linux, Linux 5.3.6-lfs-SVN-20191017" { > >> linux /boot/vmlinuz-5.3.6-lfs-SVN-20191017 root=/dev/vg/lfs ro > >> quiet > >> initrd /boot/microcode.img /boot/initrd.img-no-kmods > >> } > >> ... > >> > >> Then I ran update-grub on debian. There is a small problem here: > >> update-grub > >> only copies the first initrd, so I had to manually add the second to > >> /boot/grub.gfg on /dev/vg/debian. Actually, It'd be better to merge both > >> initramfs. > >> > >> And that's it. > >> > >> Pierre > >> [1] I am not sure why Windows is using two small partitions + one big, but > >> the > >> computer came with that, and I just shrank the big par
Re: [blfs-support] Best approach for lvm2
Le 05/11/2019 à 06:00, Christopher Gregory via blfs-support a écrit : > > >> Sent: Sunday, October 27, 2019 at 3:20 AM >> From: "Pierre Labastie via blfs-support" >> >> To: blfs-support@lists.linuxfromscratch.org >> Cc: "Pierre Labastie" >> Subject: Re: [blfs-support] Best approach for lvm2 >> >> On 26/10/2019 14:46, Christopher Gregory via blfs-support wrote: >>> Hello, >>> >>> I am about to install another version of lfs/blfs on a new ssd hard drive, >>> and I am wanting to move all my drives to using lvm2. What I need to know >>> is the best approach for this. I understand that it needs to happen at the >>> partitioning stage of installing lfs. >>> >>> I was wondering if I used a distro such as fedora from a live dvd if I >>> would be able to achieve this on the new hard drive and then be able to use >>> jhalf as normal to install lfs. I was hoping to avoid having to have a >>> seperate /boot and having to use an initramfs image if at all possible, but >>> do not know if this would be achieveable or not. >>> >>> I am wanting to continue using guid partitions as well. I have not seen >>> antyhing on the lists that show that anyone has been able to install lfs on >>> an lvm2 controlled drive. >>> >> >> Maybe I've not communicated much on it, by I have done that :) here is the >> partition layout (you can have something simpler, but I need Windows [1] for >> my job). Note that there is nothing special with dos partitioning, and >> certainly gpt is OK: >> >> Device Boot Start End Sectors Size Id Type >> /dev/sda1 * 2048 2101247 20992001G 7 HPFS/NTFS/exFAT >> /dev/sda2 2101248 197413747 195312500 93.1G 7 HPFS/NTFS/exFAT >> /dev/sda3 197414910 620937215 423522306 202G 5 Extended >> /dev/sda4 620937216 625131519 41943042G b W95 FAT32 >> /dev/sda5 197414912 620937215 423522304 202G 8e Linux LVM >> >> Now, the lvm layout is: >> /dev/mapper/vg-debian64: 37.26 GiB >> /dev/mapper/vg-swap: 7.46 GiB >> /dev/mapper/vg-home: 37.26 GiB >> /dev/mapper/vg-lfs: 60 GiB >> >> I first installed debian on /dev/mapper/vg-debian64, mounting >> /dev/mapper/vg-home on /home. Actually, I used the partitioning tool coming >> with the debian installer to shrink the NTFS partition and create the lvm >> setup. I installed grub onto the disk. Grub can perfectly well boot from an >> lvm partition. >> >> From debian, I mounted /dev/vg/lfs on /mnt/lfs, and installed lfs on it. Then >> I made an initramfs. The reason why it _is_ needed (no way without it, unless >> you have the root filesystem on a regular partition) is because the kernel >> does not know about lvm, so it needs some help to be able to mount an lvm >> root >> partition. The initramfs in the book works well for lvm. >> >> I created /boot/grub/grub.cfg on /dev/vg/lfs with >> >> # Begin /boot/grub/grub.cfg >> set default=0 >> set timeout=5 >> >> insmod ext2 >> insmod lvm >> set root='lvm/vg/lfs' >> >> menuentry "GNU/Linux, Linux 5.3.6-lfs-SVN-20191017" { >> linux /boot/vmlinuz-5.3.6-lfs-SVN-20191017 root=/dev/vg/lfs ro >> quiet >> initrd /boot/microcode.img /boot/initrd.img-no-kmods >> } >> ... >> >> Then I ran update-grub on debian. There is a small problem here: update-grub >> only copies the first initrd, so I had to manually add the second to >> /boot/grub.gfg on /dev/vg/debian. Actually, It'd be better to merge both >> initramfs. >> >> And that's it. >> >> Pierre >> [1] I am not sure why Windows is using two small partitions + one big, but >> the >> computer came with that, and I just shrank the big partition to make room for >> linux. >> -- >> 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 finally got round to attempting this, and have spent a couple of days > now trying to get it to work. > > I used Fedora 31 (as I am working with a developer to package his software in > rpm format) to create the lvm and the volumes. This went well. I then used > jhalfs to build the lfs system, and I got a completed install. I then went > ahead and added the entries to grub, and then the true nightmare began. No > matter what I put in the grub.cf
Re: [blfs-support] Best approach for lvm2
> Sent: Sunday, October 27, 2019 at 3:20 AM > From: "Pierre Labastie via blfs-support" > > To: blfs-support@lists.linuxfromscratch.org > Cc: "Pierre Labastie" > Subject: Re: [blfs-support] Best approach for lvm2 > > On 26/10/2019 14:46, Christopher Gregory via blfs-support wrote: > > Hello, > > > > I am about to install another version of lfs/blfs on a new ssd hard drive, > > and I am wanting to move all my drives to using lvm2. What I need to know > > is the best approach for this. I understand that it needs to happen at the > > partitioning stage of installing lfs. > > > > I was wondering if I used a distro such as fedora from a live dvd if I > > would be able to achieve this on the new hard drive and then be able to use > > jhalf as normal to install lfs. I was hoping to avoid having to have a > > seperate /boot and having to use an initramfs image if at all possible, but > > do not know if this would be achieveable or not. > > > > I am wanting to continue using guid partitions as well. I have not seen > > antyhing on the lists that show that anyone has been able to install lfs on > > an lvm2 controlled drive. > > > > Maybe I've not communicated much on it, by I have done that :) here is the > partition layout (you can have something simpler, but I need Windows [1] for > my job). Note that there is nothing special with dos partitioning, and > certainly gpt is OK: > > Device Boot Start End Sectors Size Id Type > /dev/sda1 * 2048 2101247 20992001G 7 HPFS/NTFS/exFAT > /dev/sda2 2101248 197413747 195312500 93.1G 7 HPFS/NTFS/exFAT > /dev/sda3 197414910 620937215 423522306 202G 5 Extended > /dev/sda4 620937216 625131519 41943042G b W95 FAT32 > /dev/sda5 197414912 620937215 423522304 202G 8e Linux LVM > > Now, the lvm layout is: > /dev/mapper/vg-debian64: 37.26 GiB > /dev/mapper/vg-swap: 7.46 GiB > /dev/mapper/vg-home: 37.26 GiB > /dev/mapper/vg-lfs: 60 GiB > > I first installed debian on /dev/mapper/vg-debian64, mounting > /dev/mapper/vg-home on /home. Actually, I used the partitioning tool coming > with the debian installer to shrink the NTFS partition and create the lvm > setup. I installed grub onto the disk. Grub can perfectly well boot from an > lvm partition. > > From debian, I mounted /dev/vg/lfs on /mnt/lfs, and installed lfs on it. Then > I made an initramfs. The reason why it _is_ needed (no way without it, unless > you have the root filesystem on a regular partition) is because the kernel > does not know about lvm, so it needs some help to be able to mount an lvm root > partition. The initramfs in the book works well for lvm. > > I created /boot/grub/grub.cfg on /dev/vg/lfs with > > # Begin /boot/grub/grub.cfg > set default=0 > set timeout=5 > > insmod ext2 > insmod lvm > set root='lvm/vg/lfs' > > menuentry "GNU/Linux, Linux 5.3.6-lfs-SVN-20191017" { > linux /boot/vmlinuz-5.3.6-lfs-SVN-20191017 root=/dev/vg/lfs ro quiet > initrd /boot/microcode.img /boot/initrd.img-no-kmods > } > ... > > Then I ran update-grub on debian. There is a small problem here: update-grub > only copies the first initrd, so I had to manually add the second to > /boot/grub.gfg on /dev/vg/debian. Actually, It'd be better to merge both > initramfs. > > And that's it. > > Pierre > [1] I am not sure why Windows is using two small partitions + one big, but the > computer came with that, and I just shrank the big partition to make room for > linux. > -- > 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 finally got round to attempting this, and have spent a couple of days now trying to get it to work. I used Fedora 31 (as I am working with a developer to package his software in rpm format) to create the lvm and the volumes. This went well. I then used jhalfs to build the lfs system, and I got a completed install. I then went ahead and added the entries to grub, and then the true nightmare began. No matter what I put in the grub.cfg file it just refuses to find the kernel. I have generated the initrd.img-no-kmods using the script in the book. Using this script, it complains that there is a missing operand after tmp/filename/lib but proceeds and completes the image. I have no idea where you got the root=/dev/vg line from. With my installation, I have rootvg in /dev with the following: (this is on fedora 31) lrwxrwxrwx. 1 root root7 Nov 5 17:17 home -> ../dm-4 lrwxrwxrwx. 1 root root7 Nov 5 17:1
Re: [blfs-support] Best approach for lvm2
On 10/26/19 9:20 AM, Pierre Labastie via blfs-support wrote: Pierre [1] I am not sure why Windows is using two small partitions + one big, but the computer came with that, and I just shrank the big partition to make room for linux. The reason why Windows does that is so that the recovery tools and boot manager are always available in the first 100MB or so of the hard drive (I've seen Windows 10 dedicate over 500MB for "System Reserved" which is overkill). It's not the most convenient option for them, but it beats having to get a Windows DVD out anytime there's a problem that prevents the operating system from booting. -- http://lists.linuxfromscratch.org/listinfo/blfs-support FAQ: http://www.linuxfromscratch.org/blfs/faq.html Unsubscribe: See the above information page
Re: [blfs-support] Best approach for lvm2
On 26/10/2019 14:46, Christopher Gregory via blfs-support wrote: > Hello, > > I am about to install another version of lfs/blfs on a new ssd hard drive, > and I am wanting to move all my drives to using lvm2. What I need to know is > the best approach for this. I understand that it needs to happen at the > partitioning stage of installing lfs. > > I was wondering if I used a distro such as fedora from a live dvd if I would > be able to achieve this on the new hard drive and then be able to use jhalf > as normal to install lfs. I was hoping to avoid having to have a seperate > /boot and having to use an initramfs image if at all possible, but do not > know if this would be achieveable or not. > > I am wanting to continue using guid partitions as well. I have not seen > antyhing on the lists that show that anyone has been able to install lfs on > an lvm2 controlled drive. > Maybe I've not communicated much on it, by I have done that :) here is the partition layout (you can have something simpler, but I need Windows [1] for my job). Note that there is nothing special with dos partitioning, and certainly gpt is OK: Device Boot Start End Sectors Size Id Type /dev/sda1 * 2048 2101247 20992001G 7 HPFS/NTFS/exFAT /dev/sda2 2101248 197413747 195312500 93.1G 7 HPFS/NTFS/exFAT /dev/sda3 197414910 620937215 423522306 202G 5 Extended /dev/sda4 620937216 625131519 41943042G b W95 FAT32 /dev/sda5 197414912 620937215 423522304 202G 8e Linux LVM Now, the lvm layout is: /dev/mapper/vg-debian64: 37.26 GiB /dev/mapper/vg-swap: 7.46 GiB /dev/mapper/vg-home: 37.26 GiB /dev/mapper/vg-lfs: 60 GiB I first installed debian on /dev/mapper/vg-debian64, mounting /dev/mapper/vg-home on /home. Actually, I used the partitioning tool coming with the debian installer to shrink the NTFS partition and create the lvm setup. I installed grub onto the disk. Grub can perfectly well boot from an lvm partition. From debian, I mounted /dev/vg/lfs on /mnt/lfs, and installed lfs on it. Then I made an initramfs. The reason why it _is_ needed (no way without it, unless you have the root filesystem on a regular partition) is because the kernel does not know about lvm, so it needs some help to be able to mount an lvm root partition. The initramfs in the book works well for lvm. I created /boot/grub/grub.cfg on /dev/vg/lfs with # Begin /boot/grub/grub.cfg set default=0 set timeout=5 insmod ext2 insmod lvm set root='lvm/vg/lfs' menuentry "GNU/Linux, Linux 5.3.6-lfs-SVN-20191017" { linux /boot/vmlinuz-5.3.6-lfs-SVN-20191017 root=/dev/vg/lfs ro quiet initrd /boot/microcode.img /boot/initrd.img-no-kmods } ... Then I ran update-grub on debian. There is a small problem here: update-grub only copies the first initrd, so I had to manually add the second to /boot/grub.gfg on /dev/vg/debian. Actually, It'd be better to merge both initramfs. And that's it. Pierre [1] I am not sure why Windows is using two small partitions + one big, but the computer came with that, and I just shrank the big partition to make room for linux. -- http://lists.linuxfromscratch.org/listinfo/blfs-support FAQ: http://www.linuxfromscratch.org/blfs/faq.html Unsubscribe: See the above information page