Difference between revisions of "Shadow Copies with Snapshots"

 
(8 intermediate revisions by 5 users not shown)
Line 1: Line 1:
 +
 +
The base Samba-Configuration is quite simple, therefore you can easily follow the instructions of the [https://www.samba.org/samba/docs/current/man-html/vfs_shadow_copy2.8.html man vfs_shadow_copy2].
 +
:The tricky part is the management of the snapshots.
 +
 
<p>
 
<p>
The base Samba-Configuration is quiet simple, therefore you can easily follow the instructions of the [http://us3.samba.org/samba/docs/man/Samba-HOWTO-Collection/VFS.html#id2654956 Official HowTo].
+
But before you read on, a little warning:
The tricky part is the management of the snapshots.
+
:Some people have the idea that the could have snapshots for the last 30 days and four different volumes and maybe twice a day, all in all 240 snapshots. That's not possible - you shouldn't have more than 15 snapshots at a time (and that's quite a lot, actually I think there is a bug in lvm2 reported and numbers above 16 snapshots may mess up your volumes).
</p>
+
:You have to check the change rate of your data before you plan your snapshots, otherwise your volume groups may be quickly out of space. Also keep in mind, that your disks have more work to do the more snapshots they have to care about.
<p>
+
:The environments, I wrote this script for, have one volume, size about 20GB and a changerate of 100MB per day and maybe 500MB in two weeks.
But before you read on, a little warning:<br>
+
 
Some people have the idea that the could have snapshots for the last 30 days and four different volumes and maybe twice a day, all in all 240 snapshots. Thats not possible - you shouldn't have more than 15 snapshots at a time (and thats quiet a lot).<br>
+
 
You have to check the changerate of your data before you plan your snapshots, otherwise your volumegroups may be quickly out of space. Also keep in mind, that your disks have more work to do the more snapshots they have to care about.<br>
+
Now to the subject:
The environments, I wrote this script for, have one volume, size about 20GB and a changerate of 100MB per day and maybe 500MB in two weeks.
+
:After planing how many snapshots of which volumes you need, all you have to do is to place this [[Shadow Copies with Snapshots Script]] in a useful place (e.g. /usr/local/sbin/), place some entries in your crontab and create a configuration file (if you use an other place than /etc/samba/smbsnap.conf you have to change the path in the script).
</p>
+
:Before this script is ready to work, the kernel-module dm_snapshot has to be loaded and if your volumes are loaded at boot time (i.e. /etc/fstab), this has to be done in your initrd.
<p>
+
:Read the head of the script for more detailed documentation and a configuration example.
Now to the subject:<br>
 
After planing how many snapshots of which volumes you need, all you have to do is to place this [[script]] in a usefull place (e.g. /usr/local/sbin/) and create a configuration file (if you use an other place than /etc/samba/smbsnap.conf you have to cange the path in the script).<br>
 
Read the head of the script for documentation.
 
</p>
 

Latest revision as of 17:36, 4 March 2019

The base Samba-Configuration is quite simple, therefore you can easily follow the instructions of the man vfs_shadow_copy2.

The tricky part is the management of the snapshots.

But before you read on, a little warning:

Some people have the idea that the could have snapshots for the last 30 days and four different volumes and maybe twice a day, all in all 240 snapshots. That's not possible - you shouldn't have more than 15 snapshots at a time (and that's quite a lot, actually I think there is a bug in lvm2 reported and numbers above 16 snapshots may mess up your volumes).
You have to check the change rate of your data before you plan your snapshots, otherwise your volume groups may be quickly out of space. Also keep in mind, that your disks have more work to do the more snapshots they have to care about.
The environments, I wrote this script for, have one volume, size about 20GB and a changerate of 100MB per day and maybe 500MB in two weeks.

Now to the subject:

After planing how many snapshots of which volumes you need, all you have to do is to place this Shadow Copies with Snapshots Script in a useful place (e.g. /usr/local/sbin/), place some entries in your crontab and create a configuration file (if you use an other place than /etc/samba/smbsnap.conf you have to change the path in the script).
Before this script is ready to work, the kernel-module dm_snapshot has to be loaded and if your volumes are loaded at boot time (i.e. /etc/fstab), this has to be done in your initrd.
Read the head of the script for more detailed documentation and a configuration example.