Re: Transferring an existing system from non-RAID disks to RAID1 disks in the same computer
From: Pascal Hambourg <hidden>
Date: 2023-01-22 08:53:04
On 22/01/2023 at 06:05, H wrote:
quoted
The new one uses two disks, RAID1, LUKS and LVM for everything but /boot and /boot/efi, total of four partitions (swap has its own partition - not sure why I made it that way). A minimal installation of Centos 7 was made to this setup and is working. In other words, UUIDs of disks, partitions and LUKS are already configured and working. So, I am now thinking the following might work: - Make a rsync backup of the new disks to the external harddisk ("BACKUP2"). - Delete all files from the new disks except from /boot and /boot/efi. - Copy all files from all partitions except /boot and /boot/efi from BACKUP1 to the new disks. In other words, everything except /boot and /boot/efi will now be overwritten. - I would expect this system not to boot since both /etc/fstab and /etc/crypttab on the new disks contain the UUIDs from the old system. - Copy just /etc/fstab and /etc/crypttab from BACKUP2 to the new disks. This should update the new disks with the previously created UUIDs from when doing the minimal installation of CentOS 7. What do you think?
There are caveats: - The kernel versions must be the same in the old and new systems so that kernel images in /boot and kernel modules in /lib/modules match. - Make sure that mdadm is installed in the old system. For now it is included in the initramfs generated by the new system but if mdadm is not installed in the old system, newer initramfs generated by the old system will fail to mount the root filesystem.
I am happy to share that my plan as outlined below worked. I now have /boot, /boot/efi and / on separate RAID partitions with the latter managed by LVM and encrypted. All data from the old disk is now on the new setup and everything seems to be working. However, going back to the issue of /boot/efi possibly not being duplicated by CentOS, would not mdadm take care of that automatically? How can I check?
Is really /boot/efi on RAID ? You can check with "lsblk". If it is, can you post the output of cat /proc/mdstat fdisk -l blkid efibootmgr -v PS: Your lines are too long.