LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   A question about Raid 1 backups (https://www.linuxquestions.org/questions/linux-server-73/a-question-about-raid-1-backups-4175626665/)

pappin 03-30-2018 09:14 AM

A question about Raid 1 backups
 
I've just upgraded to software Raid 1 (mdadm) when I upgraded to Debian Stretch so my knowledge of Raid is a little thin at the moment.

Our backup before moving to raid was daily tape backups of user data and a weekly image backup of the hdd with an automated Clonezilla live which was fairly quick at less than 30 minutes.

With moving to raid 1 the Clonezilla live backup now takes over 3 hours using dd so its a real pain now.

I wondered if I would cause any problems with the Raid 1 if I did this instead.

Down the server and remove one of the mirrored drives - sdb (without running mdadm to remove it !! ) then insert a clean drive and resync.

In the event of needing to go back to a backup remove all drives from the server and then insert the original backup drive I removed alongside a clean drive and then resync. After resync restore user data from backup tape - We'd still be keeping the tape backups !!

Would that work without causing any problems to the raid setup. Its certainly a lot quicker and simpler to let the drives resync than using any of the other options I've looked at

The disk drives are all sata.

Thanks

jlinkels 03-30-2018 09:28 AM

Hardware swaps to do a backup seem an extremely bad idea to me.

For one thing, when resyncing a RAID1 array, the boot sectors are not mirrored. So if you finished syncing your new drive, you will not be able to boot from it. Unless you install GRUB on the new drive.

This is something to always take into account. It might be that it you choose RAID1 during system installation, the installer installed GRUB on both disks. If you created your RAID1 manually you have to install GRUB manually.

Linux is able to boot from RAID1. Which is a blessing in disguise because it does not force you to have a separate boot partition. With the risk that you did not have the boot loader on the mirrored disk.

jlinkels

syg00 03-30-2018 05:56 PM

And just yanking a drive out then re-booting seems an extremely bad idea to me.
Great to test your environment - i.e. you should have already done it, and thus know the answer, but awful as a long-term strategy. Too many variables - spilt coffee, bent connector, power short ....

If you have a body available, it certainly is an option, but I'd fail the drive (mdadm) then replace it. The RAID will know to come up degraded and replacing the drive should be cleaner.
As per jlinkels concerns, you'd better fail sda and test booting sdb after all this. That might get interesting.
FWIW I reckon image backups are the pits, but each to their own. Also, you are attacking the symptom, not the problem. Clonezilla is not dealing with the mdadm (maybe also LVM, you haven't said) setup properly if it is falling back to using dd. dd is known to be slow, and will do the entire disk, used or not, whereas clonezilla will (last I looked some years ago) use partimage or similar to only backup used data blocks.

pappin 03-31-2018 11:43 AM

Thanks for the replies - you've given me a few points to think about.

jlinkels I tested to see if grub was installed during the sync process and it seems on my system it is and the subsequent mirrored drive is bootable.

syg00 It looks like at the moment Clonezilla doesn't support software raid ( mdadm ) and dd is just way too slow.

I note the points both of you have made though and I will keep looking for an alternative.

Thanks again

tofino_surfer 03-31-2018 01:44 PM

Quote:

With moving to raid 1 the Clonezilla live backup now takes over 3 hours using dd so its a real pain now.
Is there any reason you need to keep using Clonezilla ? Using rsync for backups will avoid the problems you are likely having as it will copy only the data that exists and not the whole disk as with dd. It would handle mdadm, LVM as it just copies the data in the file system.

pappin 04-01-2018 04:42 AM

Hi tofino_surfer,

Thanks for your input

I'm aware of rsync but the tape backup is working fine for backing up user files.

I'm looking for a disk clone solution to give me a bare metal type recovery if its needed.


All times are GMT -5. The time now is 11:51 AM.