Jul 252013
 

Today it finished. That ZFS send I started on Monday finally finished.

Recap

The original command was:

# zfs send storage/compressed/bacula@2013.07.22:06:33 | mbuffer | ssh -t dan@10.5.0.20 'zfs receive system/usr/local/bacula/FromKraken'

That’s was the initial send of the filesystem. But more data has been added to it. So I take another snapshot, and send that:

Send what’s accumulated since previous send

# zfs snapshot storage/compressed/bacula@2013.07.25:08:20

And now I send the incremental stream:

# zfs send -R -i storage/compressed/bacula@2013.07.22:10:03 storage/compressed/bacula@2013.07.25:08:20 | \
  dd | dd obs=1m | ssh -t dan@10.5.0.20 'zfs receive system/usr/local/bacula/FromKraken'
Pseudo-terminal will not be allocated because stdin is not a terminal.
Password:
180699642+182370 records in
180799689+1 records out
92569440976 bytes transferred in 2771.734097 secs (33397663 bytes/sec)
180799689+1 records in
88281+1 records out
92569440976 bytes transferred in 2771.801805 secs (33396847 bytes/sec)
cannot mount '/usr/local/bacula/FromKraken': failed to create mountpoint

In this case, I used some dd in the middle, as suggested on Twitter.

Permissions needed on the new filesystem

My initial attempt with the above command failed with:

cannot receive incremental stream: permission denied
warning: cannot send 'storage/compressed/bacula@2013.07.25:08:20': Broken pipe

Why? Permissions. You’ll recall I updated permissions via ‘zfs allow’. Time to add another. I issued this command on the receiving server, giving myself full permissions on the fileset created by my previous ‘zfs send’.

# zfs allow -l dan create,destroy,snapshot,rollback,clone,promote,rename,mount,send,receive,quota,reservation  system/usr/local/bacula/FromKraken

cannot mount?

Now, back to that ‘cannot mount’ problem.

I decided to mount the received filesystem and look around, but first, make it readonly:

$ sudo zfs set readonly=on system/usr/local/bacula/FromKraken
$ sudo zfs mount system/usr/local/bacula/FromKraken
$ ls -lt /usr/local/bacula/FromKraken/volumes/ | head
total 8055702633
-rw-r-----  1 910   910  3138570466 Jul 25 12:07 IncrAutoNoNextPool-2969
-rw-r-----  1 910   910  4008186456 Jul 25 10:40 IncrAuto-1451
-rw-r-----  1 910   910  5368683212 Jul 25 10:37 IncrAuto-1450
-rw-r-----  1 910   910  5368689799 Jul 25 09:05 IncrAuto-2369
-rw-r-----  1 910   910  5368688840 Jul 25 07:27 IncrAuto-2368
-rw-r-----  1 910   910  5368688851 Jul 25 07:24 IncrAuto-2366
-rw-r-----  1 910   910  5368650884 Jul 25 07:22 IncrAuto-2365
-rw-r-----  1 910   910  5368691208 Jul 24 12:42 IncrAuto-4013
-rw-r-----  1 910   910  2661194354 Jul 24 11:48 FullAuto-4040

OK, that looks good. It definitely contains files created after the initial zfs send was started. Let’s compare that to the source system.

# ls -lt /storage/compressed/bacula/volumes/ | head
total 7951201171
-rw-r-----  1 bacula  bacula  3138570466 Jul 25 12:07 IncrAutoNoNextPool-2969
-rw-r-----  1 bacula  bacula  4008186456 Jul 25 10:40 IncrAuto-1451
-rw-r-----  1 bacula  bacula  5368683212 Jul 25 10:37 IncrAuto-1450
-rw-r-----  1 bacula  bacula  5368689799 Jul 25 09:05 IncrAuto-2369
-rw-r-----  1 bacula  bacula  5368688840 Jul 25 07:27 IncrAuto-2368
-rw-r-----  1 bacula  bacula  5368688851 Jul 25 07:24 IncrAuto-2366
-rw-r-----  1 bacula  bacula  5368650884 Jul 25 07:22 IncrAuto-2365
-rw-r-----  1 bacula  bacula  5368691208 Jul 24 12:42 IncrAuto-4013
-rw-r-----  1 bacula  bacula  2661194354 Jul 24 11:48 FullAuto-4040

I think that matches.

You’ll notice that in the destination system, the files are chown 910:910, whereas in the source system, they are bacula:bacula. That’s because the bacula user & group do not exist on the destination system. That will change after I install Bacula there.