[Samba] Enable Shadow Copy service

Ricardo Pardim Claus ricardo.claus at yahoo.com.br
Wed Aug 24 11:53:59 UTC 2016

I appreciate the initial contact. 
I realized these attempts, but it still fails. 
For testing purposes, I created 2 LVM, one for the share folder and another to store the snapshots / shadow copy. 

My smb.conf looked like this:

comment = Folder data 
path = /mnt/dados 
read only = No 
browseable = yes 
inherit acls = Yes 
inherit permissions = Yes 
guest account = guest 
guest ok=yes 
#writeable = Yes 
# recycle
vfs objects = recycle, shadow_copy2 
recycle:facility = LOCAL1 
recycle:priority = NOTICE 
recycle:maxsize = 0 
recycle:directory_mode = 0774 
recycle:subdir_mode = 0774 
recycle:keeptree = true 
recycle:touch = true 
recycle:versions = true 
recycle:exclude = *.tmp, *.log, *.obj, ~*.*, *.bak, *.exe, *.bin 
recycle:exclude_dir = tmp, temp, cache 
create mask = 0774 
directory mask = 0774 
shadow:snapdir = /mnt/snapshot 

shadow:basedir = /mnt/dados 
shadow:sort = desc 
shadow:localtime = yes 
shadow:format = @GMT-%Y.%m.%d-%H.%M.%S 

comment = Shadow Copy Enabled Share 
path = /mnt/snapshot 
vfs objects = shadow_copy 
writeable = yes 
browseable = yes 

Initial doubts are these: 

  - That's right I create 2 LVM to work with file server and shadow copy / snapshot? 
  - How is generated the shadow copy? I tried to adapt this script but it did not work:

  - Can I use any file system? I'm using XFS.

Thank you!

----- Mensagem original -----
De: Андрей Петров <>
Enviadas: Terça-feira, 23 de Agosto de 2016 20:31
Assunto: Re: [Samba] Enable Shadow Copy service

Hi Ricardo,
I use Cantose 7 with sernet-samba-4.2.14
Shadow copy works fine for me:

#cat /etc/samba/smb.conf
path=/data/share/Shared folders company
read only = no
vfs objects = shadow_copy2
as mentioned in
you may need this options in share section:

shadow:snapdir = /data/snapshots
shadow:basedir = /data/home

With my directory tree
# ls  /data/.snapshots/

it works out of the box with defaults

The way you create snapshots depends on you. I've used LVM + smbsnap (
but now i'm using "rsync time machine with hardlinks".

Things to keep in mind:
Selinux (if enabled) context and ACL for .snapshot folder should be

Good luck!

On 24.08.2016 01:19, Ricardo Pardim Claus via samba wrote:
> Dear, I would like someone to indicate me a tutorial to configure the Shadow Copy service on Samba. All the sites I found the tutorials did not help, or is incomplete. I use a Centos 7 with Samba 4.4.5. I would like to work with Shadow Copy snapshot or file server. Thank you

C уважением,

Петров Андрей
tel: +7926

More information about the samba mailing list