From owner-freebsd-questions@FreeBSD.ORG Sun Jul 27 14:29:09 2014 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7765DCE1 for ; Sun, 27 Jul 2014 14:29:09 +0000 (UTC) Received: from avasout08.plus.net (avasout08.plus.net [212.159.14.20]) by mx1.freebsd.org (Postfix) with ESMTP id 0ABC620C2 for ; Sun, 27 Jul 2014 14:29:08 +0000 (UTC) Received: from curlew.milibyte.co.uk ([84.92.153.232]) by avasout08 with smtp id XSRz1o001516WCc01SS0R5; Sun, 27 Jul 2014 15:26:00 +0100 X-CM-Score: 0.00 X-CNFS-Analysis: v=2.1 cv=TaoYtHgh c=1 sm=1 tr=0 a=lfSX4pPLp9EkufIcToJk/A==:117 a=lfSX4pPLp9EkufIcToJk/A==:17 a=D7rCoLxHAAAA:8 a=0Bzu9jTXAAAA:8 a=_gelNhxkGRwA:10 a=q7qFsdcGiHYA:10 a=ZTb9aqGL9YkA:10 a=8nJEP1OIZ-IA:10 a=UY1zap3WvK5RYwQuHFUA:9 a=wPNLvfGTeEIA:10 Received: from curlew.lan ([192.168.1.13]) by curlew.milibyte.co.uk with esmtp (Exim 4.82_1-5b7a7c0-XX) (envelope-from ) id 1XBPOg-0000vS-Ho for freebsd-questions@freebsd.org; Sun, 27 Jul 2014 15:25:59 +0100 From: Mike Clarke To: freebsd-questions@freebsd.org Date: Sun, 27 Jul 2014 15:25:57 +0100 Message-ID: <1855317.BxjNgUaonN@curlew.lan> User-Agent: KMail/4.12.5 (FreeBSD/9.1-RELEASE-p17; KDE/4.12.5; amd64; ; ) In-Reply-To: <1947386.pOQVzt1YdP@curlew.lan> References: <1947386.pOQVzt1YdP@curlew.lan> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 192.168.1.13 X-SA-Exim-Mail-From: jmc-freebsd2@milibyte.co.uk X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on curlew.lan X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham autolearn_force=no version=3.4.0 Subject: Re: Backing up zfs system to external disk Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="iso-8859-1" X-SA-Exim-Version: 4.2 X-SA-Exim-Scanned: Yes (on curlew.milibyte.co.uk) X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Jul 2014 14:29:09 -0000 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. -- Mike Clarke