Date: Sat, 26 Jul 2014 16:27:56 -0500 From: CyberLeo Kitsana <cyberleo@cyberleo.net> To: Mike Clarke <jmc-freebsd2@milibyte.co.uk>, freebsd-questions@freebsd.org Subject: Re: Backing up zfs system to external disk Message-ID: <53D41D5C.1010003@cyberleo.net> In-Reply-To: <1947386.pOQVzt1YdP@curlew.lan> References: <1947386.pOQVzt1YdP@curlew.lan>
next in thread | previous in thread | raw e-mail | index | archive | help
On 07/26/2014 07:14 AM, Mike Clarke wrote: > > I've put together a script that backs up my zfs system to a zfs pool > on an external ESATA drive. > > 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. > > I tried creating the backup pool with the "-m none" option to avoid > this but it didn't help. It only appears to apply to datasets created > with "zfs create" - datasets resulting from "zfs receive" retain their > original mountpoints. > > As a workaround I've created the following rc script which checks for > and exports the backup pool before the local filesystems are mounted > and seems to work OK. Since this isn't part of the base system I ought > to put it in /usr/local/etc/rc.d but it needs to run before /usr is > mounted so I had to put it in /etc/rc.d. > > I was wondering if there was a better way of solving this problem > without breaking to the normal file system hierarchy? Set canmount=off or noauto on the backup datasets. Beware that this property is not inherited, so you must explicitly set it on every dataset for which you wish to avoid auto-mounting. -- Fuzzy love, -CyberLeo Technical Administrator CyberLeo.Net Webhosting http://www.CyberLeo.Net <CyberLeo@CyberLeo.Net> Furry Peace! - http://www.fur.com/peace/
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?53D41D5C.1010003>