OPNsense Forum

Archive => 18.1 Legacy Series => Topic started by: dcol on March 31, 2018, 08:25:02 pm

Title: Image backup using Clonezilla
Post by: dcol on March 31, 2018, 08:25:02 pm
Using OPNsense 17.1, I was able to fully image and restore a disk using Clonezilla.
With OPNsense 18.1.5, Cloneziila restores do not restore the configuration data. The OPNsense system is fine, but starts up like a newly installed system with no interface settings. Tried it with 2 identical to the source disks.

I am not even sure that Clonezilla is the right image tool to use. I need a tool that I can do a full disk image backup and recreate a disk in my office to send out to my client. This disk should be able to load and run OPNsense the same as when imaged. Any suggestions?
Title: Re: Image backup using Clonezilla
Post by: fabian on March 31, 2018, 08:35:38 pm
A cool tool to image devices is the fog project (https://fogproject.org/). However every image tool that creates disk images should restore the same state as when the image has been created because the data should not be modified.
Title: Re: Image backup using Clonezilla
Post by: dcol on March 31, 2018, 09:39:34 pm
Just tested HDD Raw Copy for Windows and I can confirm that it works. It does a sector to sector image.
It is free - Get it here http://hddguru.com/software/HDD-Raw-Copy-Tool/ (http://hddguru.com/software/HDD-Raw-Copy-Tool/)
Title: Re: Image backup using Clonezilla
Post by: elektroinside on March 31, 2018, 09:43:13 pm
For Windows, I've been using Macrium Reflect Free, since forever :)
It's simply brilliant.
Title: Re: Image backup using Clonezilla
Post by: dcol on March 31, 2018, 09:51:53 pm
I use Macrium Reflect also. Actually I am a reseller for them and use the SiteManager and Agent for all my clients. I did try it, but it was taking too long, then I found HDD Raw copy and that seems to be a lot quicker.
I will try Macrium again, but I suspect you need to use the advanced sector copy.
Title: Re: Image backup using Clonezilla
Post by: elektroinside on March 31, 2018, 10:05:11 pm
Oh, very nice!
Just talked about images earlier today with marjohn56, that I'll probably need one as i broke my setup too many times lately and might expect a fs crash any time..
Title: Re: Image backup using Clonezilla
Post by: fabian on March 31, 2018, 10:26:28 pm
@elektroinside there will probably be a Nextcloud backup feature in the near future so you can just upload the config files automatically.
Title: Re: Image backup using Clonezilla
Post by: dcol on March 31, 2018, 10:53:01 pm
More info on imaging OPNsense.
Tried Macrium and it did not work. Made a sector image and the restored disk did not boot.
HDD Raw works.
Another note. You have to prep the target disk with HDD Raw by clearing the partitions.
Title: Re: Image backup using Clonezilla
Post by: Tubs on March 31, 2018, 11:26:33 pm
there will probably be a Nextcloud backup feature in the near future so you can just upload the config files automatically.

This is a good idea. I like Nextcloud.

But why not put simple FTP or SFTP on the list of to-dos before implementing all availiable cloud services in this world? I assume with only FTP you can already reach a big target group.
Title: Re: Image backup using Clonezilla
Post by: fabian on April 01, 2018, 12:15:53 am
But why not put simple FTP or SFTP on the list of to-dos before implementing all availiable cloud services in this world? I assume with only FTP you can already reach a big target group.
FTP is insecure and problematic when NAT is used and SCP is already available for experimenting if desired (experimental plugin), and may be integrated into core in the future like Nextcloud and Google Drive.
Title: Re: Image backup using Clonezilla
Post by: elektroinside on April 01, 2018, 10:43:40 am
@elektroinside there will probably be a Nextcloud backup feature in the near future so you can just upload the config files automatically.

That's very nice.

What is disappointing is that Macrium fails (at the moment)... didn't expect that, it never failed on me, with anything.

Thanks dcol for the report!
Title: Re: Image backup using Clonezilla
Post by: dcol on April 01, 2018, 06:34:23 pm
I don't like or trust cloud apps. Will never use them.

Macrium is great in Windows, but apparently not so good with other OS'es.

Unfortunately doing a hard backup like this is the only way to get a full backup of OPNsense. Using the configuration backup or the cloud does not install packages or any customization's you may have installed.
Title: Re: Image backup using Clonezilla
Post by: elektroinside on April 01, 2018, 11:43:24 pm
Yeah, and in my case it's the only way to avoid reinstalling 17.5 first, then upgrade, if i want a "clean & fresh" install.
Title: Re: Image backup using Clonezilla
Post by: bartjsmit on April 02, 2018, 11:22:48 am
I don't like or trust cloud apps. Will never use them.

NextCloud has an on-premises version https://nextcloud.com/athome/

Bart...
Title: Re: Image backup using Clonezilla
Post by: dcol on April 02, 2018, 04:50:54 pm
Nextcloud Server does not support Microsoft Windows. Otherwise I would consider it.
Title: Re: Image backup using Clonezilla
Post by: fabian on April 02, 2018, 05:50:53 pm
Nextcloud Server does not support Microsoft Windows. Otherwise I would consider it.
A VM or a (docker) container is no option?
How about LSW (Linux Subsystem for Windows)?
Title: Re: Image backup using Clonezilla
Post by: dcol on April 02, 2018, 06:47:24 pm
Don't want Linux. I am not comfortable working with it.
Title: Re: Image backup using Clonezilla
Post by: elektroinside on April 02, 2018, 11:14:20 pm
Maybe you could give it a chance...
At first i didn't like it either, i couldn't even find a distro without some sorts of problems. But then i settled with Ubuntu Server without a GUI (not the Desktop version with a GUI, which i think sucks). I don't need an interface, most of the servers i run on it don't need one. It's much more stable like this. Sure.. they crash sometimes from even sneezing near them (or feels like it), but i backup everything. For low power boxes, it's a great choice in the end. Just saying that it deserves a second chance :)
Title: Re: Image backup using Clonezilla
Post by: dcol on April 03, 2018, 06:49:15 pm
Running another system just to backup OPNsense sounds like overkill to me. VM's make a system too congested.

Right now what I do is a configuration backup, then create a new system, then follow my notes on reconstruction. Takes about 45 minutes. Can't use HDD Raw on a production system because I have to take it down for 30 minutes while I do the backup.

Besides, would NextCloud backup the system as an image with all my added files and packages?
Title: Re: Image backup using Clonezilla
Post by: fabian on April 03, 2018, 06:56:45 pm
It backups only the configuration from a running OPNsense installation. This has the advantage that there is no downtime and it is fully automated. It is not a disk image.
Title: Re: Image backup using Clonezilla
Post by: dcol on April 03, 2018, 07:12:36 pm
Then NextCloud doesn't give me anything I don't already have other than a scheduled configuration backup.
I would prefer the Google Cloud setup, if the docs were better. Never got that to work.
Title: Re: Image backup using Clonezilla
Post by: elektroinside on April 03, 2018, 08:00:51 pm
I have a Linux machine which i use for many other things. You get to use it for many things once you have it :)

My Google Drive backup works perfectly, do you need any help with it?
Title: Re: Image backup using Clonezilla
Post by: dcol on April 04, 2018, 01:49:21 am
I was waiting for new docs to implement the Google backup. The current docs don't match the choices from Google. If you know how to do it, write a tutorial and I will try it again. Thanks
Title: Re: Image backup using Clonezilla
Post by: ThePOO on April 04, 2018, 05:41:02 am
@dcol      Could I have a copy of your notes on reconstruction?

I have backed up my configuration and then installed OPNsense on a new piece of hardware and then restored my configuration.    I have had this work perfectly a time or two.    Then I get a restoration that just leaves stuff out.    Pretty strange.

If you have a "reconstruction" recommendation/formulae/suggestion I'd love to partake of that ..... 'cause I'd like to have some assurance that what I backed up can be reliably restored.

Thanks tons.

P.S.:   If there IS a HDD imaging tool anyone comes up with that works I'd be interested in that method as well.
Title: Re: Image backup using Clonezilla
Post by: fabian on April 04, 2018, 08:34:34 am
P.S.:   If there IS a HDD imaging tool anyone comes up with that works I'd be interested in that method as well.
The best tool I know to create a disk image is "dd".
Title: Re: Image backup using Clonezilla
Post by: ThePOO on April 04, 2018, 03:24:13 pm
P.S.:   If there IS a HDD imaging tool anyone comes up with that works I'd be interested in that method as well.
The best tool I know to create a disk image is "dd".

Venerable tool ... now why didn't I think of that !!!     Thanks a lot.
Title: Re: Image backup using Clonezilla
Post by: dcol on April 08, 2018, 11:11:30 pm
Is there a way to use 'dd' within an OPNsense shell to create an image, let's say, on a USB stick? That would be ideal.

Otherwise, as I stated earlier. HD Raw copy is the best free full image tool for Windows.
Title: Re: Image backup using Clonezilla
Post by: Davesworld on April 08, 2018, 11:30:12 pm
Is there a way to use 'dd' within an OPNsense shell to create an image, let's say, on a USB stick? That would be ideal.

Otherwise, as I stated earlier. HD Raw copy is the best free full image tool for Windows.

If it's a big enough usb stick no problem.
Title: Re: Image backup using Clonezilla
Post by: fabian on April 09, 2018, 10:01:53 am
If it's a big enough usb stick no problem.
The input or output of dd can be piped through a compression tool like gzip, xz, etc.
Title: Re: Image backup using Clonezilla
Post by: dcol on April 12, 2018, 04:45:13 pm
Well then I will try it today and report back. If it looks good, then maybe I will do a tutorial on doing an image backup and restore. USB sticks are cheap so that is no issue. Probably a good idea to use a bootable USB stick too.
Then you can boot to a FreeBSD shell and then do the restore.
Title: Re: Image backup using Clonezilla
Post by: dcol on April 12, 2018, 06:00:42 pm
Seems there is no way to image a mounted running system using dd or any other FreeBSD available command.
If I have to take OPNsense down to image it, I might as well use HDD Raw Copy Tool in Windows.

Does anyone know of a way to image a running OPNsense system? I am sure there are third party tools out there, but it would have to be a plug-in. What would be ideal is a scheduled image backup plug-in for OPNsense. Now I am dreaming, sorry.
Title: Re: Image backup using Clonezilla
Post by: fabian on April 12, 2018, 11:01:39 pm
The only way to implement that would be on a storage using a copy on write snapshot which be used for a backup.
Title: Re: Image backup using Clonezilla
Post by: dcol on April 13, 2018, 08:10:57 pm
Wow, Guess there are some things Windows can do better than Linux. oh well.
Title: Re: Image backup using Clonezilla
Post by: CDuv on May 07, 2018, 04:00:53 pm
But why not put simple FTP or SFTP on the list of to-dos before implementing all availiable cloud services in this world? I assume with only FTP you can already reach a big target group.
FTP is insecure and problematic when NAT is used and SCP is already available for experimenting if desired (experimental plugin), and may be integrated into core in the future like Nextcloud and Google Drive.
What about SSH (scp)?
Title: Re: Image backup using Clonezilla
Post by: fabian on May 07, 2018, 06:24:42 pm
What about SSH (scp)?
Porting has not been finished (https://github.com/opnsense/core/blob/master/src/opnsense/mvc/app/library/OPNsense/Backup/Scp.php#L115) - there is a not for production use developer preview of a plugin that offers that.