Adding a new RAID1 array using mdadm

Goals:
Add 2 new physical hard drives: /dev/hdc and /dev/hdd
Create RAID1 mirror /dev/md6
Automatically mount new partition in /raid

1. fdisk one of the newly added hard drives:
fdisk /dev/hdc
n, p, 1, <enter>, <enter>
t, fd
w

2. dump new partition table to the other disk:
sfdisk -d /dev/hdc | sfdisk /dev/hdd

3. create new RAID1 set/device:
mdadm --create /dev/md6 --level=1 --raid-disks=2 /dev/hdc1 /dev/hdd1

4. format the newly created array:
mkfs.ext3 /dev/md6

5. create mount point for new array:
mkdir /raid

6. append new mount point to /etc/fstab:
/dev/md6 /raid ext3 defaults 0 0

7. mount:
mount

8. reboot if you’re paranoid.

Comments

Leave a Reply