-2

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.

ServerMan
  • 15
  • 2
  • Did you try `dd`? – Virsacer Jan 28 '22 at 23:14
  • 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, – djdomi Jan 29 '22 at 09:13
  • 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? – ServerMan Jan 29 '22 at 22:05
  • 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. – Zoredache Jan 30 '22 at 07:17
  • 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. – ServerMan Jan 30 '22 at 07:49

1 Answers1

0

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.

John Mahowald
  • 30,009
  • 1
  • 17
  • 32
  • 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. – ServerMan Jan 29 '22 at 21:50