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 2099200 1G 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 4194304 2G 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