[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Do snapshots solve all consistency problems ?



scdbackup@gmx.net wrote:

> I acknowledge Joerg's effort to make this as safe
> as possible by help of his program star. I consider
> to learn about LVM in order to get filesystem 
> snapshots.

I don't know whether and iff, how Linux supports snapshots.
Solaris and FreeBSD do it in a very smilar way since 2002.

> Shall i really make assumptions about the quality
> of particular applications while i consider
> potential backup problems ?

If you backup a non file server, you should.

>From the new star man page:

     Backups from life filesystems should be avoided.  On operat-
     ing  systems  that  support  file  system snapshots, backups
     should be made from a read-only  mount  of  a  snapshot.  Be
     careful  that  all files that have been created between set-
     ting up a snapshot and starting an incremental backup may be
     missing  from all backups unless the dumpdate=name option is
     used.

     If the system that is going to be backed up is not acting as
     a file server, it makes sense to shut down all services that
     may result in inconsistent file states before setting up the
     filesystem  snapshot. After the filesystem snapshot has been
     set up, the services may be restarted.

     If the the system that is going to be backed up is acting as
     a  file  server,  it  may be that services on remote clients
     cause inconsistent file states unless all such services that
     remotely  access  files are shut down before the snapshot is
     set up.


> Meanwhile i have the idea that shapshots decrease
> the probability for unusable file copies in the
> same way as quickly crossing a street reduces the chance
> to collide with a car. Slow people get overrun more
> often. But you can also run blindy into a standing car.

No, definitely not.

Snapshots are acting transparently so you use them where they
ar available and you need to go to single user on other 
systems. 

Snapshots prevent you from being forced to deal with files that
are renamed during the backup, with files that shrink during
the backup and many other things. If you make a backup from a NFS
server and if you do it by shutting the server down to single user mode
before doing the backup, you see the same remaining problems as you see
when you just set up a snaphot while the server is running.


> This, of course, only if there are any cars on
> the street.
> If we put all cars into their garages, then
> there will be no accident. Regardless of speed.
> Runlevel 0.

It you talk about _all_ cars, you are right.
Of you only put the busses into the garages, you have the
problems describes above with NFS servers. I am sure that
most sysadmins don't even know about this theoretical
backup consistency problem.

> > When using snapshots, you don't need to shutdown services
> > while running a backup.
>
> I still do not see how a snapshot does prevent
> to snap intermediate file states which do not
> suit a service when it opens the file.
> After restoring a backup such a service or application
> would make problems.
>
> Trying to imagine how i would have to redesign the
> applications on which i worked in the past ...
> ... so that all file changes happen atomically ... 
> ... i encounter severe obstacles.

See above for the non-NFS-Server case.


> Are there guidelines on how to achieve this quality
> within general purpose programs ?

Programs that write (and fsync(2)) correctly aligned
will see no problems.

Jörg

-- 
 EMail:joerg@schily.isdn.cs.tu-berlin.de (home) Jörg Schilling D-13353 Berlin
       js@cs.tu-berlin.de		(uni)  
       schilling@fokus.fraunhofer.de	(work) Blog: http://schily.blogspot.com/
 URL:  http://cdrecord.berlios.de/old/private/ ftp://ftp.berlios.de/pub/schily



Reply to: