Is it possible to rollback to a certain directory within a snapshot? For example, given the snapshot tank/home@snapshot_week_01 can I rollback to something like tank/home/louis@snapshot_week_01 without rolling back all of the other files directories within tank/home?
3 Answers
To answer the question "Is it possible", the answer is no. ZFS snapshots have no concept of files, folders, or anything else, it is a block level snapshot of the entire filesystem.
You can however browse a snapshot and access individual files, as indicated in duenni's answer, or you can clone a snapshot giving you a second copy of the filesystem without rolling back the first.
In this case I would go to /tank/home/.zfs/snapshot/snapshot_week_01 and pull out the data you need.
See Displaying and Accessing ZFS Snapshots on Oracle's website for details.
The answer to the question as asked is no; snapshots are per file system and you can only operate on the whole file system when working with the snapshot. So if you roll back to a previous snapshot, that affects the entire file system.
The way to restore specific files or directories from a ZFS snapshot is to navigate into the snapshot directory and then copy the files out of the snapshot, using something like cp -av snapshotfile /home/louis/myfile.