Help with LVM snapshot scripts for Samba Shadow Copy support
I need a hand here, my scripting skills are insufficent to pull this one off. However the end result is likely to benifit others in the future. But first, some background info.
I have recently been creating a new file server running Ubuntu 8.04 on a HP DL140G3 with an external MSA60 Disk Array. Obviously to service the Windows clients this is running Samba (with all the ACL, quota, etc bells and whistles).
The underlying file system for the user storage is RAID-5. This is then allocated with LVM2 into various partitions. These are formatted as JFS and mounted some place sensible (/home/samba/blah normally) and then shared via samba as required.
I wish to use LVM based snapshots to provide 'shadow copies' to Windows clients. To do this I need a suite of scripts to do the following:
1) create LVM snapshots on a regular basis of some LVM paritions. New snapshots must be mounted in the way sambas shadow copy VFS module expects.
2) remount LVM snapshots cleanly in the case of a server reboot/crash/etc.
2) delete LVM snapshots after a predetermined time and/or when disk space is low.
A couple of links with background info:
Chapter23.Stackable VFS modules
Samba Shadow Copy Howto - Waikato Linux Users Group
Samba and MS Shadow Copy