Backing up zfs system to external disk
jmc-freebsd2 at milibyte.co.uk
Sun Jul 27 14:29:09 UTC 2014
On Saturday 26 July 2014 13:14:16 Mike Clarke wrote:
> The script imports the backup pool with the -N option to avoid
> mounting filesystems on top of the running system, updates the
> backup pool to the latest snapshot with zfs send | zfs receive and
> then exports the backup pool.
> This normally works fine except in the rare cases when the system
> is shut down or crashes while the backup pool is still imported.
> If this happens then problems arise on the next reboot because
> filesystems will be mounted from both the system and backup pools
> using identical mountpoints.
After further study of the manpages and some experiments I now see the
cause of my problem. I should have used "zpool import -N -o
cachefile=none". This creates a temporary pool which is not cached so
will not be available for mounting next time the system is booted.
This now leads me to wonder why the -N option doesn't follow the
design of "-R /some_mountpoint" and "-o altroot=/some_mountpoint",
both of which default to set cachefile to none. Is there some subtle
reason for the -N option not doing the same or is this a bug in the
system? I can't imagine any situation where anyone would want to
import a pool without mounting it and require it to be automatically
mounted after rebooting.
More information about the freebsd-questions