restoring selected files/folders from snapshot - space usage?

Metis IT

Dabbler
Joined
Oct 10, 2016
Messages
11
Some folders have been deleted from a live file system/dataset and need to be restored from a few snapshots back. It is not possible to rollback to a old snapshot as other data has been added and changed in the meantime in this dataset. The issue is, it is a substantial amount of data, so used space / remaining AVAIL space is relevant.

Solutions?

My naive approach would be to change into ".zfs/snapshots/xxxx" and copy back needed data from that snapshot into the live dataset.

My tests have shown that by doing so those files are created as new files and take up space again (reducing the AVAIL counter in "zfs list"). They do not share the same data blocks on ZFS level anymore (as snapshots do until data becomes unique).

Is there a better way than to cp?

I thought a workaround would be to enable dedup on the dataset, perform the copy, disable it again. But this had required to have enabled dedup previously. Deduplication starts only on blocks written after dedup was enabled.
 
Last edited:
Top