In this guide, the drive /dev/sdb has been replaced. Please be careful when referencing this guide, remembering to specify the correct drive/partitions that apply to your scenario!
This will output the multi-disk status. Below is an example of two properly functioning RAID arrays.
Reference the example below where a failed drive (sdb) has been replaced with a new blank drive and therefore the status reads [2/1] and [U_] since out of 2 devices in the array, only 1 is functional and only 1 is up. This is because the sda drive is still functioning while the sdb drive has been replaced and needs to be added back into the array and rebuilt. The output shows that the sdb drive has failed by the trailing (F) behind sdb3 and sdb1
There is also a potential that instead of one of the devices in each array being marked as failed, one of the devices in each array may not be listed at all. In such a case, the next step can be skipped.
If the failed drive (in this example, sdb) has partitions listed, these partitions must be deleted. If instead of the above, your output does not have any partitions listed but instead has Disk /dev/sdb doesn't contain a valid partition table you can skip the next step.
Enter the p command and press ENTER to print the partition tables.
Press the d key and press ENTER to delete a partition and then enter 1 to delete the 1st partition.
Follow the same process for the rest of the partitions.
Issue the p command to print the partition table again and ensure that all partitions have been removed.\
Press the w key and press ENTER to write and save the partition table.
We now need to reboot the server to delete the partitions and re-read the partition tables. Use the shutdown -r now command to reboot the server.
Run the mkswap command followed by the partition that holds the swap.
Then run the swapon command for the same partition.
To find out which partitions should be added to which array, use the cat /etc/mdadm.conf command.
First, check to make sure the the md1 array has finished rebuilding by using the cat /proc/mdstat command once again.
If you were performing the previous steps in rescue mode, please boot the server into the normal mode through the 1&1 Recovery Tool before following the next steps.
This will set up GRUB on the first hard drive (sda) and the second hard drive (sdb). GRUB uses its own designation hd0 for sda and hd1 for sdb.