Discussion:
zfs send/receive of an entire pool
James Andrewartha
2008-01-17 15:39:02 UTC
Permalink
Hi,

I have a zfs filesystem that I'd like to move to another host. It's part
of a pool called space, which is mounted at /space and has several child
filesystems. The first hurdle I came across was that zfs send only works
on snapshots, so I create one:
# zfs snapshot -r ***@musundo
# zfs list -t snapshot
NAME USED AVAIL REFER MOUNTPOINT
***@musundo 0 - 25.9G -
space/***@musundo 0 - 31K -
space/***@musundo 924K - 52.4G -
space/***@musundo 0 - 38K -
space/freebsd/cvs-***@musundo 0 - 36K -
space/freebsd/***@musundo 0 - 4.11G -
space/***@musundo 0 - 47.6G -
space/***@musundo 352K - 14.7G -
space/netboot/manduba-***@musundo 0 - 95.5M -
space/netboot/manduba-freebsd/***@musundo 0 - 36K -
space/netboot/manduba-freebsd/***@musundo 0 - 327M -
space/netboot/manduba-freebsd/***@musundo 0 - 36K -
space/***@musundo 234K - 167G -

On the destination, I have created a zpool, again called space and
mounted at /space. However, I can't work out how to send ***@musundo
to the new machine:
# zfs send ***@musundo | ssh musundo "zfs recv -vn -d space"
cannot receive: destination 'space' exists
# zfs send ***@musundo | ssh musundo "zfs recv -vn space"
cannot receive: destination 'space' exists
# zfs send ***@musundo | ssh musundo "zfs recv -vn space2"
cannot receive: destination does not exist
# zfs send ***@musundo | ssh musundo "zfs recv -vn space/space2"
would receive full stream of ***@musundo into space/***@musundo
# zfs send ***@musundo | ssh musundo "zfs recv -vn ***@musundo"
cannot receive: destination 'space' exists
# zfs send ***@musundo | ssh musundo "zfs recv -vn ***@musundo"
cannot receive: destination does not exist

What am I missing here? I can't recv to space, because it exists, but I
can't make it not exist since it's the root filesystem of the pool. Do I
have to send each filesystem individually and rsync up the root fs?

Thanks,

James Andrewartha
Richard Elling
2008-01-17 17:29:23 UTC
Permalink
You don't say which version of ZFS you are running, but what you
want is the -R option for zfs send. See also the example of send
usage in the zfs(1m) man page.
-- richard
Post by James Andrewartha
Hi,
I have a zfs filesystem that I'd like to move to another host. It's part
of a pool called space, which is mounted at /space and has several child
filesystems. The first hurdle I came across was that zfs send only works
# zfs list -t snapshot
NAME USED AVAIL REFER MOUNTPOINT
On the destination, I have created a zpool, again called space and
cannot receive: destination 'space' exists
cannot receive: destination 'space' exists
cannot receive: destination does not exist
cannot receive: destination 'space' exists
cannot receive: destination does not exist
What am I missing here? I can't recv to space, because it exists, but I
can't make it not exist since it's the root filesystem of the pool. Do I
have to send each filesystem individually and rsync up the root fs?
Thanks,
James Andrewartha
_______________________________________________
zfs-discuss mailing list
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss
James Andrewartha
2008-01-18 01:53:53 UTC
Permalink
Post by Richard Elling
You don't say which version of ZFS you are running, but what you
want is the -R option for zfs send. See also the example of send
usage in the zfs(1m) man page.
Sorry, I'm running SXCE nv75. I can't see any mention of send -R in the
man page. Ah, it's PSARC/2007/574 and nv77. I'm not convinced it'll
solve my problem (sending the root filesystem of a pool), but I'll
upgrade and give it a shot.

Thanks,

James Andrewartha
James Andrewartha
2008-02-15 02:12:42 UTC
Permalink
Post by James Andrewartha
Post by Richard Elling
You don't say which version of ZFS you are running, but what you
want is the -R option for zfs send. See also the example of send
usage in the zfs(1m) man page.
Sorry, I'm running SXCE nv75. I can't see any mention of send -R in the
man page. Ah, it's PSARC/2007/574 and nv77. I'm not convinced it'll
solve my problem (sending the root filesystem of a pool), but I'll
upgrade and give it a shot.
It did in fact do exactly what I wanted. For the record, here are the
commands I used:
zfs snapshot -r ***@musundo
zfs send -R ***@musundo | ssh musundo "zfs recv -vFd space"

And later, to catch up further changes:
zfs snapshot -r ***@musundo2
zfs send -Ri @musundo ***@musundo2 | ssh musundo "zfs recv -vFd space"

In both cases the -F was necessary.
--
James Andrewartha
Loading...