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 have a batch of linux servers using software raid 1 that need to have both disks swapped. While this can be done one disk at a time, I'd like to know if it is possible to do both at once with a process like the following, to reduce the outages needed:

1) connect new drives via USB 2) Add both new drives to the array, rebuilding data to them 3) install grub on new drives 4) shutdown and swap drives

This plan requires the ability to mirror the information in the aray across 4 devices, and a quick test shows that mdadm makes all devices after the first two in a RAID 1 aray spare disks. Is there anyway to override this, or do I need to go with two outages to swap disks over one-by-one?

share|improve this question
add comment

2 Answers

up vote 10 down vote accepted

Yes, you can grow a RAID-1 set to include as many drives as you like. What you need to do is add the new drives as spares, and then run mdadm /dev/mdX --grow -n 4 (or however many devices you want to have in the set). They'll then be synced to, and you can go play swapsies at your leisure once that's done.

share|improve this answer
    
Perfect - that does exactly what I am after –  DrStalker Sep 2 '09 at 2:34
add comment

As it has been told, you can - my answer is an extension for this fact.

I usually keep a low-profile root filesystem with low writing rate, then I spread this filesystem across all disks in the system using raid1 (typically 4 or more devices). Basically I make a 512M partition in the beginning of each disk, which serves a part for the raid1 containing the root. In this case, I can lose any disk without risking to boot the system.

You should consider this.

share|improve this answer
add comment

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.