I scripted my partition and LVM scheme for my last installation (that was of Arch Linux)
I now want to switch to Ubuntu, but use the same scheme that I used before, which was separate pairs of mirrors for /home
and /
However, the Ubuntu installer does not seem to allow me to use existing partitions. Is this possible with the Ubuntu installer, or do I have to do it through the interface. And can I script it somehow?
Edit: I realized I forgot to set the partition table of my usb as GPT, maybe that is why I couldn't select done
even after adding the desired partion as /boot
Edit2: I remade the usb with a GPT partition table, but while I was able to see the EFI partition I had previously made, but was not able to get the installer to use it.
And if I can't use my pre-existing partitions, can I at least do something equivalent to the "alternative" installer approach in Ubuntu 18.04? I recall this worked for me before: Install Ubuntu 18.04 desktop with RAID 1 and LVM on machine with UEFI BIOS
This is the partition scheme that worked for me under Arch and I was hoping to use with Ubuntu:
#!/bin/bash
yes | sgdisk --zap-all -g /dev/disk/by-id/ata-Samsung_SSD_850_EVO_120GB_S21SNX0H915160K
yes | sgdisk --zap-all -g /dev/disk/by-id/ata-Samsung_SSD_850_EVO_120GB_S21SNX0H915161E
yes | sgdisk --zap-all -g /dev/disk/by-id/ata-Samsung_SSD_860_EVO_250GB_S3YHNX0KC01493P
yes | sgdisk --zap-all -g /dev/disk/by-id/ata-Samsung_SSD_860_EVO_250GB_S3YHNX0KC01512Y
#set up partitions, making sure there is a separate /boot partition so that LVM can be mounted
# I picked the value of 6144KiB based on this https://bbs.archlinux.org/viewtopic.php?pid=1385980#p1385980
yes | parted --script /dev/disk/by-id/ata-Samsung_SSD_850_EVO_120GB_S21SNX0H915160K \
mklabel GPT \
mkpart ESP fat32 6144KiB 1% \
set 1 boot on \
name 1 efi \
mkpart primary 1% 2% \
name 2 boot \
mkpart primary 2% 99% \
name 3 lvm-root
yes | parted --script /dev/disk/by-id/ata-Samsung_SSD_850_EVO_120GB_S21SNX0H915161E \
mklabel GPT \
mkpart primary fat32 6144KiB 5% \
name 1 efi-boot-backups \
mkpart primary 5% 99% \
name 2 lvm-snapshots-root
yes | parted --script /dev/disk/by-id/ata-Samsung_SSD_860_EVO_250GB_S3YHNX0KC01493P \
mklabel GPT \
mkpart primary 6144KiB 2% \
name 1 emergency \
mkpart primary 2% 99% \
name 2 lvm-home
yes | parted --script /dev/disk/by-id/ata-Samsung_SSD_860_EVO_250GB_S3YHNX0KC01512Y \
mklabel GPT \
mkpart primary 6144KiB 2% \
name 1 emergency2 \
mkpart primary 2% 99% \
name 2 lvm-snapshots-home
yes| parted /dev/disk/by-id/ata-Samsung_SSD_850_EVO_120GB_S21SNX0H915160K set 3 lvm on
yes | parted /dev/disk/by-id/ata-Samsung_SSD_850_EVO_120GB_S21SNX0H915161E set 2 lvm on
yes | parted /dev/disk/by-id/ata-Samsung_SSD_860_EVO_250GB_S3YHNX0KC01493P set 2 lvm on
yes | parted /dev/disk/by-id/ata-Samsung_SSD_860_EVO_250GB_S3YHNX0KC01512Y set 2 lvm on
yes | pvcreate /dev/disk/by-id/ata-Samsung_SSD_850_EVO_120GB_S21SNX0H915160K-part3
yes | pvcreate /dev/disk/by-id/ata-Samsung_SSD_850_EVO_120GB_S21SNX0H915161E-part2
yes | pvcreate /dev/disk/by-id/ata-Samsung_SSD_860_EVO_250GB_S3YHNX0KC01493P-part2
yes | pvcreate /dev/disk/by-id/ata-Samsung_SSD_860_EVO_250GB_S3YHNX0KC01512Y-part2
yes | vgcreate main-VG /dev/disk/by-id/ata-Samsung_SSD_850_EVO_120GB_S21SNX0H915160K-part3
yes | vgextend main-VG /dev/disk/by-id/ata-Samsung_SSD_850_EVO_120GB_S21SNX0H915161E-part2
yes | vgextend main-VG /dev/disk/by-id/ata-Samsung_SSD_860_EVO_250GB_S3YHNX0KC01493P-part2
yes | vgextend main-VG /dev/disk/by-id/ata-Samsung_SSD_860_EVO_250GB_S3YHNX0KC01512Y-part2
vgdisplay
yes | lvcreate -L 60G main-VG -n lvroot /dev/disk/by-id/ata-Samsung_SSD_850_EVO_120GB_S21SNX0H915160K-part3
yes | lvcreate -L 16G main-VG -n lvtmp /dev/disk/by-id/ata-Samsung_SSD_850_EVO_120GB_S21SNX0H915160K-part3
yes | lvcreate -L 8G main-VG -n lvswap /dev/disk/by-id/ata-Samsung_SSD_850_EVO_120GB_S21SNX0H915160K-part3
yes | lvcreate -L 220G main-VG -n lvhome /dev/disk/by-id/ata-Samsung_SSD_860_EVO_250GB_S3YHNX0KC01493P-part2
#setupsnapshots
yes | lvcreate -L 100G -s -n /dev/main-VG/root_snap01 /dev/main-VG/lvroot
yes | lvcreate -L 240G -s -n /dev/main-VG/home_snap01 /dev/main-VG/lvhome
smartctl -l scterc,70,70 /dev/disk/by-id/ata-Samsung_SSD_850_EVO_120GB_S21SNX0H915160K
smartctl -l scterc,70,70 /dev/disk/by-id/ata-Samsung_SSD_850_EVO_120GB_S21SNX0H915161E
smartctl -l scterc,70,70 /dev/disk/by-id/ata-Samsung_SSD_860_EVO_250GB_S3YHNX0KC01493P
smartctl -l scterc,70,70 /dev/disk/by-id/ata-Samsung_SSD_860_EVO_250GB_S3YHNX0KC01512Y
yes | mkfs.f2fs /dev/main-VG/lvroot
yes | mkfs.f2fs /dev/main-VG/lvhome
yes | mkfs.ext4 /dev/main-VG/lvtmp
yes | mkfs.fat -F32 /dev/disk/by-id/ata-Samsung_SSD_850_EVO_120GB_S21SNX0H915160K-part1
yes | tune2fs -O "^has_journal /dev/main-VG/lvtmp"
yes | mkswap /dev/main-VG/lvswap
yes | swapon /dev/main-VG/lvswap
OK I feel silly. I simply was not able to select the EFI partition as boot because I attempted to select the partition rather than the device. After choosing like this it seems to be working as intended. I feel like this has tripped me up before, but I forget every time.