Did you know  45Drives offers free  public and private  webinars ? Click here to learn more  & register! Build & Price

KB450022 – Rebuilding Failed Redundant Boot Drives

You are here:

How do I know one of my boot drives has failed?

Open the Disk Utility and scroll down to your RAID devices. If one of them has failed you will see DEGRADED. Alternately you may open a terminal and enter the command “cat /proc/mdstat” This will list the current status of all RAIDs you have in your system. for md0 and md1 you will see [U] or [U] indicating a drive is missing out of the array.

How do I rebuild my redundant boot drives?

When one of your redundant boot drives fail follow these steps to bring it back: NOTE You will need a replacement HDD the EXACT same size of the HDD you are replacing.

  • Turn off your machine
  • Replace the failed boot drive with the exact same capacity HDD. Remove the old drive from the Boot drive bracket and install its replacement.
  • Boot in the OS, and open disk utility. Note the label of your replacement HDD (i.e /dev/sdb)
  • You must copy the partition scheme from your current boot drive to the replacement before we can rebuild the array.
  • To do this you will use the following command:
  sfdisk -d /dev/sd[live boot drive] | sfdisk /dev/sd[replacement boot drive] -f

Where live boot drive is the current boot disk, /dev/sda and the replacement boot drive is /dev/sdb. These device names will be accurate as long as these are only devices in the motherboard SATA ports. Note that this command takes the partition scheme on the first device and completely copies it onto the second device.

IF THERE IS ANY DATA ON THE SECOND DEVICE IT WILL BE DELETED. MAKE SURE YOU DO NOT MIX UP YOUR CURRENT BOOT DRIVE AND THE REPLACEMENT

  • You can verify to see this done correctly by viewing the partitions in the disk utility.
  • Alternatively, if using command line, you can use “parted /dev/sdb print”.
  • Now you must reattach your replacement partitions to the live boot ones.
  Open terminal and enter cat /proc/mdstat. Note which disk is live in the array (typically /dev/sda or /dev/sdb) and match the corresponding partitions.
  For example, If /dev/sda is the live disk you will want to attach /dev/sdb1 to /dev/sda1 and /dev/sdb2 to /dev/sda2. where /dev/sdb is the replacement disk
  This done using these commands: (following the same example as above)
  mdadm --manage /dev/md0 --add /dev/sdb1
  mdadm --manage /dev/md1 --add /dev/sdb2
  These device nodes may be different on your system - double check them with "cat /proc/mdstat" to be sure.
  • The rebuild process will begin and you can view the TOC via “cat /proc/mdstat” or for updates “watch cat /proc/mdstat”
  • Progress can be viewed as a progress bar in the Disk Utility or by running the command “watch cat /proc/mdstat” which will give you the status of the RAIDs every 2 seconds.

Reinstall GRUB on Both Drives

Once the RAID rebuild finishes (cat /proc/mdstat shows [UU] for both arrays), you need to reinstall the GRUB bootloader on the replacement drive. GRUB is not part of the mdadm array  it lives in the disk’s boot sector (or EFI partition), so it does not get restored automatically by the resync.

  • Confirm whether the system is BIOS/legacy or UEFI:
  [ -d /sys/firmware/efi ] && echo "UEFI" || echo "BIOS/Legacy"
  • For BIOS/Legacy systems, install GRUB to the MBR of both physical drives (not partitions):
  grub-install /dev/sda
  grub-install /dev/sdb
  • For UEFI systems, the EFI System Partition (ESP) itself needs to be mirrored/present on both drives, and GRUB registered with the firmware for each:
  grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=ubuntu --recheck

Repeat against the replacement drive’s ESP mount point if it’s not the same /boot/efi mount, and confirm both entries show up in:

  efibootmgr -v
  • Run grub-install against both drive device nodes (/dev/sda and /dev/sdb), not just the replacement  this confirms both copies are current and guards against a scenario where the “good” drive’s bootloader was never verified either.

Update initramfs

After reinstalling GRUB, regenerate the initramfs so the new drive’s UUID and any mdadm/array metadata are baked into the boot image:

update-initramfs -u -k all
update-grub

update-grub rescans and rewrites /boot/grub/grub.cfg, picking up the current RAID/UUID configuration. Skipping this step is a common cause of a system that boots fine right after rebuild, but fails to boot weeks later after a kernel update, because the initramfs shipped with that new kernel was never regenerated against the corrected array.

  • Once your drives are done syncing, GRUB is reinstalled on both drives, and initramfs is updated, you have successfully rebuilt your redundant boot drives.
Was this article helpful?
Dislike 0
Views: 1567
Unboxing Racking Storage Drives Cable Setup Power UPS Sizing Remote Access