Differences between revisions 4 and 5
Revision 4 as of 2016-02-26 14:01:09
Size: 671
Comment:
Revision 5 as of 2016-02-26 14:10:57
Size: 963
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
The example below shows how to create a software RAID0 array on Debian systems:
{{{#!highlight Bash
The example below shows how to create a software RAID1 array on Debian systems. Disk partitions /dev/hda1 and /dev/hdc1 will be used as the member of the RAID arrays.
== Install the `mdadm` package==

{{{#!highlight Bash numbers=disable
Line 5: Line 6:
fdisk and create partitions type 0xfd
{{{#!highlight Bash
== Create the RAID1 array==
Create disk
partitions with type `0xfd`.
{{{#!highlight Bash numbers=disable
Line 9: Line 11:
mkfs.ext3 /dev/md0 }}}
== Create filesystem (i.e. ext3) on RAID1 block device (md0) ==
{{{#!highlight Bash numbers=disable
mkfs.ext3 /dev/md0

The example below shows how to create a software RAID1 array on Debian systems. Disk partitions /dev/hda1 and /dev/hdc1 will be used as the member of the RAID arrays. == Install the mdadm package==

apt-get install mdadm

== Create the RAID1 array== Create disk partitions with type 0xfd.

mdadm --zero-superblock /dev/hda /dev/hdc
mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/hd["ac"]1

Create filesystem (i.e. ext3) on RAID1 block device (md0)

mkfs.ext3 /dev/md0

Add entry to fstab:

/dev/md0 /home ext3 noatime,rw 0 0

Create mdadm config file:

panther:~# cat /etc/mdadm/mdadm.conf
ARRAY /dev/md0 devices=/dev/hda1,/dev/hdc1 level=1 num-devices=2 auto=yes
DEVICE /dev/hda1 /dev/hdc1

Note that the array is actually started in /etc/rc0.d/S50mdadm (via mdadm -A -s) or mdrun command