Dual boot with LVM?

6 replies [Last post]
GNUbahn
Offline
Joined: 02/19/2016

On a fresh install, how do you setup a dual boot with LVM?

Using the automatic installer with LVM, the whole drive will be used for one OS. There must be a way to make a dual boot setup with LVM? I have only found quite old descriptions (12+ years) and they do not seem to fit my situation.

In another thread, I have tried to shrink the original setup in order to make space for a second installation, but I ran into a similar issue with guides: https://trisquel.info/en/forum/resize-encryoted-volume-lvm

Based on my search and readings (including help on htis forum), I consider there are three general solutions (there are probably innummerous):

1) A semi-automatic solution, where you can tell the first installer to not use all the space in the harddrive, which can afterwards be used to install a secon OS.

2) An automatic-manual solution, where you first do an automatic installation to install an OS (using the whole drive) and afterwards manually shrink that installation in order to make space for a second installation (This is, what I have been trying, cf. the above mentioned thread).

3) A manual solution, where you manually create each necessary partition for both installations, afterwards encrypt the pertinent ones and finally install the two OS.

Any help to figure out how to dual boot with LVM is much appreciated.

Avron

I am a translator!

Offline
Joined: 08/18/2020

I had the experience that Debian can coexist well with Trisquel 10 on one disk while using the automatic installers (probably with some instructions not to use the whole disk for the first installation, like you mention in 1), but it was a while ago, it would need to be checked again. I remember installing both Trisquel and Parabola on the same disk (Parabola installation is completely manual), but the second installation (cannot remember in which order I did) made the first one not boot anymore, I tried a few things and eventually gave up.

On two computer, I have two disks with two different systems (Trisquel and Parabola, Trisquel and Guix) and it worked easily with the default install options. However, on the computer with UEFI, when I installed another Trisquel system on the second disk, I could not boot the first one anymore, and it seemed that the second install used the EFI partition on the first disk and the same name for the boot file, so it overwrote the one of the other system.

With which systems are you trying to do a dual-boot? Is your computer booting with BIOS or UEFI? I suspect that the method that works depends on the other system you want to install and on the boot type.

GNUbahn
Offline
Joined: 02/19/2016

I wish to dial boot two installations of Trisquel. One for private stuf and one for stuff related to work.

I am running Coreboot (Skulls). How would I be able to check wether it's booting with BIOS og UEFI?

Avron

I am a translator!

Offline
Joined: 08/18/2020

Skulls has BIOS (SeaBIOS), so at least you won't have the problem with the second system overwritting the .efi file of the first one. I would try your method 1).

After installation, you will have two /boot partitions, each system generates a file /boot/grub/grub.cfg in its /boot partition, that defines the list of choices in the grub boot menu, and grub will pick this file from of those two partitions.

After both systems are installed, you may only see one at boot. Then you could uncomment the following line in /etc/default/grub:
#GRUB_DISABLE_OS_PROBER=false

and run
sudo update-grub If at some point, grub picks the other /boot partition (like after some upgrade maybe), you may have to do this again.

If you still can't see the grub menu at boot, check that /boot/grub/grub.cfg is listing both systems, and if so, it may be that some option in /etc/default/grub needs to be changed to make the menu visible (if you look into this file, it tells you how to find the basic information about it). Then again sudo update-grub.

GNUbahn
Offline
Joined: 02/19/2016

But how can I tell the installer to only use a certain amount of space on the disk?

Avron

I am a translator!

Offline
Joined: 08/18/2020

I think the only way is to use manual partitioning to install the first system. However, I just tried the "something else" option for partitioning in the main installer, after you create an encrypted space, there is no option to use LVM in it.

However, the network installer provides this possibility. https://github.com/hankbao/libreboot/blob/master/docs/gnulinux/encrypted_trisquel.md includes old instructions to install Trisquel with full disk encryption, including /boot. You should not follow these instructions exactly (you need an extra partition for /boot, ext4 filesystem, 2GB maybe, and perhaps some small partition at the begining to save space for GRUB), but they tell you how to make an encrypted volume (don't use the parameters provided, keep the default maybe) and the PV, VG, LV in it. When you create the encrypted volume, you can specify the size.

For the second system, you can use the main installer as it will detect there is one system already and will propose to install Trisquel next to it, and you can use the automatic partitionning.

GNUbahn
Offline
Joined: 02/19/2016

I will try this too.