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

I have a 4 disk RAID5 array, one of which is starting to fail according to smartd. However, since I'm using less than half the space on /dev/md0, I'd like to rebuild the array without the failing disk.

The closest scenario I've been able to find online has been this post, however it contains bits that don't apply to me (LVM volumes) and also doesn't explain how I go about resizing the partition after I'm done.

Please note I have backups of important data, but I'd like to avoid rebuilding the array from scratch if possible.

Update: Failing disk has since been kicked out the array, can I still do this?

share|improve this question

1 Answer 1

up vote 5 down vote accepted

According to the power of Google, which brought me to this article, it's possible to resize RAID5 arrays under Linux since mdadm version 3.1.something.

  1. First shrink the filesystem (using resize2fs -M).
  2. Use mdadm ... --grow --array-size= to resize the array down so that it's the correct size for three physical volumes.
  3. Use mdadm ... --grow --raid-devices=3 --backup-file=/tmp/backup to change the number of devices in the array.

I have never tested this myself, and until now I didn't even realize this operation was supported. So, I've learned something. Good luck!

share|improve this answer
    
Thanks, @larsks. Failing disk has since been kicked out of the array, so it's now or never! Will report back if it works. –  drjeep Aug 2 '13 at 15:52
    
@drjeep Did it work? –  J Collins Nov 21 at 15:45

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.