Shadow Copy with ZFS

Ed Plese ed at
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?


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.

  This is the directory that contains all of the snapshots.  Defaults to "".

  This is the prefix as mentioned above.  Defaults to "@GMT-".

  This is the relative path under the snapshot directory to the files.
  Defaults to "".

  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:

  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:

  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?


Ed Plese

More information about the samba-technical mailing list