Re: How to duplicate a pool with zfs send/recv without breaking mountpoints?

From: Thomas Backman <serenity_at_exscape.org>
Date: Thu, 21 May 2009 10:42:27 +0200
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_at_$NOW && zfs send -R  
>> tank_at_$NOW | zfs recv -vFd slave/received && zpool export slave &&  
>> zpool import slave
>> [root_at_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_at_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_at_chaos ~]# ls /dev
>> [root_at_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
Received on Thu May 21 2009 - 06:42:48 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:48 UTC