ZFS receive only one descendent filesystem

Hi!

I have one large backup file, cretaed via zfs send and it contains root filesystem and all descendent filesystems. Is there any way to restore only one particular descendent filesystem from this file?
 
No, I don't believe it is possible to pick and choose which datasets are received from a stream. The man page for zstreamdump(1) has a tantalising description of "zstreamdump - filter data in zfs send stream" but is actually for viewing information about a stream rather than filtering out datasets during a receive process.

It would be possible to receive the whole stream without mounting the datasets ( zfs receive -u poolname < file) and then delete the datasets you don't want, provided you have the disk space. If you still have the snapshot you took when you made the backup, it would also be possible to resend or mount just the snapshot of the dataset you need.

I really wouldn't recommend it but if you were very highly motivated and had a lot of time on your hands, then it might be possible to edit the stream yourself to extract just the dataset you need though you would need a thorough understanding of the ZFS stream format and would likely need to generate new valid checksums. Buying a big hard disk to which you can restore your whole stream would likely be easier and cheaper!
 
Back
Top