CentOS / RHEL : How to assemble a software RAID in Rescue mode

mdadm (multiple devices admin) is an extremely useful tool for running RAID systems. It’s is a tool for creating, managing, and monitoring RAID devices using the md driver. It can be used as a replacement for the raidtools, or as a supplement. The pos describes a way to assemble a software RAID in rescue mode.

1. Boot into rescue mode.

2. First create the mdadm.conf file with the disks available

# mdadm --examine --scan >> /etc/mdadm.conf

3. Assemble the array

# mdadm --assemble --scan /dev/md0

4. If you do not use LVM, you can stop here and mount the partitions available on the software raid device md0
For example,

# mkdir /test
# mount /dev/md0 /test

If you use LVM, please continue at step 5.

5. Scan the lvm devices

# pvscan
# vgscan

6. Activate the lvm volumes

# vgchange -ay

7. Similar to step 4., mount the logical volumes

# mkdir /data
# mount /dev/mapper/rootvg-lv_root /data
Related Post