Assembling MD devices for recovery (Linux)

In Linux, when performing recovery from a disk backup to an existing MD device (also called Linux Software RAID), make sure that this device is assembled at the time of recovery.

If the device is not assembled, assemble it by using the mdadm utility. Here are two examples:

Example 1. The following command assembles the device /dev/md0 combined of the volumes /dev/sdb1 and /dev/sdc1:

mdadm –assemble /dev/md0 -ayes /dev/sdb1 /sdc1

Example 2. The following command assembles the device /dev/md0 combined of the disks /dev/sdb and /dev/sdc:

mdadm –assemble /dev/md0 -ayes /dev/sdb /dev/sdc

If the recovery requires the machine to be rebooted (usually, when the volumes to recover include the boot partition), follow these guidelines:

  • If all parts of the MD device are volumes (a typical case, such as in the first example), make sure that the type of each volume—called partition type or system ID—is Linux raid automount; the hexadecimal code of this partition type is 0xFD. This will guarantee that the device will be automatically assembled following the reboot. To view or change the partition type, use a disk partitioning utility such as fdisk.
  • Otherwise (such as in the second example), perform the recovery from bootable media. No reboot will be required in that case. In bootable media, you may need to create the MD device manually or automatically, as described in Recovering MD devices and logical volumes.

Assembling MD devices for recovery (Linux)