Score:-2

What is the best way to clone a set of software RAID 1 disks?

ke flag

Here's the thing: One of my friends has a server with software RAID-1 with a set of two disks. The task at hand is simple: clone the disks into another set of two empty disks.

He is running CentOS, I don't know which version though.

Now, I know that the most straightforward way is to manually fail one of the drives, put an empty drive on its place and let it rebuild. Then fail the other old drive, put the other empty drive and let it rebuild from the newly-rebuilt new drive. Then he'd be left with 4 drives, as he wants but presumably he'd need to "reassemble" the RAID on the two old drives.

However, I am interested to hear if any other options exist to do this.

I recommended him to try CloneZilla. While it works wonderfully for single drives, it failed on him with software RAID. It is described on their website that cloning Software RAID-1 is not supported, but I didn't do the reading before I suggested it. Maybe it has improved?

He tried it by putting the source drive and the destination drive on another computer(I do not know why, but this shouldn't be the culprit). It seems to fail due to excluding the RAID member partitions, which is exactly what he wants.

CloneZilla Error

I suggested to try a workaround on this by adding nodmraid or dmraid=false to the boot parameters with no luck. Told him to try the Ubuntu-based image as well, as it includes more non-free drivers but that didn't lead to any improvement. Is there perhaps any way to force CloneZilla to include RAID members?

He tried a program called "AOMEI Backupper" which seemed to work, but then disk was unbootable.

Any other suggestions?

P.S. I am sorry if there is already an answer somewhere to this question, I just couldn't find it.

in flag
Did you try `dd`?
djdomi avatar
za flag
Questions on Server Fault must be about managing information technology systems in a business environment. Home and end-user computing questions may be asked on Super User,
ServerMan avatar
ke flag
We tried dd. It ran flawlessly until about 30gb, then started inputting "Input/Output error" but continued copying. The syntax I gave him were like dd if=/dev/sdX of=/dev/sdY conv=sync,noerror . After that, booting from the cloned disk results in kernel panic with "wrong fs type bad option bad superblock on /dev/sdb3 missing codepage or helper program, or orther error in some cases useful info is found in syslog - try dmesg | tail or so" I had him boot again in linux mint and try to mount the 3rd partition, it errored with same thing. Dmesg reports "no valid journal superblock".Any idea?
in flag
You might need to be more specific about how you were trying to use `dd`, since I have used it for cloning disks, and it worked fine. The specific details matter though.
ServerMan avatar
ke flag
We used this syntax: "dd if=/dev/sdX of=/dev/sdY bs=2048 conv=sync,noerror". Then I read somewhere that sometimes conv=sync,noerror corrupts the data so he redid it like this: "dd if=/dev/sdX of=/dev/sdY bs=4096" and it seems to have worked fine. sdX is source drive, sdY is destination drive. I am not sure if it needs any more specific things to be done (ex. grub reinstall/UUID update or anything) though.
Score:0
cn flag

Create a new, empty disk array.

Restore backup of the data to the new array.

File based restore is the most compatible, can deal with different sized volume or different file system. Or, if a consistent snapshot of the volume is available, might stream that over. So dd, possibly piped through ssh.

ServerMan avatar
ke flag
File-based restore is not the best option for this, as there are plenty of files and I don't know what is where honestly. Thanks for the suggestion though.
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.