Hi-
I’m faced with converting a Centos 7.9 SSD install and a Rock 9.2 SSD install from MBR to UEFI/GPT. Both use XFS file system for all partitions/LVM, ie. here’s info from the old source SSD (Rocky 9 here):
Device Boot Start End Sectors Size Id Type
/dev/sda1 * 2048 2099199 2097152 1G 83 Linux
/dev/sda2 2099200 2000408575 1998309376 952.9G 8e Linux LVM
and parted:
[root@hostname ~]# parted
GNU Parted 3.5
Using /dev/sda
Welcome to GNU Parted! Type ‘help’ to view a list of commands.
(parted) p
Model: ATA KINGSTON SKC6001 (scsi)
Disk /dev/sda: 1024GB
Sector size (logical/physical): 512B/4096B
Partition Table: msdos
Disk Flags:
Number Start End Size Type File system Flags
1 1049kB 1075MB 1074MB primary xfs boot
2 1075MB 1024GB 1023GB primary lvm
so I cannot easily add a UEFI/GPT partition to my knowledge, as one cannot shrink XFS. I would rather not reinstall all the software/configs on the new host from scratch.
Taking the Rocky 9.2 case (I assume the Centos 7.9 procedure will be nearly indentical (?)), I would prefer instead to install Rocky 9.2 fresh from the DVD on a new SSD (same exact size as older one) so as to install UEFI/GPT, and then take a backup of the entire volume group from the old MBR/legacy disk and restore it to the new UEFI/GPT Rocky 9.2 install partition. the SSD size and partition size will be identical to the old MBR SSD, apart from whatever is created for UEFI on the new SSD.
What are the steps to accomplish this? I’ve found a great deal of confusing info online. Use of pvmove/pvcreate as seen here: ubuntu - Copy LVM Volume Group to a new single hard disk - Server Fault seems close, but the old and new SSD R9 installs won’t be part of the same VG- they are completely separate. Do I instead copy the PV with cp/tar? What steps do I use to prepare the target SSD/LVM partition during the R9.2 install routine/after? Please let me know your thoughts on the best way to accomplish this, including other methods i did not mention.
Thank you!