Score:0

Best way to clone a single disk from a Software RAID1 Array in Linux server

cn flag

How can I clone a single HDD bootable disk from a Software RAID1 Array in Linux server? It is currently a two-disk HDD mirror array. I have physical access to the server, and it has empty bays for disks. I'd like to leave the RAID1 array the way it is, and just make a single cloned disk of the Linux OS (CentOS 7) and all the data.

I plan on migrating from CentOS 7, which is EOL, and want to use a cloned disk to do so. Then I'd like to create a RAID1 array starting with the new disk to replace the current one.

I've found instructions for removing a disk from an array safely, which I suppose I could do and then clone it (using Clonezilla). However, it would be simpler, I think, to leave the array operational and just clone from it, if possible.

And if I do need to remove the disk from the array, marking it as 'failed' ala instructions such as these, will the disk be bootable when I remove it, so I can create a bootable clone?

Thanks for any help.

Score:0
cn flag

You can use Clonezilla to create an image using Linux mdraid as a source without removing anything from the raid. Just boot your system from Clonezilla boot media and select mdXXX as a source. You can then restore the image onto something else and Clonezilla is smart enough to regenerate GRUB entries for you using appropriate UUIDs.

jamminjames avatar
cn flag
Thanks! I'll give that a go, and return to accept this answer if it works, as I'm sure it will.
jamminjames avatar
cn flag
Is there a reason you say create an image vs just cloning directly? Is it better because the GRUB gets regenerated as you mentioned, or would it work either way?
Peter Zhabin avatar
cn flag
There's no difference in the process, but I prefer to create an image cause it serves as a backup and can be used later multiple times without the need to touch the original.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.