I have just added a new NVME drive to my system, I want to use it as my primary boot drive and I wanted to take the opportunity to do a cleanup of my OS.
To do that I installed a clean copy of Ubuntu 20.04 on the NVME drive with LVM and LUKS encryption. The new OS boots up fine, but now I want to copy my files over from my other drive; which was also an encrypted ssd with Ubuntu 20.04 installed.
My problem is that both drives are picked up with the same LV Path; /dev/vgubuntu/root
and the same VG Name vgubuntu
. I know that I could use sudo vgrename aaaaaa-aaaa-aaaa-aaaa-aaaa-aaaa-aaaaaa old-ubuntu
to change the VG name of the old volume and access it, but ideally I'd like to be able to boot to both until I'm happy with the setup on the new drive.
Reading other related questions suggests that if I rename the old volume with vgrename
then I won't be able to boot into it.
Running sudo lvdisplay
outputs this (trimmed) and you can see that the new system root and swap are available while the old system is unavailable:
--- Logical volume ---
LV Path /dev/vgubuntu/root
LV Name root
VG Name vgubuntu
LV UUID aaaaaa-aaaa-aaaa-aaaa-aaaa-aaaa-aaaaaa
LV Status NOT available
...
--- Logical volume ---
LV Path /dev/vgubuntu/swap_1
LV Name swap_1
VG Name vgubuntu
LV UUID bbbbbb-bbbb-bbbb-bbbb-bbbb-bbbb-bbbbbb
LV Status NOT available
...
--- Logical volume ---
LV Path /dev/vgubuntu/root
LV Name root
VG Name vgubuntu
LV UUID cccccc-cccc-cccc-cccc-cccc-cccc-cccccc
LV Status available
...
--- Logical volume ---
LV Path /dev/vgubuntu/swap_1
LV Name swap_1
VG Name vgubuntu
LV UUID dddddd-dddd-dddd-dddd-dddd-dddd-dddddd
LV Status available
...
On other distros this answer might work. But unfortunately /dev/SysVolGroup
doesn't exist on Ubuntu 20.04.
How can I mount my old LUKS encrypted volume on Ubuntu without making it unbootable?
/dev/SysVolGroup
doesn't exist in Ubuntu 20.04 and the other option listed is renaming. I wasn't sure that after a rename I could just rename it back to make it bootable. Ironically when I tried to boot back into the old disk I couldn't, even without renaming. When I tried I just got dumped to the grub shell, so in the end I did rename the disk and now have to hurriedly set my system to get some work done.vgrename
; if you do that then you can't boot into the volume, which I did specify in the question was my goal. The other solution, using/dev/SysVolGroup
, doesn't work in Ubuntu 20.04 (or later I assume).