I have a file server running on Ubuntu 8.04. I have a separate volume in LVM that I have mounted and shared via samba. I currently take a snapshot of the volume every 15 minutes, do a backup using rdiff-backup to another hard disk, then I release the snapshot. The largest file on the share is a single Microsoft Access file that a few people connect to. Are there easier ways of performing the backups? Does it really matter?
In general, snapshots are a very good way to do backups. However, they don't solve every problem.
I'm not familiar with Access specifically, but are you sure that the database file is in a consistent state when you take the snapshot?
If this was a MySQL database, you would connect and run
FLUSH TABLES WITH READ LOCK;
to ensure that any writes were flushed, and all the tables were locked-- ie the datafiles would be in a consistent state-- before taking the snapshot. (subsequently you'd runUNLOCK TABLES;
to return things to normal.)Similar caveats may apply to other files on the share. Depending on what Access actually does, and without knowing what the other files and programs in question are, the safest thing might be to perform backups during a scheduled window during which no clients are connected, or at least no files are open and writable.
Samba presents additional problems in the form of client and server side caching. Oplocks for instance: http://www.samba.org/samba/docs/man/Samba-HOWTO-Collection/locking.html Also check out the
strict sync
, andsync always
options.