0

I have read this question: Can I create a "soft" RAID1 array without nuking data? as well as many other tutorials that layout this general process:

  • Create degraded RAID1 array on new drive
  • Copy over data to new drive
  • Add the old drive to the array, and it gets written over by the data that it holds...

This seems quite inefficient and pointless. Is there a way to do it without copying the data twice?

Shelvacu
  • 353
  • 2
  • 14

2 Answers2

4

Almost certainly not. Every RAID system I'm aware of takes some of the disk space to store its metadata and superblock, and that cuts into the space available to store files. If you had the disk partitioned in "just the right way", you could, theoretically, do it without an extra copy, but it would require an extensive amount of knowledge about how the specific RAID system you were using worked, and probably a few practice tries on a scratch system to make sure you weren't about to nuke all your data.

In short: just copy the data twice. It's no big deal.

womble
  • 95,029
  • 29
  • 173
  • 228
2

You can't do it with mdadm, but if you're using LVM, you can use lvconvert to make an existing LV mirrored with no downtime and only copying the data once.

techieb0y
  • 4,161
  • 16
  • 17