extra harddisk on RAID5

Stuart Sears stuart at sjsears.com
Tue Sep 30 10:32:55 UTC 2008


roland wrote:
> Hello,
> 
> I have a server with 3 Harddisks 74Gb Raid5
> I would like to install a 4th disk as a backup.
> I never did this before. What will happen when I plug this disk in,

you wish to add the 4th device as a hot spare to your RAID5?

> will it install itself?
> how will it appear?
> When one of the disks should fail in the future, can I pull out this 4th
> disk and plug it in as replacement for the failing disk?
> Or there some things I have to take care of?

1. partition it in exactly the same way as the other disks.
Assuming It's a single large partition, make sure that the partition is
labelled as 'fd' (or Linux RAID autodetect).

2. run 'partprobe' to inform the kernel about your new partition(s)

3. Add it to your RAID5 as a hot spare to the raid array (assuming it's
called /dev/md0):

mdadm /dev/md0 -a /dev/sdd1

(assuming the new disk is /dev/sdd and you have a partition on it called
sdd1)

4. Now
mdadm --detail /dev/md0
should show you have 4 devices, one is a spare device. This will
automatically be used to replace a failed disk.

If you want to remove a failing disk now (/dev/sdb1 for example) you can

5. fail and remove the broken device:
mdadm /dev/md0 -f /dev/sdb1
mdadm /dev/md0 -r /dev/sdb1

6 let the array rebuld itself. You can see this happening in /proc/mdstat:
watch 'cat /proc/mdstat'


7. You should now be able to physically remove the failed device (you'll
probably have to shut down for this unless you have hotpluggable disks)

HTH

Stuart

-- 
Stuart Sears RHC*
"It's today!" said Piglet.
"My favourite day," said Pooh.




More information about the fedora-list mailing list