First, quit trying to roll your own backup solution.
Use Real Backup Software to do your backups.
Real Backup Software is extensively tested and has been beaten on by enterprise sysadmins for years. You can be confident that when you use it you will be able to restore what you've backed up.
As to the mounted filesystem / active files problem - any backup software (rsync, tar, bareos/bacula, even the venerable cp
command) will copy files that are "in use" on a Unix system.
The problem that arises is that if those files are being actively modified you don't know what state you grabbed them in -- you could have a file completely rewritten while you're backing it up, and wind up putting useless garbage on your tapes.
As a general rule in order to ensure a good, consistent backup your filesystem (or at least the subset you're backing up) must be quiescent.
The only fully-automated solution to this I know of in the wild is Windows VSS. What you're proposing with the LVM snapshot/mount/backup/umount/destroy process is basically what VSS does through its API.
You can implement the snapshot solution you described using real backup software and a little creativity (in the case of bareos you would do it with with ClientRunBeforeJob
and ClientRunAfterJob
scripts) so it's essentially transparent, and it's a good solution - I heartily endorse it.
Note that this still isn't a "one click" restore. You're almost certainly still gong to have to do some manual work after you restore from your backups to get back to a running system. This is why you run restore tests.
For what my opinion is worth, I think "one-click restore" doesn't exist, and anyone who tells you it does is trying to sell you software. Probably expensive software.
The closest thing to a one-click restore is running your systems as VMs, snapshotting them periodically, and backing up the snapshots like Zoredache suggested.
The same admonition about using Real Backup Software from the top of my answer still applies when you grab the VM snapshots (but you probably won't need to do LVM snapshots because the VM snapshots will be quiescent by definition after they're created.
Selection of backup software for the hypervisor is left as an exercise for the reader -- it can be anything from bareos on Linux, ArcServe on Windows, or vSphere Data Protection on a VMWare cluster depending on your needs and budget...