ZFS Backup on remote FreeBSD system
Karl Denninger
karl at denninger.net
Wed May 15 19:06:37 UTC 2019
On 5/15/2019 13:58, Christian Barthel wrote:
> Hello,
> I am using FreeBSD on my notebook and send ZFS
> snapshots over to a second FreeBSD machine. The full
> command for doing an initial (full) backup is:
>
> zfs send -R zroot/usr/home@${DTIME} | \
> ssh ${user}@${HOST} zfs recv -Fdvu zroot/host1
>
> According to zfs(1), all properties and descendant file
> systems are copied as well (and of course, this works
> as described). However, it also sets the mountpoint
> and canmount option and after a reboot of the backup
> host, ZFS mounts those file systems. I am planning to
> have multiple hosts beneath zroot i.e. zroot/host1,
> zroot/host2, ... and because of that, I would prefer
> not automounting those file systems or mount them below
> /zroot/hostX/ (*). Is this possible somehow i.e. is
> there a simple way to do that? Anyone doing something
> similar?
Set "canmount=noauto" on the received filesystem before you export the
pool it is received to or reboot the machine (which will otherwise mount
all declared filesystems that have mountpoints and "canmount=yes" set.
> Should I set each mountpoint on the backup system
> manually?
You can set "mountpoint=none" too if you want once it has been received
which will remove the mountpoint from the zfs filesystem entirely;
either will work fine.
> Will this property change when sending an incremental
> backup with -Ri or will it be reset again? In that
> case, it would be necessary to set it every time after
> syncing.
It will not be reset on an incremental send so once you change it on the
receiving end it will remain "sticky". If you want to keep track of
where it's supposed to be mounted on the other end "canmount=noauto"
will preserve the actual setting but not act on it.
I use this paradigm regularly here both locally (to a "backup" pool) and
for remote systems that are sync'd to a backup location
("pool/archive/Backups") on my primary server.
You only need to set the canmount property once when the initial
send/receive is done.
--
Karl Denninger
karl at denninger.net <mailto:karl at denninger.net>
/The Market Ticker/
/[S/MIME encrypted email preferred]/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4897 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20190515/5dc61980/attachment.bin>
More information about the freebsd-questions
mailing list