[CentOS] Accidentally nuked my system - any suggestions ?

Nicolas Kovacs info at microlinux.fr
Wed Dec 5 18:49:21 UTC 2018


Le 05/12/2018 à 08:31, Phil Perry a écrit :
> If you are confident in the state of sda, I would remove sdb from the
> array, copy the partition table from sda to sdb as Stephen suggested
> earlier, then add sdb back to the array and allow the data to be synced:
> 
> For example:
> 
> mdadm --fail /dev/md125 /dev/sdb2
> mdadm --remove /dev/md125 /dev/sdb2
> 
> mdadm --fail /dev/md126 /dev/sdb1
> mdadm --remove /dev/md126 /dev/sdb1
> 
> mdadm --fail /dev/md127 /dev/sdb3
> mdadm --remove /dev/md127 /dev/sdb3
> 
> sfdisk –d /dev/sda | sfdisk /dev/sdb
> 
> then add them back and watch then rebuild:
> 
> mdadm --add /dev/md125 /dev/sdb2
> mdadm --add /dev/md126 /dev/sdb1
> mdadm --add /dev/md127 /dev/sdb3
> 
> After they have all resynced, I would flush the device buffers for good
> measure. For example:
> 
> blockdev --flushbufs /dev/sdb1
> ...
> 
> Lastly, don't forget to reinstall grub to sdb:
> 
> grub2-install --recheck /dev/sdb

Thanks very much for the detailed answer. I'll probably give this a spin
next week, since right now I have an urgent job to finish, and I'm happy
to be able to work on a usable system even though it's a bit sluggish.
As soon as the stress is over, I'll try it out.

cheers,

Niki

-- 
Microlinux - Solutions informatiques durables
7, place de l'église - 30730 Montpezat
Site : https://www.microlinux.fr
Blog : https://blog.microlinux.fr
Mail : info at microlinux.fr
Tél. : 04 66 63 10 32



More information about the CentOS mailing list