Creating an image of the OPNsense disk (PC hardware) as a fall-back

Started by bongo, March 27, 2022, 01:23:05 PM

Previous topic - Next topic
i know, this has been discussed before, but i couldn't find the perfect answer.

i'm actually running 21.7 on a pc hardware, equipped with just an ssd where just OPNsense is installed and running, as well as a few network cards.
before updating to 22.1, i would like to create an image copy of the whole disk, which would allow me to get back to 21.7 asap if i recognize any issues with 22.1, as it is essential for me to have a working internet connection.

i think the best way to do so would be to either attach an usb stick or an usb disk drive which allows to boot from, and access the built-in OPNsense ssd to write an image copy to either an usb stick or a dvd.
if something fails, i could just again boot from this usb stick or cd and restore the generated copy back to the built-in ssd.

what's recommended to do so and is there a step-by-step instruction on how to do it?
or is there a better way to get a copy of the whole system?
or what's the best strategy to always have a fall-back solution at hand if something fails?

Apart from backing up your config through System, Configuration, Backups, you can boot your OPNsense machine from Clonezilla and backup the entire SSD either to a local drive or across the network to a file server. https://clonezilla.org/clonezilla-live.php

For the first option, restore is by offering the downloaded file during the OPNsense installation and for the second is booting from Clonezilla live again.

Note that the Clonezilla backup involves down time of your firewall while the config backup does not.

Bart...

The "cpdup" utility is also installed and can do some funky stuff like remote backup and restore if needed.


Cheers,
Franco


dd, gzip and ssh are in the base system. What else does one need?
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do. (Isaac Asimov)

Quote from: pmhausen on July 08, 2022, 09:36:42 PM
dd, gzip and ssh are in the base system. What else does one need?
True - but you need to boot from a live system at least to restore the data. If you have zfs you can from within the production system create snapshots and revert back without the need to boot from a live system. After rollback just a reboot is needed.

I wasn't intending to answer you, looks like you beat me postin by just a moment. Of course snapshots are great, I'm a strong proponent of using ZFS everywhere.

But if you want an offline image all you really need is already on the system. Same for restore from a live image.
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do. (Isaac Asimov)