Imaging complete FreeNAS install incl. jails?

Status
Not open for further replies.

hsaff

Dabbler
Joined
Jul 19, 2014
Messages
21
Folks,

is there any way to make a complete image of a FreeNAS install incl. jails? Background: I want to use the image as a backup-option in case the machine breaks and I just replace the hardware with an identical one.
Avoiding the need to reinstall all the jail stuff as it takes hours.

For me it seems nearly impossible, as jails and FreeNAS basic system are most likely stored on different drives...but anyhow, maybe someone has found a way.

So I assume I need to 1) make an image of the USB drive and 2) need to make an image of the HDD where jails and system dataset are located? Will that work?

Anyone experience with using a large USB drive (32 or 64 GB) for all system files - FreeNAS basic system and jails? Can the system dataset be moved to USB too? Experiences with reliability of that setup?

Regards
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
The system is stored on a USB flash drive, while the jails and .system are stored in separate ZFS datasets. There's no way to put the jails or .system dataset onto the boot USB device, but you could (if you chose) put them on a second USB drive. I wouldn't recommend it for performance reasons, but it would be possible.

Although it should theoretically be possible to image the USB stick, in practice this doesn't seem to be reliable.

What is the failure mode you're concerned about? If it's the motherboard/CPU/RAM dying, just plug your USB stick and drives into a new motherboard and boot. If you're concerned about the USB stick dying, download a copy of the config database. Then, if/when the stick dies, do a fresh install to a new stick, upload the config database, and you're up and running. The only scenario that kills your jails is loss of the pool on which they're stored. Since they're ZFS datasets, you can replicate them to any other ZFS system you have access to.
 

hsaff

Dabbler
Joined
Jul 19, 2014
Messages
21
Hi danb35,

thanks for spending time on this very hypothetical question.
I am just thinking of the 'worst case': you loose the complete system and have to build it up from scratch (e.g. fire, system fried by lightning/ overvoltage..). Would not be an issue if using FreeNAS just as a NAS, but with the jails extensions...
Ok, very, very theoretical, but I want to be prepared.
So I am just a little bit frightened about storing all files/ images for backup in the correct and corresponding version. So at least to your description you need a minimum of 4 types of data:
1) the FreeNAS system on a USB stick
2) the FreeNAS config file
3) the jails (and jail storage)
4) the shares

In my eyes you have to be very (!) precise when putting them all together on a new system, using the correct version of each of them. Just looking for a way to keep backup of the complete system as simple as possible.

Regards
 

RobertT

Explorer
Joined
Sep 28, 2014
Messages
54
Ok I'll bite.. Purely theoretical.. I am sort of interested in the same thing you are..

So I am going to take this in two parts..
First off the USB.. based on what I have read on the forums it is simple to backup the config database on the USB drive.
Once that is done the loss of the USB would be no big deal. simply make a new USB drive and restore the config.
Link for reference: https://forums.freenas.org/index.php?threads/nightly-check-of-freenas-database.19999/

Now jails. So this isnt something I have read here on the forum but it is derived from my solaris experiences.
I have not tested this on freenas but I can assure you it worked just fine with solaris zones (similar to jails) running on zfs.
What we used to do with our zones was to do periodic snapshot followed by a "zfs send" of the snapshot redirected to a file.
This file could later be restored by piping the file to "zfs receive". We could even "clone" the zone to another system this way.
Anyone ever try this on freenas?

So what you now have left is the storage for the jails and the shares. This is simply a problem of backing up the files themselves.
There are many ways to do this. Rsync to another system. crashplan. copy to usb drive. whatever you deem is appropriate and best
for your data.

Assuming that you backup your USB and your jails to the "storage" and then backup all the storage as files. Restoration would go
something like this. First off setup new freenas box with default config and new zpool. Restore all the storage files. Use the "zfs receive"
to restore the jails dataset. Restore USB config.
 
Status
Not open for further replies.
Top