From owner-freebsd-current@FreeBSD.ORG Thu May 21 08:42:48 2009 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8857A1065670 for ; Thu, 21 May 2009 08:42:48 +0000 (UTC) (envelope-from serenity@exscape.org) Received: from ch-smtp01.sth.basefarm.net (ch-smtp01.sth.basefarm.net [80.76.149.212]) by mx1.freebsd.org (Postfix) with ESMTP id 18B148FC0C for ; Thu, 21 May 2009 08:42:47 +0000 (UTC) (envelope-from serenity@exscape.org) Received: from c83-253-252-234.bredband.comhem.se ([83.253.252.234]:47633 helo=mx.exscape.org) by ch-smtp01.sth.basefarm.net with esmtp (Exim 4.69) (envelope-from ) id 1M73rL-000782-5H; Thu, 21 May 2009 10:42:41 +0200 Received: from [192.168.1.5] (macbookpro [192.168.1.5]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mx.exscape.org (Postfix) with ESMTPSA id 81C20335DE; Thu, 21 May 2009 10:42:27 +0200 (CEST) Message-Id: <7AB57D31-AE15-480D-8D2D-7AA000555CD2@exscape.org> From: Thomas Backman To: Henri Hennebert In-Reply-To: <4A151263.2070708@restart.be> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v935.3) Date: Thu, 21 May 2009 10:42:27 +0200 References: <4A151263.2070708@restart.be> X-Mailer: Apple Mail (2.935.3) X-Originating-IP: 83.253.252.234 X-Scan-Result: No virus found in message 1M73rL-000782-5H. X-Scan-Signature: ch-smtp01.sth.basefarm.net 1M73rL-000782-5H 45b1d53c2f5ae0585ec18c0a651e0d26 Cc: freebsd-current@freebsd.org Subject: Re: How to duplicate a pool with zfs send/recv without breaking mountpoints? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 May 2009 08:42:48 -0000 On May 21, 2009, at 10:35 AM, Henri Hennebert wrote: > Thomas Backman wrote: >> I'll let the output speak for itself. This is after running >> zpool create slave X && zfs create slave/received && NOW=$(date >> +"backup-%Y%m%d-%H%M"); zfs snapshot -r tank@$NOW && zfs send -R >> tank@$NOW | zfs recv -vFd slave/received && zpool export slave && >> zpool import slave >> [root@chaos ~]# mount >> tank/root on / (zfs, local, noatime) >> devfs on /dev (devfs, local) >> /dev/ad0s1a on /bootdir (ufs, local, soft-updates) >> tank/tmp on /tmp (zfs, local, noatime) >> tank/usr on /usr (zfs, local, noatime) >> tank/usr/ports on /usr/ports (zfs, local, noatime) >> tank/usr/ports/distfiles on /usr/ports/distfiles (zfs, local, >> noatime) >> tank/usr/src on /usr/src (zfs, local, noatime) >> tank/var on /var (zfs, local, noatime) >> //SERENITY@EXSCAPE/FBSDBACKUP on /mnt/backup (smbfs) >> slave/received/root on / (zfs, local, noatime) >> slave on /slave (zfs, local) >> slave/received/tmp on /tmp (zfs, local, noatime) >> slave/received/usr on /usr (zfs, local, noatime) >> slave/received/usr/ports on /usr/ports (zfs, local, noatime) >> slave/received/usr/ports/distfiles on /usr/ports/distfiles (zfs, >> local, noatime) >> slave/received/usr/src on /usr/src (zfs, local, noatime) >> slave/received/var on /var (zfs, local, noatime) >> [root@chaos ~]# ls /dev >> [root@chaos ~]# zfs list >> internal error: failed to initialize ZFS library (shocking!) >> Any ideas? I tried setting the mountpoint property on the slave, >> but I'm pretty sure that didn't help (as the next (incremental) >> backup resets the mountpoints to /... again, I suppose). > > How about creating slave like this: > > mkdir /slave > zpool create -R /slave -m none slave X > > Henri As always, when asking for help, the solution pops up right after posting. :-) I fixed it this morning, using pretty much your approach. However, according to the man pages, altroot isn't a permanent property, so I simply import it with zpool import -R every time. It'd be great if there is a better way, but this seems to work just fine. Regards, Thomas