Score:0

Can you install GRUB on an MDADM Raid 1 device before it's added to the MD array?

id flag

So we have our 2 OS drives in a Raid 1 MDADM mirror. One of these drives has failed. Typically after replacing the failed drive, we do a sfdisk command to match the partition table, and then add the device into the MD array (which starts copying/syncing data from the old drive). Once the rebalance/copying of data by MDADM is complete, we install grub on the new drive with "grub-install /dev/sdb".

I am wondering can we install grub on the new drive before we add the drive into the MDADM array? So basically before actual data gets copied to the drive when you run "mdadm --manage /dev/md0 --add /dev/sdb", can we install grub before this?

So the proposed steps:

  1. Replace Failed Drive
  2. Use sfdisk to copy the partition table from the active drive to the new drive
  3. Install grub on the new drive with "grub-install /dev/sdb"
  4. Add the drive into the MDADM array with "mdadm --manage /dev/md0 --add /dev/sdb

The main reason for this, is that we have some automation that does the steps, and instead of waiting for the rebalance % and copying of data to complete from the "mdadm --manage /dev/md0 --add /dev/sdb", which would require some logic changing, wanted to see if we can just do the grub install on the new/empty drive before adding to the MDADM raid 1 array?

Thanks

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.