RAID on CentOS

From HostThyself

Jump to: navigation, search

This Guide introduces the installation of RAID on CentOS using the text based install.

Description in ths guide is based on the following configuration.

  • CentOS 4.4
  • Pentium 4
  • 2 identical harddisk connected to primary and secondary master
  • mdamd, utility for configuring RAID

Contents

[edit] Preparation

First, if you are installing for the first time, get yourself familiar with the technical information (see references below).

[edit] Installation

This information is based on a fresh install of CentOS 4.4 from the ServerCD.

[edit] Install grub on both disk

grub
 root (hd0,0)
 setup (hd0)
 root (hd1,0)
 setup (hd1)
 quit

[edit] Partition

[edit] Configuration

[edit] Remove a partition from an array

Fail the partition

mdadm --fail /dev/md1 /dev/sda1

Remove the partition

mdadm -r /dev/md1 /dev/sda1

[edit] Replacing a faulty disk

Add an identical disk and start up system.

/dev/sda - existing disk

/dev/sdb - new disk

  • Clone partition from sda to sdb
sfdisk -l
sfdisk -d /dev/sda | sfdisk /dev/sdb
sfdisk -l

Double check before executing, this can destroy data.

  • Re-setup RAID
mdadm -a /dev/md0 /dev/sdb1

Add the right RAID partition to the respective RAID device use this to check

cat /proc/mdstat


[edit] mdadm

Some useful commands:

  • mdadm --detail /dev/md0

Remove a faulty device

  • mdadm -r /dev/md0 /dev/sda2

Add a device

  • mdadm -a /dev/md0 /dev/sda2

[edit] References

System Administration Guide:

Personal tools