Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question

4 Answers 4

up vote 2 down vote accepted

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.

share|improve this answer
    
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

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

share|improve this answer
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

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.

share|improve this answer

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.