New on LowEndTalk? Please Register and read our Community Rules.
How to restore data from raid
Hello,
Had a server with OVH and my primary disk crashed but was running raid so had backup. They replaced the disk but how can i restore data back to new disk and bring server online?
Screenshot: https://prnt.sc/Yj3pQUktLePr
Comments
1st: A raid is no backup.
2nd: Looks like you're using mdraid, so resilver it as soon as your faulty disk got replaced?
https://www.thomas-krenn.com/en/wiki/Mdadm_recovery_and_resync
Hello! Here is the brief manual of how to do it:
Remove the failed disk:
mdadm /dev/md127 -r $FAILEDPARTITION
If encountering "devices or resource busy" error, follow these commands:
mdadm --manage /dev/md127 --fail $FAILEDPARTITION
Check drive and its partitions:
cat /proc/mdstat
Prepare the new disk with the same partition layout:
For GPT:
sgdisk --backup=sdх_parttable_gpt.bak /dev/sda
sgdisk --load-backup=sdх_parttable_gpt.bak /dev/sdb
For MBR:
sfdisk --dump /dev/sdx > sdх_parttable_mbr.bak (Create)
sfdisk /dev/sdb < sdх_parttable_mbr.bak (Restore)
Note: Create a backup before pasting the partition table.
Add the new hard drive to the RAID1 array:
mdadm /dev/md127 -a /dev/sdx
After synchronization, check the status:
cat /proc/mdstat
Best to take the help of the provider for a quicker and safe data recovery.