ZFS Send and receive filesystem locally to another pool - target is busy

I want to sent wd0/ezjail filesystem:
Code:
 # zfs list -r wd0 | grep ezjail
wd0/ezjail  1,26G  1,15T  120K  /wd0/jails
wd0/ezjail/basejail  218M  1,15T  217M  /wd0/jails/basejail
wd0/ezjail/mldonkey  1,05G  1,15T  1,05G  /wd0/jails/mldonkey
wd0/ezjail/newjail  4,02M  1,15T  4,02M  /wd0/jails/newjail

to toshiba0/jails. This one was just created and was unmonted
Code:
 zfs unmount toshiba0/jails
.

So, issuing a
Code:
# zfs send wd0/ezjail | zfs receive -du toshiba0/jails
warning: cannot send 'wd0/ezjail': target is busy; if a filesystem, it must not be mounted
cannot receive: failed to read from stream

Both zfs and mount don't report toshiba0/jails as mounted.

So, what should I do to send the filesystem to another pool in the same computer?
 
That's a strange error because as far as I'm aware (unless things have changed), you can't send to an existing dataset (unless it's an incremental send). You also need to take a snapshot of the source and send that:

(toshiba0/jails shouldn't exist at this point)
Code:
# zfs snapshot wd0/ezjail@snap1
# zfs send wd0/ezjail@snap1 | zfs recv toshiba0/jails
Once you have the first copy of the dataset, you can then send incrementals in future to only send changes. This example assumes you've already done the above, so you now have toshiba0/jails and wd0/ezjail, both of which should have a snap1 snapshot.
Code:
# zfs snapshot wd0/ezjail@snap2
# zfs send -i snap1 wd0/ezjail@snap2 | zfs recv toshiba0/jails
 
That's a strange error because as far as I'm aware (unless things have changed), you can't send to an existing dataset (unless it's an incremental send).

Hi usdmatt,

I tried to send a filesystem because of this passage in the documentation:
Code:
 zfs send [-eL] [-i snapshot|bookmark] filesystem|volume|snapshot

  Generate a send stream, which may be of a filesystem, and may be
  incremental from a bookmark.  If the destination is a filesystem or
  volume, the pool must be read-only, or the filesystem must not be
  mounted.  When the stream generated from a filesystem or volume is
  received, the default snapshot name will be (--head--).

Will try the snapshot later on and report back.
 
The snapshot worked great, but still wondering about that reference in the manual to zfs send a filesystem...
Thanks usdmatt.
 
Last edited by a moderator:
That man page entry seems to be incredibly confusing. You don't really specify a destination with zfs send (the destination is STDOUT), so I'm wondering if it's actually referring to the file system you are sending.

It's possible that you can send a file system directly rather than using a snapshot (although I haven't tried this personally, I always use snapshots). However, you obviously can't do that if it's changing (which is normally the whole point of sending a snapshot), so it would make sense for the file system being sent to either be read-only or unmounted. The error you got originally could actually be complaining that your source file system needs to be unmounted, not the zfs recv destination.
 
Last edited by a moderator:
Back
Top