HOWTO – Raid 5 Configuration

Here is a good way to build a Raid5 Server

Hardware Requirement :
1 HD 40Gb is enough
4 x HD : bigger is better

Image

These 4 Drives will be in Raid5, so the available size will be 3xHDSize. ex: with 4x 1TB HD, available size will be 3TB

1 Install mdadm using apt-get, or your favorite package manager. mdadm is the tool used to administer Linux md device arrays (software RAID).
2 Partition your drives as appropriate using

Code: Select all
cfdisk /dev/sdx

. Ensure that all partitions are of equal size and the partition type is set to Linux raid autodetect (code FD).
3 Using mdadm create your RAID-5 device:

Code: Select all
mdadm –create /dev/md0 –chunk=64 –level=raid5 –raid-devices=3 /dev/hdc1 /dev/hde1 /dev/sda1

; subsituting for your own /dev/ devices.

4 Check if ok

Code: Select all
cat /proc/mdstat

5 Format your newly created /dev/md0 device in ext3.
mkfs.ext3 /dev/md0

6 Create a mount point for your RAID-5 array and add it to /etc/fstab so it is mounted automatically on the next reboot.

Code: Select all
/dev/md0 /storage ext3 defaults 0 1

Image

Extra:
Managing the RAID device.
Setting a disk faulty/failed:

Code: Select all
mdadm –fail /dev/md0 /dev/hdc1

Removing a faulty disk from an array:

Code: Select all
mdadm –remove /dev/md0 /dev/hdc1

Clearing any previous raid info on a disk:

Code: Select all
mdadm –zero-superblock /dev/hdc1

Adding a disk to an array:

Code: Select all
mdadm –add /dev/md0 /dev/hdc1

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: