Creating single-disk copy of 2-disk RAID-1 system?

Issues related to applications and software problems
GRA
Posts: 1
Joined: 2017/10/16 22:38:12
Location: PA, USA

Creating single-disk copy of 2-disk RAID-1 system?

Postby GRA » 2017/10/16 23:47:29

I currently have a server using GPT (GUID partition table) and mdadm RAID-1 configuration with 2 disks.
Each disk has:
/dev/sdx1: 4 GB swap
/dev/sdx2: 1 GB as /dev/md0, as /boot
/dev/sdx3: [remainder of disk] as /dev/md1, as /

For the purpose of a live backup, I've copied these partitions to new disks as-is.
I would also like to make an image of this system for use with VMWare/VirtualBox, for testing of upgrades, the installation of new third-party software, and training staff on use of this software.

Until I started browsing this forum, I thought I would need to "remove" the RAID in order to have a one-disk system. I then saw this post on another thread:
I realize that this doesn't help you solve your problem, but for future reference, the minimum number of drives required for RAID1 is actually 1. You can install it using RAID1 with one drive plus the other drive as "Failed". Then, when your second drive is available, you can add it and let the RAID system sync.

In this case, you may be able to partition your new drive as a number of RAID1 partitions (with one failed drive), copy everything over to the new partitions, add the boot loader, then boot off the new drive.


viewtopic.php?f=14&t=64036

So I guess I will leave the RAID in place with each RAID partition having a failed member.

SO: I'd like to copy my 2-disk RAID-1 system to become a 1-disk system for virtualization. I don't care whether I copy it to a single hard drive first, then virtualize, or do it in one step.

1. Do I copy the partitions of /dev/sda onto a new drive?
2. Do I set up partitions on a new drive then copy over the files with rsync (as suggested in the second paragraph of the quote above). Will the CentOS install software let me set up raid partitions with only one disk?

What's the best way to do this?
Thanks for any help you can provide.