Shadow Copy with ZFS
Ed Plese
ed at edplese.com
Wed Feb 7 23:49:45 GMT 2007
On Wed, Feb 07, 2007 at 02:40:51AM +1100, Alison Winters wrote:
> I've kinda-sorta been half looking at the same thing for SGI's XVM
> volume manager snapshots. I think there is room for improvement in the
> existing shadow copy module - perhaps we should have an smb.conf option
> indicating the location of and the naming convention of the mounted
> snapshots. Do you think that'd be a viable approach?
Yes.
Below is a set of additional options to shadow_copy that I think would
work for most cases. It requires the snapshot names to be of the form
"prefixYYYY.MM.DD-HH.MM.SS". The prefix is customizable and optional
but the timestamp format is fixed and must be at the end of the name.
The defaults for these options would make the module function exactly
like the current implementation.
path:
This is the directory that contains all of the snapshots. Defaults to "".
prefix:
This is the prefix as mentioned above. Defaults to "@GMT-".
subpath:
This is the relative path under the snapshot directory to the files.
Defaults to "".
sort:
This is used to specify how (asc or desc, if at all) the shadow copies
should be sorted. This is useful for filesystems for which readdir
doesn't return the files in order.
When the client tries to access \\server\share\@GMT-YYYY.MM.DD-HH.MM.SS,
the module will translate the path to path/prefixYYYY.MM.DD-HH.MM.SS/subpath.
An example share on a ZFS filesystem would look like:
[share]
path = /pool/fs
vfs objects = shadow_copy
shadow_copy: path = .zfs/snapshot
shadow_copy: prefix = GMT-
shadow_copy: sort = desc
On other filesystems, supposing that /home snapshots were mounted in
/mnt/snapshots, an example share would be:
[homes]
vfs objects = shadow_copy
shadow_copy: path = /mnt/snapshots
shadow_copy: subpath = %U
shadow_copy: prefix = GMT-
shadow_copy: sort = desc
Does this seem like it would be a reasonable way to implement this?
Would this work with XVM snapshots?
Thanks,
Ed Plese
More information about the samba-technical
mailing list