Upgrade Carmine from Ubuntu 20.04 LTS to 22.04 LTS
/dev/volgroup1/ubuntu16.04 is really Ubuntu 20.04
/dev/volgroup1/ubuntu18.04 is the old Ubuntu 18.04 installation
Both logical volumes are the same size
Rename the old logical volume
First rename the old logical volume to reflect what will be stored there:
sudo lvrename volgroup1 ubuntu18.04 linux2
Back up the current OS
copy the contents of the current OS in ubuntu16.04 to linux2:
sudo dd if=/dev/volgroup1/ubuntu16.04 of=/dev/volgroup1/linux2 bs=1024k
Update the backup copy to be bootable
Mount the new volume:
sudo mkdir /media/linux2
sudo mount /dev/volgroup1/linux2 /media/linux2
Edit /media/linux2/etc/fstab and change / to point to /dev/mapper/volgroup1-linux2
Update Grub
Load Grub Customizer if you don’t already have it:
sudo apt install grub-customizer
Run Grub Customizer and check the entries for both logical volumes including the paths and LVIDs (which you can get from lvdisplay)
Rename the entries to Ubuntu primary (linux1) and Ubuntu alternate (linux2)
Don’t forget to save, which runs update-grub
and install to MBR
Check both logical volumes are OK
Verify you can boot into primary and alternate
When running alternate, rename logical volume ubuntu16.04 to linux1, update its fstab and update Grub as above.
Now that there’s a backup copy of the current OS in Ubuntu alternate, it’s safe to boot into Ubuntu primary and begin the upgrade