Web lists-archives.com

Re: A bit OT: Amanda Restore




On Friday 24 March 2017 11:51:27 Mark Fletcher wrote:

> Hello
>
> A while back I installed Amanda for backups. I have a pretty simple
> setup at the moment which I may expand later. At the moment only one
> machine, running Jessie, is backed up by Amanda.
>
> My main PC is both the Amanda server and the machine Amanda is backing
> up. Recently I started to think about what would happen if I suffered
> a catastrophic failure on this machine. Like if one of its SSDs died a
> sudden death.
>
> I have read up on amrecover but both the documentation and what I have
> read in forums online seem to assume that in a recovery situation the
> Amanda server will be intact. How then is one supposed to protect the
> Amanda server? And in my case, what is the best way to make sure my
> Amanda backups are actually usable for restore in a recovery
> situation?
>
> The backup "tapes" are virtual tapes on large-capacity disks in an
> external USB3 drive cage. The recovery scenario is my PC takes a
> nosedive but the contents of the external drive cage are fine. For
> example, failure of one internal SSD in the PC containing most of the
> operating system, /home etc.
>
> Perhaps a bit more background in case needed to be clear: I am not
> bothering to back up the system software that I can replace by
> reinstalling Jessie. I am only backing up /etc, /opt (where I have a
> SVN repository, a mysql database, a big bunch of videos, and the hard
> disks of 2 Windows VMs) and a few other places, including of course
> /home. My backup script shuts down my SVN server and my mysql
> database, and either includes or excludes the disks for my VMs
> depending on whether they are running, then kicks off Amanda. So
> /etc/amanda/disklist gets built every time from a template and based
> on the circumstances the script finds on each run. I note looking in
> /etc/amanda/ that disklist and tapelist are both updated every time,
> disklist by my script and tapelist presumably by Amanda.
>
> I'd assume that if I suffered a disk failure, replaced the disk,
> re-installed Jessie and tried to use Amanda to restore my backups of
> my stuff, I'd be hosed right now because my current /etc/amanda and
> its subdirectories would be gone. Is this correct? Amanda would not be
> able to recover in this situation, right?
>
Correct. This is why I use a different disk for amanda backup files, and 
I wrote a script to wrap the amanda run so that when amanda is done, 
this script appends the complete amanda configuration, and its database, 
to the end of that backup. This has the added advantage of being able to 
do a recovery to the state of the last backup run, instead of the day 
before because the on disk amanda stuff, as recorded in the backup, is a 
run old. Its hand work to do an install on a new system disk, but then I 
can unpack that stuff from the "amanda" disk to install amanda's config 
and database. From that point its amrecover run time and when done I 
have a system exactly the same a it existed at 01:40 or so in the 
morning.

> If so, I need to back those up some other way. And I need to do so
> every day, because Amanda will update the tapelist file every day, and
> I'd assume if I don't have the latest tapelist file it's not going to
> be able to restore my backups??? Is that correct?

Thats the job of the separate disk, saving that stuff.
>
> What is the _right_ way to do this? And, if I were using Amanda as its
> creators obviously intended and backing up multiple machines, what
> would the recommended way to back up the Amanda server itself (ie its
> configuration and current state) be?

Poke around on my site in the sig and get the GenesAmandaHelper stuff, 
install it in a subdir of the same name, and change your cron job to run 
backup.sh that you will find in this subdir when its unpacked. You may 
have to edit something, and play with the onwer:group settings etc to 
get it to run, possibly even a configuration change but the idea is 
there.

> I plan in a few days to boot this machine from a live Jessie ISO, and
> run a "restore" to a spare large disk I have lying around, to check I
> understand how to restore after a disaster. Preparing myself mentally
> for that has led me to the realisation I am nowhere near ready in my
> understanding...

This will be a good learning experience in that regard.

I am disgustingly sold on amanda being a better idea. The original theory 
was that with the limited size of tapes back in the dark ages, amanda 
played mix & match with the backup incrementals to try to achieve the 
same tape usage every run, ideally filling each tape to maximum 
capacity, and that worked well enough to surprise me. However, the 
development of vtapes, which are nothing more than directories and tgz 
files per disklist entry in those directories, converts amanda's 
recovery operations into random access as opposed to reading the whole 
tape to find one 273 byte file, so recoveries are much less painfull.

Throw in that I have found over the years that hard drives, since made in 
macroscopic quantities compared to tapes and tape drives, are easily 20 
to 1000x more dependable than the tapes I could afford in quantities for 
a 30 day recovery, thats all gravy.

My current /amandatapes drive had 25 reallocated sectors the first time I 
checked it with smartctl at perhaps 5k hours, I downloaded and installed 
fresh firmware from the seagate site, didn't lose a byte and gained 
drive data r/w speed and earlier this week that same still reports that 
same 25 re-allocated sectors after something north of 62,000 spinning 
hours. No tape drive regardless of the size of the pile of sheckles you 
paid for it, can realisticly do 10% of that service life. In my 
experience, they had an urge to spend about 6 weeks in Oklahoma City 
being rebuilt over the Thanksgiving -> New years period.

That faint thumping sound?  Me, knocking on my skull as a good substitute 
for wood. ;-) IWFM. YMMV.

> I know there are some long-standing users of Amanda on here so I'm
> hoping someone can help me figure out what I am missing...

Does since 1999 count? ;-)

> Thanks in advance
>
> Mark


Cheers, Gene Heskett
-- 
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
Genes Web page <http://geneslinuxbox.net:6309/gene>