0

I'm sort of a newbie to configuring multiboot setups. For context, with great effort, I was able to set up 2 encrypted installs and have them both bootable from grub via the 40_custom method of adding a menu entry for the other installs boot partition. This unfortunately requires the use of 2 boot partitions. For reasons I cannot explain, I can't use a VM or separate boot partitions, so I have turned to you for help. Here is my setup and how I need it to look when finished:

----------------
|nvme0n1 (2 TB)|
|sda (2 TB)    |
----------------
needs to be partitioned something like this:
-----------------------------------------------------------------------------------
|nvme0n1                                                                          |
|>nvme0n1p1 efi                                  35MB                             |
|>nvme0n1p2 ext4   /boot                         1GB                              |
|>nvme0n1p3 crpyto / (For Ubuntu 22 install)     the rest of the space on nvme0n1 |
|                                                                                 |
|sda                                                                              |
|>sda1      crypto / (for Ubuntu 20 install)     2TB                              |
-----------------------------------------------------------------------------------

Is there a way to configure this setup? My only requirements are:

  • 1 efi partition
  • there is 1 /boot partition (these 2 can be the only unecrypted partitions)
  • any other partitions are LUKS encrypted (It really doesn't matter how many there are but all of them have to be LUKS)
  • I have one bootable Ubuntu 22.04 and one bootable 20.04

Any way that I can get these requirements met I am also open to! Thanks in advance!

Edit: Currently I have tried the above setup but now only the 20.04 instance is bootable, the 22.04 instance sends me to initramfs. (I'm trying to boot the 6.5 kernel in advanced opition menu in grub to get to my 22.04 instance, i can boot the 5.15 kernel just fine). Same thing happens in reverse if I install 20.04 first then 22.04.

Edit 2: It boots up the other kernel (5.15/6.5) but its trying to mount the wrong crypto partition for the root partition.

Here is the custom menu entry that im trying to set up to make it point to the correct root partition for the second install:

#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
menuentry 'Ubuntu - Focal' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-4d20d9f8-13be-40ee-8ac7-b75c5ebdb3a0' {
    recordfail
    load_video
    gfxmode $linux_gfx_mode
    insmod gzio
    if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
    insmod part_gpt
    insmod ext2
    search --no-floppy --fs-uuid --set=root c481b77c-a84a-422f-8dbe-a97cd6e5f904
    linux   /vmlinuz-5.15.0-113-generic root=UUID=4d20d9f8-13be-40ee-8ac7-b75c5ebdb3a0 ro  quiet splash $vt_handoff
    initrd  /initrd.img-5.15.0-113-generic
}

and the partition uuids for reference:

NAME                   FSTYPE      FSVER LABEL UUID                                 FSAVAIL FSUSE% MOUNTPOINTS
loop0                  squashfs    4.0                                                    0   100% /snap/bare/5
loop1                  squashfs    4.0                                                    0   100% /snap/core22/1122
loop2                  squashfs    4.0                                                    0   100% /snap/firefox/3836
loop3                  squashfs    4.0                                                    0   100% /snap/gnome-42-2204/141
loop4                  squashfs    4.0                                                    0   100% /snap/gtk-common-themes/1535
loop5                  squashfs    4.0                                                    0   100% /snap/snap-store/959
loop6                  squashfs    4.0                                                    0   100% /snap/snapd/20671
loop7                  squashfs    4.0                                                    0   100% /snap/snapd-desktop-integration/83
sda                                                                                                
└─sda1                 crypto_LUKS 2           b2fddef3-5f00-4678-97b3-bcb8b47b9808                
  └─luks-b2fddef3-5f00-4678-97b3-bcb8b47b9808
                       ext4        1.0         4d20d9f8-13be-40ee-8ac7-b75c5ebdb3a0    1.7T     1% /media/ceadmin/4d20d9f8-13be-40ee-8ac7-b75c5ebdb3a0
sdb                                                                                                
sr0                                                                                                
nvme0n1                                                                                            
├─nvme0n1p1            vfat        FAT32       F20C-0916                              26.4M    19% /boot/efi
├─nvme0n1p2            ext4        1.0         c481b77c-a84a-422f-8dbe-a97cd6e5f904  489.6M    40% /boot
└─nvme0n1p3            crypto_LUKS 2           843dc448-3470-42b4-a9a0-f7c656614541                
  └─nvme0n1p3_crypt    ext4        1.0         683738c8-f37a-47c3-b197-1cd61e603ffc    1.7T     1% /var/snap/firefox/common/host-hunspell
                                                                                                   /

I'd be open to a solution that uses 2 boot partitions if it was such that the boot partitions were on separate drives and that whichever OS is booted can't see the other drive at all (I don't want to have to physically unplug one drive each time I boot tho)

Also open to a solution that only uses 1 disk instead of 2, just wanted to utilize the all the storage space available to me

1
  • Please do not make comments about your question or to add info to it. Comments are for the users trying to help you to ask for more info. Please use the edit feature in the question and add these comments to the question.
    – David
    Commented Jun 28 at 7:41

0

You must log in to answer this question.

Browse other questions tagged .