Configuration of RAID5.

# Configuration of RAID5.
------------------------
# Create the Four partitions which must be raid partitions.
fdisk /dev/hda
n--->l--->Enter the First Cylinder--->+100M--->t--->partition no--->fd--->w.

# Reboot the System or use the following command.
partprobe /dev/hda

# Create the RAID device for above partitions.
mdadm --create /dev/md0 --level=5 --raid-devices=3 /dev/hda{11,12,13} --spare-devices=1 /dev/hda14

# Then format this RAID device.
mke2fs -j /dev/md0

# To view raid device in detail
mdadm --detail /dev/md0

# To view status of RAID device use the command,
watch cat /proc/mdstat OR
cat /proc/mdstat status

# Goto another console and mount the RAID block
mkdir /RAID - /RAID is a mount point.
mount /dev/md0 /RAID

# Copy the /boot partition to /RAID
cd /boot
cp -R * /RAID/

# Fail the one partition in RAID block.
mdadm --manage /dev/md0 --fail /dev/hda12

# Immediately after failing hda12 recovery starts on hda14 which is for spare.

# Then remove the failed partition and add it again in RAID block to reuse.
mdadm --manage /dev/md0 --remove /dev/hda12
mdadm --manage /dev/md0 --add /dev/hda12


Comments

Popular Posts

Install and configure rsyslog Centralized logging server in CentOS

How to fix postfix/smtp Network is unreachable error

Could not join realm: Necessary packages are not installed: sssd-tools sssd libnss-sss libpam-sss adcli