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 space at musundo # zfs list -t snapshot NAME USED AVAIL REFER MOUNTPOINT space at musundo 0 - 25.9G - space/amanda at musundo 0 - 31K - space/away at musundo 924K - 52.4G - space/freebsd at musundo 0 - 38K - space/freebsd/cvs-repo at musundo 0 - 36K - space/freebsd/cvsroot at musundo 0 - 4.11G - space/mp3s at musundo 0 - 47.6G - space/netboot at musundo 352K - 14.7G - space/netboot/manduba-freebsd at musundo 0 - 95.5M - space/netboot/manduba-freebsd/dist at musundo 0 - 36K - space/netboot/manduba-freebsd/root at musundo 0 - 327M - space/netboot/manduba-freebsd/swap at musundo 0 - 36K - space/services at 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 space at musundo to the new machine: # zfs send space at musundo | ssh musundo "zfs recv -vn -d space" cannot receive: destination ''space'' exists # zfs send space at musundo | ssh musundo "zfs recv -vn space" cannot receive: destination ''space'' exists # zfs send space at musundo | ssh musundo "zfs recv -vn space2" cannot receive: destination does not exist # zfs send space at musundo | ssh musundo "zfs recv -vn space/space2" would receive full stream of space at musundo into space/space2 at musundo # zfs send space at musundo | ssh musundo "zfs recv -vn space at musundo" cannot receive: destination ''space'' exists # zfs send space at musundo | ssh musundo "zfs recv -vn space2 at 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
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 James Andrewartha wrote:> 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 space at musundo > # zfs list -t snapshot > NAME USED AVAIL REFER MOUNTPOINT > space at musundo 0 - 25.9G - > space/amanda at musundo 0 - 31K - > space/away at musundo 924K - 52.4G - > space/freebsd at musundo 0 - 38K - > space/freebsd/cvs-repo at musundo 0 - 36K - > space/freebsd/cvsroot at musundo 0 - 4.11G - > space/mp3s at musundo 0 - 47.6G - > space/netboot at musundo 352K - 14.7G - > space/netboot/manduba-freebsd at musundo 0 - 95.5M - > space/netboot/manduba-freebsd/dist at musundo 0 - 36K - > space/netboot/manduba-freebsd/root at musundo 0 - 327M - > space/netboot/manduba-freebsd/swap at musundo 0 - 36K - > space/services at 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 space at musundo > to the new machine: > # zfs send space at musundo | ssh musundo "zfs recv -vn -d space" > cannot receive: destination ''space'' exists > # zfs send space at musundo | ssh musundo "zfs recv -vn space" > cannot receive: destination ''space'' exists > # zfs send space at musundo | ssh musundo "zfs recv -vn space2" > cannot receive: destination does not exist > # zfs send space at musundo | ssh musundo "zfs recv -vn space/space2" > would receive full stream of space at musundo into space/space2 at musundo > # zfs send space at musundo | ssh musundo "zfs recv -vn space at musundo" > cannot receive: destination ''space'' exists > # zfs send space at musundo | ssh musundo "zfs recv -vn space2 at 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 > > > _______________________________________________ > zfs-discuss mailing list > zfs-discuss at opensolaris.org > http://mail.opensolaris.org/mailman/listinfo/zfs-discuss >
On Thu, 2008-01-17 at 09:29 -0800, Richard Elling wrote:> 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 wrote:> On Thu, 2008-01-17 at 09:29 -0800, Richard Elling wrote: >> 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 space at musundo zfs send -R space at musundo | ssh musundo "zfs recv -vFd space" And later, to catch up further changes: zfs snapshot -r space at musundo2 zfs send -Ri @musundo space at musundo2 | ssh musundo "zfs recv -vFd space" In both cases the -F was necessary. -- James Andrewartha