Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 15 Jul 2020 16:20:43 -0700
From:      David Christensen <dpchrist@holgerdanske.com>
To:        freebsd-questions@freebsd.org
Subject:   Re: Backup before reinstall
Message-ID:  <9e4e6120-8400-0f77-3c21-f48349fecdbc@holgerdanske.com>
In-Reply-To: <20200715153213.5961e091@uni-dortmund.de>
References:  <20200715153213.5961e091@uni-dortmund.de>

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help
On 2020-07-15 06:32, Christian Baer wrote:
> Greetings Programs! :-)
> 
> One of my boxes is still running FreeBSD 10. Everything is updated to
> include the latest patches, but the time has come to move on. :-)
> 
> Trying an update over multiple major releases is almost guaranteed to
> break the system - even if it's done in steps - so I have decided to
> reinstall everything. This will also get rid of some redundant stuff I
> have installed.
> 
> This machine is used as a server and I haven't installed X at all. What
> I do utilize heavily is Geli and ZFS (als RAIDZ2).
> 
> I don't mind reconfiguring a few things on foot after the reinstall.
> But I really want to be able to access my encrypted RAIDZ again. :-)
> 
> The system boots from a 128GB SSD. This holds all the partitions for /,
> /usr /var and swap. Nothing on the SSD is encrypted, because I want the
> system to be able to boot without any "help". This is the only physical
> device that will get erased during the reinstall.
> 
> 
> The raidz has it's own mountpoint (under /zfs) and contains three
> subvolumes, which are mounted in different places (one of them is
> /home). The raidz spans seven HDDs, which are all encrypted with geli.
> To be clear: The drives were encrypted first and the raidz spans the
> encrypted (.eli) devices.
> 
> The setup isn't really too complicated. What I don't know is where
> FreeBSD stored the information about what belongs to the raidz etc. Is
> there something special I need to backup to be sure all of this is
> reusable again?
> 
> I could of course backup the whole SSD. But there is a lot of junk
> there I won't need again (most of the data probably), so if I can, I
> would try to only backup the useful stuff.
> 
> I would appriciate any advice!
> 
> Cheers!
> Chris
> 
> P.S. Before anyone tells me that backups are important: I have backups,
> but only of the data on the raidz. This is what I considered to be
> important, not so much the system. So if this goes wrong, I could
> restore everything, but that would take much longer than I'd care to
> sit in front of the computer. :-P

I have a SOHO LAN with a FreeBSD server (12.1-RELEASE, ZFS, jails, 
Samba, and CVS) and Linux, Windows, macOS, and iOS clients.


I put my system images on separate devices (2.5" SATA SSD).  I put my 
data, backups, archives, and images on other devices (3.5" SATA HDD, 
optical media).


I install mobile racks in my desktops and servers.  I have a stack of 
SSD's with one OS on each.  I strive to configure my systems so that I 
can mix and match system drives, data drives, and chassis as required.


I backup my system images in multiple ways (deliberate overkill):

1.  I create a CVS project for every system:

     a.  Plain text administrator log.

     b.  Any created or modified system configuration files (e.g. /etc/*).

     c.  Other files as required.

2.  I use ZFS boot and root, and install with copies=2.

3.  I use zfs-auto-snapshot for boot and root.

4.  I take raw images with dd(1) as required and periodically.

5.  I do a daily rsync(1) of the contents of the root file system to a 
"backup" ZFS filesystem (which also has zfs-auto-snapshot).  (ZFS 
replication would be faster, but rsync might stop a ZFS send and/or 
receive bug.)


For OS major upgrades, I prefer to do a fresh install on another 
computer, and then migrate data and services.  But, this requires twice 
the hardware.  Thus, I have spare computers (and lots of parts).


For an in-place migration on a single computer, I remove the old system 
drive, disconnect data the drives, insert a blank system drive, install, 
update the OS, connect the data drives, check out the old configuration 
files to an alternate location, migrate settings by hand, and bring 
services up one by one.  Next steps include taking an image of the new 
system drive and adjusting backup/ archive processes.


AIUI ZFS metadata is stored inside the ZFS virtual devices.  So, unless 
you are doing things with /etc/fstab or otherwise, I have found that ZFS 
"just works" whenever I rearrange ZFS devices.


If you use ZFS on boot and root via the FreeBSD installer, one problem I 
have not solved is that the pool with the boot filesystem is named 
"bootpool" on every FreeBSD system.  I have not attempted to change the 
pool name, because I assume this will break the boot process.  But if I 
insert two drives with two bootpool's into the same system, strange 
things happen.  If anyone has a solution or work-around, please advise.


David



Want to link to this message? Use this URL: <http://docs.FreeBSD.org/cgi/mid.cgi?9e4e6120-8400-0f77-3c21-f48349fecdbc>