Synchronization of volume snapshots when doing whole system backups
        Posted  
        
            by 
                intuited
            
        on Server Fault
        
        See other posts from Server Fault
        
            or by intuited
        
        
        
        Published on 2011-02-18T03:31:26Z
        Indexed on 
            2011/02/18
            7:27 UTC
        
        
        Read the original article
        Hit count: 533
        
Is there a way to guarantee consistency across volumes when doing backups from LVM snapshots? Consider this scenario:
- Some system upgrade is in progress.  It will write some files to the 
/usrvolume, and once completed, will record success in the/varvolume. - As the upgrade is just about complete, I run a backup script that creates snapshots of the 
/usrand/varvolumes, along with the rest of the system's volumes, and proceeds to create backups from those snapshots. - Just before the upgrade's last write/flush on the 
/usrvolume completes, the backup script takes its snapshot of/usr. - That write completes, and the upgrade operation's success is quickly recorded in the nebulous depths of 
/var. - The backup script takes a snapshot of 
/var. - The backup script creates backups from the snapshots it has, er, snapshotted.
 
So the result of all of this tomfoolery is that the resulting /usr backup contains a file which is missing a few bits, and the /var backup contains metadata indicating that that file is complete and approved for use.
Without delving into the details of which operating systems' system upgrade systems would be unfazed by such trifles, is there a way to avoid such problems? At the least this seems like it could cause some application to fail unexpectedly after restoration of such a backup.
© Server Fault or respective owner