When creating partitions to use for the RAID device, make sure they are of type Linux raid auto. In fdisk, this is partition id fd. After creating the partitions for the RAID device, use the following
syntax as the root user to create the RAID device:
mdadm --create
/dev/mdX --level=<num> --raid-devices=<num> <device list>
The progress of the device creation
can be monitored with the following command
as root:
tail -f /proc/mdstat
For example,
to create a RAID level 1 device /dev/md0 from three partitions, use the
following command:
mdadm --create
/dev/md0 --level=1 --raid-devices=3 /dev/sda5 /dev/sda6 /dev/sda7
The command cat /proc/mdstat should show output similar.
Creating a RAID Array
Personalities : [raid0]
[raid1]
md0 : active raid1 sda7[2] sda6[1]
sda5[0]
10241280 blocks [3/3] [UUU]
[>....................] resync = 0.0% (8192/10241280) finish=62.3min
speed=2730K/sec
unused devices: <none>
The RAID device /dev/md0 is created. Next, create a filesystem
on it. To create an ext3
filesystem, execute the following as root:
mke2fs -j /dev/md0
If the new RAID device is to be used as the swap partition, use the following
command as root instead:
mkswap /dev/md0
Copy any data over to the new device and be sure to change all references to the old partition to the new RAID device, including /etc/fstab and /etc/grub.conf. It is recommended that the /boot and the / filesystems remain on their original filesystems to ensure the system can still boot after added the RAID devices. Partitions such as /home will benefit
from RAID more because data on it changes frequently.
0 comments:
Post a Comment