Amanda-Users

Re: Why didn't my backup work (the way I thought it should)?

2006-09-13 13:29:51
Subject: Re: Why didn't my backup work (the way I thought it should)?
From: Frank Smith <fsmith AT hoovers DOT com>
To: "Zembower, Kevin" <kzembowe AT jhuccp DOT org>
Date: Wed, 13 Sep 2006 12:20:02 -0500
Zembower, Kevin wrote:
> I'm just completing the first bare-metal recovery I've experienced in my
> six years as a system administrator. A backplane seemed to fail and
> wiped out two disks of a four-disk RAID-5 array. After replacing all the
> suspect parts, I followed this process to restore the host:
> --Installed an IDE hard drive and configured to boot before the SCSI
> RAID drives
> --Installed Debian 3.1r3 on the IDE drive.
> --Mounted the SCSI array and partitioned as the original was
> --Manually examined my backup tapes (tar) and assembled a list of the
> tape file to restore, in the proper order.
> --Restored the data to the proper partitions on the SCSI array.
> --Powered down the host, removed the IDE drive, and booted using Debian
> CD and 'rescue root=/dev/sda2'. This worked correctly.
> --Ran lilo to restore the MBR. After removing CD, 'shutdown -r' seems to
> work correctly.
> 
>  I thought that after all this, I'd be done. However, I'm discovering
> pockets of files and directories that seem to have never made it to the
> backup tapes in the first place. Some examples:
> --/service/tinydns, dnscache, qmail-send, ... All these were soft links
> to the files, so from the recent discussion, they wouldn't have been
> backed up by tar. Is there a recommended procedure for dealing with
> this? Would using 'dump' have prevented this?
> --/var/qmail/*  Directories below this level, such as control and bin,
> exist, but they're empty
> --/var/lib/dpkg/* (This is frustrating my efforts to restore this Debian
> system with 'aptitude' or 'apt-get.')
> --/var/spool/cron/crontabs Empty
> --/var/amanda/* (All my amanda database information is missing.)
> 
> One common thread is that all of these directories are in /var/.
> However, other files in this branch, such as /var/lib/apt/lists/* seem
> to be restored just fine.

Did you have an exclude list?
Were any of those directories symlinks to other filesystems or NFS
mounts? A symlink would have still been backed up, just not what it
was pointing to, and a mount point would just show up as an empty
directory.
Did the system have problems before the last backup?  Perhaps these
files were corrupted/gone  before/during the last backup.  Since
Amanda restores the state at a point in time, you may have most of
the data on a previous level that the latest level removed (related
to recommendations often given here to restore to a tmp directory
and move files into place since otherwise existing new data in the
target directory would be deleted by the restore).  You might want
to try recovering from tapes from a day or two before and see if
the data is there, the dpkg data at least probably hadn't changed
much from earlier backups.
> 
> I don't understand why these files and directories are missing. My
> disklist includes:
> amanda@cn2:/etc/amanda/DBackup$ grep -i center disklist
> centernet sda2 tar      #/
> centernet sda14 tar     #/boot 
> centernet sda3 tar      #/usr 
> centernet sda5 tar      #/opt/analog/logdata 
> centernet sda6 tar      #/var/www/centernet/htdocs 
> centernet sda7 tar      #/var/lib/mysql 
> centernet sda9 tar      #/var/www/centernet/logs 
> amanda@cn2:/etc/amanda/DBackup$
> 
> This matches the /etc/fstab on this host:
> amanda@cn2:/etc/amanda/DBackup$ cat /etc/fstab
> # /etc/fstab: static file system information.
> #
> # <file system> <mount point>                   <type>  <options>
> <dump>  <pass>
> /dev/sda2       /                               ext2
> errors=remount-ro       0       1
> <snip>
> /dev/sda14      /boot                           ext2    defaults
> 0       2
> /dev/sda3       /usr                            ext2    defaults
> 0       2
> /dev/sda5       /opt/analog/logdata             ext2    defaults
> 0       2
> /dev/sda6       /var/www/centernet/htdocs       ext2    defaults
> 0       2
> /dev/sda7       /var/lib/mysql                  ext2    defaults
> 0       2
> /dev/sda9       /var/www/centernet/logs         ext2    defaults
> 0       2
> /dev/sda8       /dumps/amanda                   ext2    defaults
> 0       2
> /dev/sda10      /dumps/amanda2                  ext2    defaults
> 0       2
> amanda@cn2:/etc/amanda/DBackup$
> 
> Here's what I think are the relevant portions of amanda.conf:
> define dumptype global {
>     comment "Global definitions"
> }
> 
> define dumptype tar {
>     global
>     program "GNUTAR"
> }
> 
> I don't understand why these files and directories didn't end up on the
> root (sda2) tape, like I expected.
> 
> Can anyone show me an error that I made, or did something go wrong that
> wasn't supposed to occur?
> 
> To make this work more smoothly the next time, six years from now, when
> I have to do another bare-metal backup, what should I change?

Test restores more than once per 6 years to verify you are backing up
what you think you are, since data seems to get shifted around and
the excludes you need today eventually end up excluding things you need.
Also, backup media (tape and disk) can fail in ways that give no errors
during backups but make a restore impossible, and the sooner you are
aware of it the better.

Frank

> 
> Thanks for your advice and suggestions.
> 
> -Kevin
> 
> Kevin Zembower
> Internet Services Group manager
> Center for Communication Programs
> Bloomberg School of Public Health
> Johns Hopkins University
> 111 Market Place, Suite 310
> Baltimore, Maryland  21202
> 410-659-6139 
> 


-- 
Frank Smith                                      fsmith AT hoovers DOT com
Sr. Systems Administrator                       Voice: 512-374-4673
Hoover's Online                                   Fax: 512-374-4501