1

I've got an issue I would rather handle with the array online - I am using RAID0 for temporary video storage - data that is low-cost to restore, but that is used frequently.

The software array looks like this:

md1 : active raid0 sdb1[2] sdc1[3] sdd1[0] sde1[1]
      1953487616 blocks 64k chunks

I have another partition (sda1) in this system, that I want to use to replace sdc1 (The drives are of varying age, and sdc1 is definitely the slowest one, limiting the entire array's sequential read performance to only 300MB/s).

Is there a way to migrate the data from sdc1 to sda1 while the array is still online?

user9517
  • 115,471
  • 20
  • 215
  • 297
qdot
  • 138
  • 1
  • 8

4 Answers4

2

You're not going to be able to do this online, because RAID-0 is completely incapable of handling failures, and the md system depends on failures to trigger rebuilds onto spare components. There is no way to say "can you please use this device instead of that device" without saying "that device has failed" -- which, of course, is going to give your RAID-0 array a conniption.

For this reason, I'd recommend using LVM and striping instead of md for RAID-0 arrays. It has a much better toolset for managing component devices like this. I'd still use md for any other RAID level, though.

womble
  • 96,255
  • 29
  • 175
  • 230
  • Thanks, it's very informative - I would rather stick with RAID0, and just offline the array overnight, dd and reassemble - mostly because LVM striping appears a bit challenging to finetune performance (stripe location and drive rotation synchronization) – qdot Jul 12 '11 at 10:59
0

Typically doing anything like that with RAID 0 requires rebuilding the array from scratch.

mrdenny
  • 27,174
  • 4
  • 41
  • 69
  • 1
    Well, not quite - it doesn't reshape the array, merely moves the data around - so there shouldn't be any need for rebuilding the array. In fact, to do so offline, I would merely copy (dd) sdc1 to sda1 and manually override the array assembly, specifying the new drive order. – qdot Jul 11 '11 at 21:40
  • +1 to qdot. This seems entirely workable based off my previous experience with mdraid. – Jeff McJunkin Jul 11 '11 at 23:33
0

No you can't replace raid0 disk while array is online. But you can do this after stopping raid (i just temporarily commented out contents of my /etc/mdadm.conf and rebooted). While raid is offline you can just copy entire disk from faulty one to the new disk using "dd" cmdline utility. After cloning uncommment contents of /etc/mdadm.conf back, then shutdown, DISCONNECT FAULTY DISK(!) and boot again.

user920391
  • 561
  • 4
  • 3
0

It might be possible to upgrade your RAID 0 to RAID 5, then yank out sdc1, leaving you with a degraded RAID 5.

200_success
  • 4,771
  • 1
  • 25
  • 42