Skip to content

Instantly share code, notes, and snippets.

@noslin005
Created February 4, 2020 01:44
Show Gist options
  • Save noslin005/16cfbb522ee8febfdba99384540f1767 to your computer and use it in GitHub Desktop.
Save noslin005/16cfbb522ee8febfdba99384540f1767 to your computer and use it in GitHub Desktop.
Fix mdadm RAID after OS Reinstall
# reassemble the raid
sudo mdadm --assemble --scan
sudo mdadm --detail --scan | sudo tee -a /etc/mdadm.conf
# Rebuild kernel to include the raid configuration
sudo dracut -f /boot/initramfs-$(uname -r).img $(uname -r)
sudo grub2-mkconfig -o /boot/efi/EFI/redhat/grub.cfg
# Remake the file system
sudo sfdik --delete /dev/md0
sudo mkfs.xfs -f /dev/md0
# Add to fstab
sudo echo "UUID=$(blkid -o value -s UUID /dev/md0) /mnt/data0 xfs defaults,nofail 0 0" | tee -a /etc/fstab
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment