Recently (like last week-end) my Pi that runs local DNS died, I did an
'apt update;apt upgrade', the /boot partition went read only and there
was no kernel to boot from (the "7 short flashes" code from the LEDs
was actually quite handy). Presumably the SD card failed in some way.
I have good backups and was able to recover everything but it took
quite a while (like Sunday morning) and, as a result I've been
wondering if there's something I can do better.
My existing backups are incremental backups taken daily of /etc and
/home thus restoring the system meant that I got a new clean image,
wrote my backups of /etc and /home to it and was back running again.
However there were a few gotchas on the way, a few symbolic links from
/etc had to be mended as well as installing some extra packages
(fortunately I list packages I've added when I add them - very
important!).
So, what could I have done to make things quicker/easier?
My incremental backups are automatic and run every night, when they're
more than a month old the system weeds some of them out but I have
monthly backups for some years back now. I'm not aiming to change this.
However some sort of nightly 'image copy' would make what I had to do
on Sunday much easier. It has to be automatic (i.e. run by anacron or
cron) or it won't get done. This is a headless system so it has to
be non-GUI too (with the advantage that as it's a "Lite" installation
there's only about 1.5Gb of it to back up).
Is there some sort of "make an image copy of this system" I can run on
the Pi to write an image to another system? I'd just keep a single
image I think and overwrite it every night, it's a "restore and get it running quickly" backup I want, not the same as I have with the
incremental backups. If the image is bad for some reason then I can
always fall back to my incremental backups.
What's recommended (if anything)?
On 02/08/2021 10:29, Chris Green wrote:
Recently (like last week-end) my Pi that runs local DNS died, I did an
'apt update;apt upgrade', the /boot partition went read only and there
was no kernel to boot from (the "7 short flashes" code from the LEDs
was actually quite handy). Presumably the SD card failed in some way.
I have good backups and was able to recover everything but it took
quite a while (like Sunday morning) and, as a result I've been
wondering if there's something I can do better.
My existing backups are incremental backups taken daily of /etc and
/home thus restoring the system meant that I got a new clean image,
wrote my backups of /etc and /home to it and was back running again. However there were a few gotchas on the way, a few symbolic links from
/etc had to be mended as well as installing some extra packages (fortunately I list packages I've added when I add them - very
important!).
So, what could I have done to make things quicker/easier?
My incremental backups are automatic and run every night, when they're
more than a month old the system weeds some of them out but I have
monthly backups for some years back now. I'm not aiming to change this.
However some sort of nightly 'image copy' would make what I had to do
on Sunday much easier. It has to be automatic (i.e. run by anacron or cron) or it won't get done. This is a headless system so it has to
be non-GUI too (with the advantage that as it's a "Lite" installation there's only about 1.5Gb of it to back up).
Is there some sort of "make an image copy of this system" I can run on
the Pi to write an image to another system? I'd just keep a single
image I think and overwrite it every night, it's a "restore and get it running quickly" backup I want, not the same as I have with the
incremental backups. If the image is bad for some reason then I can
always fall back to my incremental backups.
What's recommended (if anything)?
Well one way is to take the SD card out put it in a reader and take an image
On 02/08/2021 10:29, Chris Green wrote:
Recently (like last week-end) my Pi that runs local DNS died, I did anWell one way is to take the SD card out put it in a reader and take an
'apt update;apt upgrade', the /boot partition went read only and there
was no kernel to boot from (the "7 short flashes" code from the LEDs
was actually quite handy). Presumably the SD card failed in some way.
I have good backups and was able to recover everything but it took
quite a while (like Sunday morning) and, as a result I've been
wondering if there's something I can do better.
My existing backups are incremental backups taken daily of /etc and
/home thus restoring the system meant that I got a new clean image,
wrote my backups of /etc and /home to it and was back running again.
However there were a few gotchas on the way, a few symbolic links from
/etc had to be mended as well as installing some extra packages
(fortunately I list packages I've added when I add them - very
important!).
So, what could I have done to make things quicker/easier?
My incremental backups are automatic and run every night, when they're
more than a month old the system weeds some of them out but I have
monthly backups for some years back now. I'm not aiming to change this.
However some sort of nightly 'image copy' would make what I had to do
on Sunday much easier. It has to be automatic (i.e. run by anacron or
cron) or it won't get done. This is a headless system so it has to
be non-GUI too (with the advantage that as it's a "Lite" installation
there's only about 1.5Gb of it to back up).
Is there some sort of "make an image copy of this system" I can run on
the Pi to write an image to another system? I'd just keep a single
image I think and overwrite it every night, it's a "restore and get it
running quickly" backup I want, not the same as I have with the
incremental backups. If the image is bad for some reason then I can
always fall back to my incremental backups.
What's recommended (if anything)?
image
I am not sure if you can do that over a network in a live system.
So, what could I have done to make things quicker/easier?
Is there some sort of "make an image copy of this system" I can run on
the Pi to write an image to another system? I'd just keep a single
image I think and overwrite it every night,
What's recommended (if anything)?
Chris Green wrote on 02-08-2021 at 11:29:
What's recommended (if anything)?
Apart from any backup strategy: boot from a USB disk (SSD would be good) which almost certainly more reliable and probably faster than SD card.
Well one way is to take the SD card out put it in a reader and take an image
Is there some sort of "make an image copy of this system" I can run on
the Pi to write an image to another system? I'd just keep a single
image I think and overwrite it every night, it's a "restore and get it
running quickly" backup I want, not the same as I have with the
incremental backups. If the image is bad for some reason then I can
always fall back to my incremental backups.
What's recommended (if anything)?
I am not sure if you can do that over a network in a live system.
You don't want an _image_ copy of a running system - there's all sorts
of things you don't need/want copied - /dev /proc /sys etc.
Just do an ssh/rsync --one-file-system from the backup machine.
E.g.
rsync --archive --one-file-system --exclude=lost+found --exclude=media --exclude=save --exclude=var/cache --exclude=swap --exclude=*~ --delete --delete-excluded --info=STATS1 "machine-to-backup:/" "directory-for-backup"
On Mon, 2 Aug 2021 10:29:44 +0100
Chris Green <cl@isbd.net> wrote:
So, what could I have done to make things quicker/easier?
There are many possibilities.
Running from mirrored drives provides the fastest recovery from
drive failure - not possible with SD cards on a Pi but should be possible booting over USB. You do need to check from time to time and replace bad drives promptly.
Running a failover server provides the fastest recovery from system failure - setting up can be tricky and you need something to tell you when
a system is down otherwise you may not notice until the failover goes down.
Is there some sort of "make an image copy of this system" I can run on
the Pi to write an image to another system? I'd just keep a single
image I think and overwrite it every night,
A better option is probably to keep a master image (several copies) and make a regular backup that is the increment against the master - then restoring is a bit like assembling a docker image. Copy the master and
apply the latest increment.
Whatever you do do not I implore you overwrite a single image every night. Murphy will ensure that the crash happens in the middle of that operation and then your system and the backup are hosed[1]. Keep at least
two images.
Can an old Pi 2 boot from SSD? I know a Pi 4 can.
My incremental backups are automatic and run every night, when they're
more than a month old the system weeds some of them out but I have
monthly backups for some years back now. I'm not aiming to change this.
However some sort of nightly 'image copy' would make what I had to do
on Sunday much easier. It has to be automatic (i.e. run by anacron or
cron) or it won't get done. This is a headless system so it has to
be non-GUI too (with the advantage that as it's a "Lite" installation
there's only about 1.5Gb of it to back up).
Is there some sort of "make an image copy of this system" I can run on
the Pi to write an image to another system? I'd just keep a single
image I think and overwrite it every night, it's a "restore and get it running quickly" backup I want, not the same as I have with the
incremental backups. If the image is bad for some reason then I can
always fall back to my incremental backups.
What's recommended (if anything)?
Chris Green wrote on 02-08-2021 at 12:46:
Can an old Pi 2 boot from SSD? I know a Pi 4 can.
Only the 2B v1.2, apparently: https://www.raspberrypi.org/documentation/hardware/raspberrypi/bootmodes/msd.md
But because it's not USB3 the speed is probably not better than SD card,
I think, and an SSD might be overkill. Maybe a "high endurance" SD card
would be a better investment.
Chris Green <cl@isbd.net> writes:
My incremental backups are automatic and run every night, when they're
more than a month old the system weeds some of them out but I have
monthly backups for some years back now. I'm not aiming to change this.
However some sort of nightly 'image copy' would make what I had to do
on Sunday much easier. It has to be automatic (i.e. run by anacron or cron) or it won't get done. This is a headless system so it has to
be non-GUI too (with the advantage that as it's a "Lite" installation there's only about 1.5Gb of it to back up).
Is there some sort of "make an image copy of this system" I can run on
the Pi to write an image to another system? I'd just keep a single
image I think and overwrite it every night, it's a "restore and get it running quickly" backup I want, not the same as I have with the
incremental backups. If the image is bad for some reason then I can
always fall back to my incremental backups.
What's recommended (if anything)?
I don’t know of a good tool to make image backups as such, though it’s going to boil down to something equivalent to
ssh root@pi cat /dev/mmcblk0 > /path/to/backup.img
...done when the system is idle (if there’s lot of IO going on then the filesystem inside the image will be internally inconsistent).
I had to restore a Pi from backups recently after the SD card failed.
My backups are whole-system backups made with rsync, so once I’d figured out what shape the partitions should be in order to be bootable, it was straightforward to restore the backup onto the new card. It worked first time.
IMO the requirement for an SD card is a weakness in the Pi design, due
to their poor reliability. I don’t know what best alternative approach
is, though, given the need to keep cost and physical size down while remaining flexible.
So, what could I have done to make things quicker/easier?
My incremental backups are automatic and run every night, when they're
more than a month old the system weeds some of them out but I have
monthly backups for some years back now. I'm not aiming to change this.
However some sort of nightly 'image copy' would make what I had to do
on Sunday much easier. It has to be automatic (i.e. run by anacron or
cron) or it won't get done. This is a headless system so it has to
be non-GUI too (with the advantage that as it's a "Lite" installation
there's only about 1.5Gb of it to back up).
Is there some sort of "make an image copy of this system" I can run on
the Pi to write an image to another system? I'd just keep a single
image I think and overwrite it every night, it's a "restore and get it running quickly" backup I want, not the same as I have with the
incremental backups. If the image is bad for some reason then I can
always fall back to my incremental backups.
What's recommended (if anything)?
So, what could I have done to make things quicker/easier?
I have good backups and was able to recover everything but it took
quite a while (like Sunday morning) and, as a result I've been
wondering if there's something I can do better.
You don't want an _image_ copy of a running system - there's all sorts
of things you don't need/want copied - /dev /proc /sys etc.
Just do an ssh/rsync --one-file-system from the backup machine.
E.g.
rsync --archive --one-file-system --exclude=lost+found --exclude=media --exclude=save --exclude=var/cache --exclude=swap --exclude=*~ --delete --delete-excluded --info=STATS1 "machine-to-backup:/" "directory-for-backup"
Chris Elvidge <chris@mshome.net> wrote:
It needs far more than that for what I want to do.You don't want an _image_ copy of a running system - there's all sortsWell one way is to take the SD card out put it in a reader and take
Is there some sort of "make an image copy of this system" I can run
on the Pi to write an image to another system? I'd just keep a
single image I think and overwrite it every night, it's a "restore
and get it running quickly" backup I want, not the same as I have
with the incremental backups. If the image is bad for some reason
then I can always fall back to my incremental backups.
What's recommended (if anything)?
an image
I am not sure if you can do that over a network in a live system.
of things you don't need/want copied - /dev /proc /sys etc.
Just do an ssh/rsync --one-file-system from the backup machine.
E.g.
rsync --archive --one-file-system --exclude=lost+found --exclude=media
--exclude=save --exclude=var/cache --exclude=swap --exclude=*~ --delete
--delete-excluded --info=STATS1 "machine-to-backup:/"
"directory-for-backup"
Apart from anything else there are two file systems to back up:-
Filesystem Type 1M-blocks Used Avail Use% Mounted on /dev/root
ext4 29270 1318 26731 5% / /dev/mmcblk0p1 vfat 253
49 205 20% /boot
I want to have available some sort of clone/image of the system that I
can quickly create a Pi SD image from. So the nightly backup will
create a clone/image/whatever (on another system preferably) and from
that clone/image/whatever I will be able to (quickly) create a working
SD card to plug into the Pi.
A. Dumas <alexandre@dumas.fr.invalid> wrote:
Chris Green wrote on 02-08-2021 at 12:46:
Can an old Pi 2 boot from SSD? I know a Pi 4 can.
Only the 2B v1.2, apparently:
https://www.raspberrypi.org/documentation/hardware/raspberrypi/bootmodes/msd.md
But because it's not USB3 the speed is probably not better than SD card,
I think, and an SSD might be overkill. Maybe a "high endurance" SD card
would be a better investment.
Which is sort of where I came in. :-)
How do I make (and maintain up to date) an image of the SD card?
Chris Elvidge <chris@mshome.net> wrote:
rsync --archive --one-file-system --exclude=lost+found --exclude=mediaIt needs far more than that for what I want to do.
--exclude=save --exclude=var/cache --exclude=swap --exclude=*~ --delete
--delete-excluded --info=STATS1 "machine-to-backup:/" "directory-for-backup" >>
On 02/08/2021 10:29, Chris Green wrote:
So, what could I have done to make things quicker/easier?
My incremental backups are automatic and run every night, when they're
more than a month old the system weeds some of them out but I have
monthly backups for some years back now. I'm not aiming to change this.
However some sort of nightly 'image copy' would make what I had to do
on Sunday much easier. It has to be automatic (i.e. run by anacron or cron) or it won't get done. This is a headless system so it has to
be non-GUI too (with the advantage that as it's a "Lite" installation there's only about 1.5Gb of it to back up).
Is there some sort of "make an image copy of this system" I can run on
the Pi to write an image to another system? I'd just keep a single
image I think and overwrite it every night, it's a "restore and get it running quickly" backup I want, not the same as I have with the
incremental backups. If the image is bad for some reason then I can
always fall back to my incremental backups.
What's recommended (if anything)?
I use timeshift on my main PC and laptops.
I make the backups on a different slab of spinning rust to the system
disk, obviously.
I believe it can be configured to use a network drive for the backups
and I see it is available in the PI repository.
On the few occasions I have needed to recover a system it has worked
very well.
Chris Green <cl@isbd.net> wrote:
So, what could I have done to make things quicker/easier?
Try to separate things into read-only (preferably all things needed to
boot and run the system) and read-write (home, ...). Then put the
read-write stuff on storage other than a sd-card, e.g. hdd.
Make a image of the read-only sd-card, and daily backups of the other
stuff.
Stefan Kaintoch <stefan@ratri.rincewind.kaintoch.de> wrote:
Chris Green <cl@isbd.net> wrote:... and how do I quickly restore from that? You've effectively
So, what could I have done to make things quicker/easier?
Try to separate things into read-only (preferably all things needed to
boot and run the system) and read-write (home, ...). Then put the
read-write stuff on storage other than a sd-card, e.g. hdd.
Make a image of the read-only sd-card, and daily backups of the other
stuff.
described what I already do with my incremental backups. I do daily incremental backups of everything that changes.
My issue was it took a while to:-
Create a clean new Pi system
Add/move users as required
do 'apt update;apt upgrade'
restore /etc and /home from my incremental backups
That's pretty much what it would take to restore from the backups
you're suggesting above.
nev young <newsforpasiphae1953@yahoo.co.uk> wrote:
On 02/08/2021 10:29, Chris Green wrote:It doesn't do what I want though.
So, what could I have done to make things quicker/easier?I use timeshift on my main PC and laptops.
My incremental backups are automatic and run every night, when they're
more than a month old the system weeds some of them out but I have
monthly backups for some years back now. I'm not aiming to change this. >>>
However some sort of nightly 'image copy' would make what I had to do
on Sunday much easier. It has to be automatic (i.e. run by anacron or
cron) or it won't get done. This is a headless system so it has to
be non-GUI too (with the advantage that as it's a "Lite" installation
there's only about 1.5Gb of it to back up).
Is there some sort of "make an image copy of this system" I can run on
the Pi to write an image to another system? I'd just keep a single
image I think and overwrite it every night, it's a "restore and get it
running quickly" backup I want, not the same as I have with the
incremental backups. If the image is bad for some reason then I can
always fall back to my incremental backups.
What's recommended (if anything)?
I make the backups on a different slab of spinning rust to the system
disk, obviously.
I believe it can be configured to use a network drive for the backups
and I see it is available in the PI repository.
On the few occasions I have needed to recover a system it has worked
very well.
Its basic function in life is to restore your system to how it was
some time ago, hence its name. (I.e. it does incremental backups,
just like I do already, and very handy they are too)
It doesn't do remote backups/copies (which I'd prefer, though not
essential).
It doesn't provide a restore for a non-bootable system, you have to
create a bootable system, install timeshift on that and then do a
restore. That's as much work as my restoring from my home-made
incremental backups.
I repeat! :-) :-) :-)
I want a system that provides me with either a ready to boot SD card
with my current system on it or, an 'image' that I can quickly copy to
an SD card and can boot.
Can an old Pi 2 boot from SSD? I know a Pi 4 can.
Only the 2B v1.2, apparently:
https://www.raspberrypi.org/documentation/hardware/raspberrypi/bootmodes/msd.md
But because it's not USB3 the speed is probably not better than SD card,
I think, and an SSD might be overkill. Maybe a "high endurance" SD card
would be a better investment.
Which is sort of where I came in. :-)
I repeat! :-) :-) :-)
I want a system that provides me with either a ready to boot SD card
with my current system on it or, an 'image' that I can quickly copy to
an SD card and can boot.
The BeagleBone Black has an on-board eMMC memory with an SD slot as an >alternative, I don't know if the eMMC is inherently any better than an >external SD though.
Stefan Kaintoch <stefan@ratri.rincewind.kaintoch.de> wrote:
Chris Green <cl@isbd.net> wrote:... and how do I quickly restore from that? You've effectively
So, what could I have done to make things quicker/easier?
Try to separate things into read-only (preferably all things needed to
boot and run the system) and read-write (home, ...). Then put the
read-write stuff on storage other than a sd-card, e.g. hdd.
Make a image of the read-only sd-card, and daily backups of the other
stuff.
described what I already do with my incremental backups. I do daily >incremental backups of everything that changes.
My issue was it took a while to:-
Create a clean new Pi system
Add/move users as required
do 'apt update;apt upgrade'
restore /etc and /home from my incremental backups
That's pretty much what it would take to restore from the backups
you're suggesting above.
Re: Disaster recovery, how to automate as far as possible?
By: Chris Green to All on Mon Aug 02 2021 10:29 am
I have good backups and was able to recover everything but it took
quite a while (like Sunday morning) and, as a result I've been
wondering if there's something I can do better.
It depends on your need for availability. I suppose you don't want to do anything complex. I assume you are'nt using any CoW filesystem or snapshotting
volume manager in your pi.
You cannot really take an SD card snapshop from a running system without risking bad problems. To the point problems are close to guaranteed, unless you
use some snapshotting system.
I personally use a cronjob that turns off the services that may perform changes
on the filesystems and them dump the filesystems sequentially over a network for my personal servers. The drawback is the services go down while you back them up. Thankfully my personal servers don't need 24/7 availability and the backup will be done and the services operational once again when needed. You can script a backup service that dumps the filesystems of the pi to an SD card
over a network and then sets a bootloader for it, but sincerely I think it is more trouble than it is worth.
On 02/08/2021 15:57, Chris Green wrote:
Stefan Kaintoch <stefan@ratri.rincewind.kaintoch.de> wrote:
Chris Green <cl@isbd.net> wrote:... and how do I quickly restore from that? You've effectively
So, what could I have done to make things quicker/easier?
Try to separate things into read-only (preferably all things needed to
boot and run the system) and read-write (home, ...). Then put the
read-write stuff on storage other than a sd-card, e.g. hdd.
Make a image of the read-only sd-card, and daily backups of the other
stuff.
described what I already do with my incremental backups. I do daily incremental backups of everything that changes.
My issue was it took a while to:-
Create a clean new Pi system
Add/move users as required
do 'apt update;apt upgrade'
restore /etc and /home from my incremental backups
That's pretty much what it would take to restore from the backups
you're suggesting above.
I'm assuming you want to get up and running ASAP after a disaster?
So I would prepare for it by doing your normal incremental backups
then copying them (at your leisure) to a (or many) spare SD Card at
regular intervals.
Then when the inevitable happens you should only need to swap the most
recent backup SD card into the dead Pi.
Or have I still not got what you want right in my head?
Recently (like last week-end) my Pi that runs local DNS died, I did an
'apt update;apt upgrade', the /boot partition went read only and there
was no kernel to boot from (the "7 short flashes" code from the LEDs
was actually quite handy). Presumably the SD card failed in some way.
I have good backups and was able to recover everything but it took
quite a while (like Sunday morning) and, as a result I've been
wondering if there's something I can do better.
My existing backups are incremental backups taken daily of /etc and
/home thus restoring the system meant that I got a new clean image,
wrote my backups of /etc and /home to it and was back running again.
However there were a few gotchas on the way, a few symbolic links from
/etc had to be mended as well as installing some extra packages
(fortunately I list packages I've added when I add them - very
important!).
So, what could I have done to make things quicker/easier?
My incremental backups are automatic and run every night, when they're
more than a month old the system weeds some of them out but I have
monthly backups for some years back now. I'm not aiming to change this.
However some sort of nightly 'image copy' would make what I had to do
on Sunday much easier. It has to be automatic (i.e. run by anacron or
cron) or it won't get done. This is a headless system so it has to
be non-GUI too (with the advantage that as it's a "Lite" installation
there's only about 1.5Gb of it to back up).
Is there some sort of "make an image copy of this system" I can run on
the Pi to write an image to another system? I'd just keep a single
image I think and overwrite it every night, it's a "restore and get it running quickly" backup I want, not the same as I have with the
incremental backups. If the image is bad for some reason then I can
always fall back to my incremental backups.
What's recommended (if anything)?
Re: Re: Disaster recovery, how to automate as far as possible?
By: Chris Elvidge to The Natural Philosopher on Mon Aug 02 2021 11:56 am
You don't want an _image_ copy of a running system - there's all sorts
of things you don't need/want copied - /dev /proc /sys etc.
Just do an ssh/rsync --one-file-system from the backup machine.
E.g.
rsync --archive --one-file-system --exclude=lost+found --exclude=media --exclude=save --exclude=var/cache --exclude=swap --exclude=*~ --delete --delete-excluded --info=STATS1 "machine-to-backup:/" "directory-for-backup"
Yeah, but he wants a bootable backup image I think.
That's pretty much what it would take to restore from the backups
you're suggesting above.
No... /etc and /home would be on the external hard-drive -- no restore
for their contents, unless the hard-drive itself fails. If the SD card
fails, you swap the card and reboot. You do have to keep the SD card image up-to-date -- so periodic swapping to run the apt update/upgrade cycle may
be recommended.
On 02/08/2021 10:29, Chris Green wrote:
Recently (like last week-end) my Pi that runs local DNS died, I did an
'apt update;apt upgrade', the /boot partition went read only and there
was no kernel to boot from (the "7 short flashes" code from the LEDs
was actually quite handy). Presumably the SD card failed in some way.
I have good backups and was able to recover everything but it took
quite a while (like Sunday morning) and, as a result I've been
wondering if there's something I can do better.
My existing backups are incremental backups taken daily of /etc and
/home thus restoring the system meant that I got a new clean image,
wrote my backups of /etc and /home to it and was back running again. However there were a few gotchas on the way, a few symbolic links from
/etc had to be mended as well as installing some extra packages (fortunately I list packages I've added when I add them - very
important!).
So, what could I have done to make things quicker/easier?
My incremental backups are automatic and run every night, when they're
more than a month old the system weeds some of them out but I have
monthly backups for some years back now. I'm not aiming to change this.
However some sort of nightly 'image copy' would make what I had to do
on Sunday much easier. It has to be automatic (i.e. run by anacron or cron) or it won't get done. This is a headless system so it has to
be non-GUI too (with the advantage that as it's a "Lite" installation there's only about 1.5Gb of it to back up).
Is there some sort of "make an image copy of this system" I can run on
the Pi to write an image to another system? I'd just keep a single
image I think and overwrite it every night, it's a "restore and get it running quickly" backup I want, not the same as I have with the
incremental backups. If the image is bad for some reason then I can
always fall back to my incremental backups.
What's recommended (if anything)?
Does rpi-clone do what you want? Scripting for rsync with lots of
options for cloning an SD card
https://github.com/billw2/rpi-clone
Dennis Lee Bieber <wlfraed@ix.netcom.com> wrote:
You can't automate "periodic swapping", so (knowing me) it won't getThat's pretty much what it would take to restore from the backups
you're suggesting above.
No... /etc and /home would be on the external hard-drive -- no
restore
for their contents, unless the hard-drive itself fails. If the SD card
fails, you swap the card and reboot. You do have to keep the SD card
image up-to-date -- so periodic swapping to run the apt update/upgrade
cycle may be recommended.
done.
The Pi I want to back up runs only DNS/DHCP for my LAN, there are
other services running but none are actually in use.
--
Chris Green
Stefan Kaintoch <stefan@ratri.rincewind.kaintoch.de> wrote:
Chris Green <cl@isbd.net> wrote:... and how do I quickly restore from that? You've effectively
So, what could I have done to make things quicker/easier?
Try to separate things into read-only (preferably all things needed to
boot and run the system) and read-write (home, ...). Then put the
read-write stuff on storage other than a sd-card, e.g. hdd.
Make a image of the read-only sd-card, and daily backups of the other
stuff.
described what I already do with my incremental backups. I do daily incremental backups of everything that changes.
My issue was it took a while to:-
Create a clean new Pi system
Add/move users as required
do 'apt update;apt upgrade'
restore /etc and /home from my incremental backups
That's pretty much what it would take to restore from the backups
you're suggesting above.
Re: Re: Disaster recovery, how to automate as far as possible?
By: Chris Green to Richard Falken on Mon Aug 02 2021 05:51 pm
The Pi I want to back up runs only DNS/DHCP for my LAN, there are
other services running but none are actually in use.
--
Chris Green
Then, your work is easy.
Get PiCore. It is a Tiny Core Linux port for the Raspberry Pi. YOu can configure it to boot from the SD card, copy the whole operating system to RAM,
and then forget the SD card exists.
You just remaster the SD card with the configuration you want for your DNS and
DHCP. The content of the SD card is never changed. There is no data persistence
unless you manually -or scriptedly- command the OS to copy data to disk.
This allows you to have a BASE operating system which never changes stored in the SD. If there is data you want to save, you trigger a "store to disk" command, which saves the changes between the running system in RAM and the base
system in the SD as a tar file.
And then you can send that tar file over a network.
Which is GREAT because you may have two PiCore SDs ready, use one for production, command it to save the tar overlay every 24 hours and send the tar
to a backup server periodically. If you ever need to recover using the second SD, you just copy the tar file to the second SD and boot. Just copy. No imaging, no uncompressing, no anything.
Still I recommend the backup to be done with services stopped.
So, what could I have done to make things quicker/easier?
My incremental backups are automatic and run every night, when they're
more than a month old the system weeds some of them out but I have
monthly backups for some years back now. I'm not aiming to change this.
However some sort of nightly 'image copy' would make what I had to do
on Sunday much easier. It has to be automatic (i.e. run by anacron or
cron) or it won't get done. This is a headless system so it has to
be non-GUI too (with the advantage that as it's a "Lite" installation
there's only about 1.5Gb of it to back up).
Is there some sort of "make an image copy of this system" I can run on
the Pi to write an image to another system? I'd just keep a single
image I think and overwrite it every night, it's a "restore and get it running quickly" backup I want, not the same as I have with the
incremental backups. If the image is bad for some reason then I can
always fall back to my incremental backups.
On 02/08/2021 10:29, Chris Green wrote:
So, what could I have done to make things quicker/easier?
My incremental backups are automatic and run every night, when they're
more than a month old the system weeds some of them out but I have
monthly backups for some years back now. I'm not aiming to change this.
However some sort of nightly 'image copy' would make what I had to do
on Sunday much easier. It has to be automatic (i.e. run by anacron or cron) or it won't get done. This is a headless system so it has to
be non-GUI too (with the advantage that as it's a "Lite" installation there's only about 1.5Gb of it to back up).
Is there some sort of "make an image copy of this system" I can run on
the Pi to write an image to another system? I'd just keep a single
image I think and overwrite it every night, it's a "restore and get it running quickly" backup I want, not the same as I have with the
incremental backups. If the image is bad for some reason then I can
always fall back to my incremental backups.
What I do is start by taking a copy of the SD card as an image file on
to my NAS drive. Where the Pi's are using USB sticks, they are set up
with with a boot and a root partition, just like an SD card, so the
image can be updated with the boot partition from the SD card, and the
root partition from the USB stick.
Every night I run a cron script to rsync the days changed files from the
boot and root partitions of each Pi to the corresponding partition of
the image file on the NAS. That way if any of the machine's storage
fails, I can immediately write the image on to a new SD card (or USB
stick) and be back up running in minutes.
druck <news@druck.org.uk> wrote:
On 02/08/2021 10:29, Chris Green wrote:
So, what could I have done to make things quicker/easier?
My incremental backups are automatic and run every night, when they're more than a month old the system weeds some of them out but I have monthly backups for some years back now. I'm not aiming to change this.
However some sort of nightly 'image copy' would make what I had to do
on Sunday much easier. It has to be automatic (i.e. run by anacron or cron) or it won't get done. This is a headless system so it has to
be non-GUI too (with the advantage that as it's a "Lite" installation there's only about 1.5Gb of it to back up).
Is there some sort of "make an image copy of this system" I can run on the Pi to write an image to another system? I'd just keep a single
image I think and overwrite it every night, it's a "restore and get it running quickly" backup I want, not the same as I have with the incremental backups. If the image is bad for some reason then I can always fall back to my incremental backups.
What I do is start by taking a copy of the SD card as an image file on
to my NAS drive. Where the Pi's are using USB sticks, they are set up
with with a boot and a root partition, just like an SD card, so the
image can be updated with the boot partition from the SD card, and the
root partition from the USB stick.
Every night I run a cron script to rsync the days changed files from the boot and root partitions of each Pi to the corresponding partition of
the image file on the NAS. That way if any of the machine's storage
fails, I can immediately write the image on to a new SD card (or USB
stick) and be back up running in minutes.
Yes, I think this sounds a good approach. One can mount the image
file on the backup system so that it's partitions and files are
visible so - as you say - you can rsync the changes across.
It'll take a little configuring and setting up but not a lot and once
running smoothly I can go back to ignoring it all again! :-)
Thanks for all the input everyone.
--
Chris Green
·
What I do is start by taking a copy of the SD card as an image file onto my NAS drive. Where the Pi's are using USB sticks, they are set up
with with a boot and a root partition, just like an SD card, so the
image can be updated with the boot partition from the SD card, and the
root partition from the USB stick.
Every night I run a cron script to rsync the days changed files from the
boot and root partitions of each Pi to the corresponding partition of
the image file on the NAS. That way if any of the machine's storage
fails, I can immediately write the image on to a new SD card (or USB
stick) and be back up running in minutes.
I make sure I've got an up to date archive copy before I do
any system upgrade, so I can go back to the previous version if problems
only show up after the nightly backup has updated the previous image.
Sysop: | deepend |
---|---|
Location: | Calgary, Alberta |
Users: | 264 |
Nodes: | 10 (0 / 10) |
Uptime: | 34:00:14 |
Calls: | 2,002 |
Files: | 4,428 |
D/L today: |
19 files (9,003K bytes) |
Messages: | 410,084 |