[Samba] Enable Shadow Copy service

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



 
Dear, 
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:


[data] 
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 



[snapshot] 
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:
        https://www.samba.org/samba/docs/man/Samba-HOWTO-Collection/VFS.html#id2651694

  
  - 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
...
[Data]
path=/data/share/Shared folders company
read only = no
vfs objects = shadow_copy2
...
as mentioned in
https://www.samba.org/samba/docs/man/manpages/vfs_shadow_copy2.8.html
you may need this options in share section:

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

With my directory tree
# ls  /data/.snapshots/
@GMT-2016.08.09-19.00.00
@GMT-2016.08.10-19.00.00
@GMT-2016.08.11-19.00.00

it works out of the box with defaults

The way you create snapshots depends on you. I've used LVM + smbsnap (
https://wiki.samba.org/index.php/Rotating_LVM_snapshots_for_shadow_copy)
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
appropriate.

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 уважением,

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



More information about the samba mailing list