Installing Ubuntu 24.04 alongside Tumbleweed (btrfs, full-disk-encryption)

Hi,

I have an Tumbleweed installation and I’d like to install the latest Ubuntu LTS alongside it, while keeping TW around.

I am not sure of the technicalities, but I am using btrfs and Grub2 + EFI and I get a password prompt before the boot menu.

Here’s what I get for lsblk

NAME                                   MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINTS
nvme0n1                                259:0    0 953.9G  0 disk  
├─nvme0n1p1                            259:1    0   260M  0 part  /boot/efi
└─nvme0n1p2                            259:2    0 953.6G  0 part  
  └─cr_nvme-eui.00a075013c20c4e9-part2 254:0    0 953.6G  0 crypt 
    ├─system-swap                      254:1    0     2G  0 lvm   [SWAP]
    └─system-root                      254:2    0 951.6G  0 lvm   /var
                                                                  /usr/local
                                                                  /srv
                                                                  /root
                                                                  /opt
                                                                  /home
                                                                  /boot/grub2/x86_64-efi
                                                                  /boot/grub2/i386-pc
                                                                  /.snapshots
                                                                  /

There is some free room in my BTRFS filesystem

Data, single: total=657.01GiB, used=636.63GiB
System, DUP: total=32.00MiB, used=96.00KiB
Metadata, DUP: total=16.00GiB, used=9.27GiB
GlobalReserve, single: total=512.00MiB, used=16.00KiB

If it possible to adjust my setup and install Ubuntu next to Tumbleweed? I am not sure where to start.

Thanks!

Well, currently there is no place on the mass-storage device you show for any other partition. I have no idea how “full” your present root partition is (I have no idea about that output, maybe others have, in any case you did not add any command line that gave the results) and if you can “shrink” it.

df says

Filesystem               Size  Used Avail Use% Mounted on
/dev/mapper/system-root  952G  656G  283G  70% /

I would be ok with giving Ubuntu 120G (for example). But I am not sure how to shrink the filesystem and then the partition.

Very carefully!

I found this post this morning, after realizing that I really need to increase the size of my ‘boot’ partition … URG!

https://bbs.archlinux.org/viewtopic.php?id=233590

It provides only a general outline. The details of each step are fairly easy to figure out between your friends “man” and “google”.

From top to bottom

btrfs filesystem resize
cryptsetup resize
lvresize
pvresize
fdisk or gdisk (you did not bother to show us what partition table is in use, although today both commands should handle either partition table)

To avoid miscalculations the usual technique is to reduce the content of container with sufficient safety margin, reduce container to the desired size and then extend the content to fill new container. E.g.

reduce btrfs by 150G
reduce LV by 145G
reduce PV by 140G
reduce partition size by 120G
then extend PV, LV and btrfs in reverse order.

P.S. sorry, missed originally that you have encrypted container, in this case it sits between filesystem and LV.

1 Like

Thanks all for the replies, I have something to start with. I’ll make a backup on an external HDD first. I assume an rsync with permissions from a live CD would be enough?

Why from a live CD? rsync is on your system.

Because I would like to avoid any programs modifying the disk while the backups are executing. Is there a simpler way to do that besides a live CD?

I am not sure what you want to backup. Only data of the users, or also system data.
When only user data it is enough when the users are not logged in (and you then backup as root from the virtual console).
I think also that when a user does not use applications, (s)he can backup using Dolphin.
And that brings me to the use of rsync. When this is just a single copy done before you start the big thing, then usingcp will be OK.

In any case I wonder why a last and maybe extra backup in the normal way you make backups (whatever method you use) would not be enough?

You are right. It should be enough to only back up the user data.

That worked just fine and the system still works after a reboot! The commands I executed were

$ btrfs filesystem resize -150G /
$ cryptsetup resize --device-size 800G /dev/mapper/system-root
$ lvresize --size -145G system
$ pvresize --setphysicalvolumesize 810G /dev/mapper/cr_nvme-eui.00a075013c20c4e9-part2

And then resized the partition with GParted. I now have a 125 GiB partition for Ubuntu. Now to figure out how to safely install it and make it play nicely with the current bootloader setup.

Ok, a follow-up question now that I installed Ubuntu in the available space.

Ubuntu installed a separate bootloader entry, but I want to keep using the existing openSUSE one and add an ‘Ubuntu’ entry to it. Any ideas on how to do that? I did not see anything in the Yast Boot application.

$ efibootmgr -v
BootCurrent: 0000
Timeout: 0 seconds
BootOrder: 0000,0001,0002,001A,001B,001C,001E,001F,0020,001D,0021
Boot0000* opensuse-secureboot	HD(1,GPT,c100c57d-6292-4621-85ea-307b4f70080e,0x800,0x82000)/File(\EFI\opensuse\shim.efi)
      dp: 04 01 2a 00 01 00 00 00 00 08 00 00 00 00 00 00 00 20 08 00 00 00 00 00 7d c5 00 c1 92 62 21 46 85 ea 30 7b 4f 70 08 0e 02 02 / 04 04 32 00 5c 00 45 00 46 00 49 00 5c 00 6f 00 70 00 65 00 6e 00 73 00 75 00 73 00 65 00 5c 00 73 00 68 00 69 00 6d 00 2e 00 65 00 66 00 69 00 00 00 / 7f ff 04 00
Boot0001* Ubuntu	HD(1,GPT,c100c57d-6292-4621-85ea-307b4f70080e,0x800,0x82000)/File(\EFI\ubuntu\shimx64.efi)
      dp: 04 01 2a 00 01 00 00 00 00 08 00 00 00 00 00 00 00 20 08 00 00 00 00 00 7d c5 00 c1 92 62 21 46 85 ea 30 7b 4f 70 08 0e 02 02 / 04 04 34 00 5c 00 45 00 46 00 49 00 5c 00 75 00 62 00 75 00 6e 00 74 00 75 00 5c 00 73 00 68 00 69 00 6d 00 78 00 36 00 34 00 2e 00 65 00 66 00 69 00 00 00 / 7f ff 04 00
Boot0002* Linux-Firmware-Updater	HD(1,GPT,c100c57d-6292-4621-85ea-307b4f70080e,0x800,0x82000)/File(\EFI\opensuse\shim.efi) File(.\fwupdx64.efi)
      dp: 04 01 2a 00 01 00 00 00 00 08 00 00 00 00 00 00 00 20 08 00 00 00 00 00 7d c5 00 c1 92 62 21 46 85 ea 30 7b 4f 70 08 0e 02 02 / 04 04 32 00 5c 00 45 00 46 00 49 00 5c 00 6f 00 70 00 65 00 6e 00 73 00 75 00 73 00 65 00 5c 00 73 00 68 00 69 00 6d 00 2e 00 65 00 66 00 69 00 00 00 / 7f ff 04 00

Show output of

lsblk -f -o +partuuid
NAME                                   FSTYPE      FSVER    LABEL  UUID                                   FSAVAIL FSUSE% MOUNTPOINTS            PARTUUID
nvme0n1                                                                                                                                         
├─nvme0n1p1                            vfat        FAT32    SYSTEM 5296-73D7                               212.7M    17% /boot/efi              c100c57d-6292-4621-85ea-307b4f70080e
├─nvme0n1p2                            crypto_LUKS 1               8695af63-bbc1-443d-9cb1-b37c52222910                                         2aa128cd-9253-45ec-abae-daeb3054f1f7
│ └─cr_nvme-eui.00a075013c20c4e9-part2 LVM2_member LVM2 001        odjdtP-FexK-kEMW-Sknv-oni4-vABL-4fqVuh                                       
│   ├─system-root                      btrfs                       2e1135f1-78ed-439a-abd4-93f431981a19    142.3G    80% /var                   
│   │                                                                                                                    /usr/local             
│   │                                                                                                                    /root                  
│   │                                                                                                                    /srv                   
│   │                                                                                                                    /opt                   
│   │                                                                                                                    /home                  
│   │                                                                                                                    /boot/grub2/x86_64-efi 
│   │                                                                                                                    /boot/grub2/i386-pc    
│   │                                                                                                                    /.snapshots            
│   │                                                                                                                    /                      
│   └─system-swap                      swap        1               71535983-7598-46f3-8193-5dd7572237e1                  [SWAP]                 
└─nvme0n1p3                            ext4        1.0             7ec4285a-6be6-42b8-8d89-ed7ab0a27bba                                         81ed6faa-46c2-443e-9522-fff790b1ae4e

Well, one possibility is - create file /boot/grub2/custom.cfg with the content

menuentry 'Ubuntu' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'custom-ubuntu-5296-73D7' {
        insmod part_gpt
        insmod fat
        search --no-floppy --fs-uuid --set=root 5296-73D7
        chainloader /EFI/ubuntu/shimx64.efi
}

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.