Search Engine



RedhatEnterpriseLinux Blog

How to Create & Configure New Raid Partition

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
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.


Post a Comment

Powered by Blogger.


Copyright © Redhat Enterprise linux. Original Concept and Design by My Blogger Themes
My name is Abdul Razaq but people call me Raziq. Here is my home page: I live in Quetta, Pakistan and work as an IT-Engineer.