>> If the file still existed, would this be a case of redirecting the
>> file's top level block (dnode?) to the one from the snapshot?  If the
>> file had been deleted, could you just copy that one block?
>>
>> Is it that simple, or is there a level of interaction between files
>> and snapshots that I've missed (I've glanced through the tech specs,
>> but I'm a long way from fully understanding them).
>>
>
> It is as simple as a cp, or drag-n-drop in Nautilus.  The snapshot is
> read-only, so
> there is no need to cp, as long as you don't want to modify it or destroy
> the snapshot.
> -- richard

But that's missing the point here, which was that we want to restore
this file without having to copy the entire thing back.

Doing a cp or a drag-n-drop creates a new copy of the file, taking
time to restore, and allocating extra blocks.  Not a problem for small
files, but not ideal if you're say using ZFS to store virtual
machines, and want to roll back a single 20GB file from a 400GB
filesystem.

My question was whether it's technically feasible to roll back a
single file using the approach used for restoring snapshots, making it
an almost instantaneous operation?

ie:  If a snapshot exists that contains the file you want, you know
that all the relevant blocks are already on disk.  You don't want to
copy all of the blocks, but since ZFS follows a tree structure,
couldn't you restore the file by just restoring the one master block
for that file?

I'm just thinking that if it's technically feasible, I might raise an
RFE for this.
_______________________________________________
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss

Reply via email to