Solved Send|receive problem

Greetings all,

I seem to have some misunderstanding regarding zfs sent and receive. I have created a snapshot:
Code:
# zfs snapshot myzfs/data@transfer
and attempted send test to a different pool at the same machine:
Code:
# zfs send -vn myzfs/data@transfer | zfs receive -vn tank/data
However, this results in an error:
Code:
cannot receive: failed to read from stream

When I try just the send part I get a correct size of the snapshot:
Code:
zfs send -vn myzfs/data@transfer
full send of myzfs/data@transfer estimate size is 5G
total estimated size is 5G
which appears to indicate that the problem is at the receiving end.

Any help would be appreciated.

Kindest regards,

M
 
As always with these things: manualpages are your friend. zfs(8) (or man zfs) lists all the relevant options which you can use for every sub-command.

Note that in the above example you have issues with both commands since both have -n which essentially stops them from doing anything useful.

Why would you want to dump this into a different pool though, that's somewhat inefficient. You can also easily dump the stream into a file and then use that to actually restore data when you need to. The reason this is more efficient is because the system doesn't have to build and process the stream at the same time ('packing' a stream and 'unpacking' it), instead you generate a stream directly from the dump file and then process that. Whenever you need to restore individual files you can also use the .zfs/snapshots directory which can be found in the root of every ZFS filesystem, from there you can access all your snapshots.

(edit): Of course different backups require different approaches, note that I'm not trying to insinuate that there's anything wrong with your workflow. If you maintain a shadow system then this is obviously the best option.
 
Hi ShelLuser,

I partially disagree. Once I removed the -n switch on the send side, the test worked, i.e., I could see what would be done because the stream was generated.

As your edit indicates, the reason for using the inefficient send/receive transfer between two pools on the same machine is for the purpose of understanding how snapshots work because I am considering to replace linix-based Buffalo storage with a second zfs filesystem based machine.

I still have a lot to learn, e.g., I cannot figure out how to restore to a different pool/mount-point, if it is possible to do diff-based backup instead of incremental one, etc.

Kindest regards,

M
 
Back
Top