Skip to content

Instantly share code, notes, and snippets.

@alishir
Last active October 1, 2021 12:17
Show Gist options
  • Save alishir/b760359fa6583899a8256d43bf8a908c to your computer and use it in GitHub Desktop.
Save alishir/b760359fa6583899a8256d43bf8a908c to your computer and use it in GitHub Desktop.
# clear MBR
dd if=/dev/sdOld of=/dev/sdNew bs=512 count=1
# replicate sdOld partition table
sfdisk -d /dev/sdOld | sfdisk /dev/sdNew
# add new disk to RAID
mdadm --manage /dev/md12X --add /dev/sdNewX
mount /dev/centos/root /mnt/custom
for i in /dev /dev/pts /proc /sys /run; do mount -B $i /mnt/custom$i; done
chroot /mnt/custom /bin/bash
# reinstall kernel
yum reinstall kernel
grub2-install /dev/sda
grub2-install /dev/sdb
grub2-mkconfig -o /boot/grub2/grub.cfg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment