FAQ:Why does Amanda not append to a tape?: Difference between revisions

From wiki.zmanda.com
Jump to navigation Jump to search
No edit summary
 
 
(2 intermediate revisions by 2 users not shown)
Line 6: Line 6:


Doing "mt -f /dev/st0 status" could be enough, or even "amcheck daily".
Doing "mt -f /dev/st0 status" could be enough, or even "amcheck daily".
Also, some error like a scsi bus reset implies a rewind.
Also, an error like a scsi bus reset implies a rewind.


If Amanda would close and reopen the tape drive for each backup image,
If Amanda would close and reopen the tape drive for each backup image,
there is a window of vulnerability that the tape gets rewound accidentally,
there is a window of vulnerability that the tape gets rewound accidentally,
and the next image will overwriting all the good backups on the tape.
and the next image will overwrite all the good backups on the tape.
And you wouldn't know unless you tried to restore from it.
And you wouldn't know unless you tried to restore from the tape.


When appending to a tape, there is the possibility that, between
When appending to a tape, there is the possibility that, between
Line 20: Line 20:


Even a vtape (virtual tape emulated on disk) has that problem: a scsi
Even a vtape (virtual tape emulated on disk) has that problem: a scsi
bus reset does not rewind the vtape, but you still can mess with "amcheck"
bus reset does not rewind the vtape, but you still can mess with [[amcheck]]
or "ammt", or you are running amrecover to restore a file using the chg-disk
or [[ammt]], or you are running amrecover to restore a file using the chg-disk
changer from the level 0, while the backup is still running and you forgot  
changer from the level 0, while the backup is still running and you forgot  
that while hunting to find the tape with the right label, it rewinds each
that while hunting to find the tape with the right label, it rewinds each
Line 31: Line 31:
run = one (set of) tapes.
run = one (set of) tapes.


When you have indeed grossly oversized the tape drive, and there is no
When you have indeed grossly over sized the tape drive, and there is no
budget anymore to buy more cartridges because all the money went into
budget anymore to buy more cartridges because all the money went into
the expensive tape drive, then there also a plan B.
the expensive tape drive, then there also a plan B.


Buy a large holdingdisk instead.  
Buy a large holding disk instead.  
Set the default "reserve 100" parameter in amanda.conf to something less, like 30,  
Set the default "reserve 100" parameter in amanda.conf to something less, like 30,  
and set the parameter "autoflush true" as well.
and set the parameter "autoflush true" as well.
Do not insert a tape for a few days and let Amanda collect the backups
Do not insert a tape for a few days and let Amanda collect the backups
on the holdingdisk.
on the holding disk.
When you believe the accumulated backup images on the holdingdisk will fill  
When you believe the accumulated backup images on the holding disk will fill  
a tape, insert a tape, and run "amflush", or just let Amanda autoflush the collected images, together with the backup of that night to tape.
a tape, insert a tape, and run [[amflush]], or just let Amanda autoflush the collected images, together with the backup of that night to tape.
 
But first ask yourself, "If my data is worth so little
that I can not afford a few more tapes, why am I backing it up?"
 
{| style="margin-top:20px; border:2px solid; background:#efefef; width:100%"
|'''Note'''
Most of the time it won't be YOU paying for the tapes as you may be working for some company. If your boss tries to force you into doing this multiple-dumps-on-one-tape thing, be sure to point him at this risk. Business people tend to understand the price-difference between some tapes and a major data-loss. -- Stefan G. Weichinger
|}

Latest revision as of 22:30, 23 May 2007

One run of Amanda = one (set of) tapes. Amanda opens the tape device once, writes all the images and filemarks, and closes the device once. Using that sequence, there is no possibility that other programs interrupt the sequence and rewind the tape, without Amanda noticing.

Doing "mt -f /dev/st0 status" could be enough, or even "amcheck daily". Also, an error like a scsi bus reset implies a rewind.

If Amanda would close and reopen the tape drive for each backup image, there is a window of vulnerability that the tape gets rewound accidentally, and the next image will overwrite all the good backups on the tape. And you wouldn't know unless you tried to restore from the tape.

When appending to a tape, there is the possibility that, between the time that Amanda positions to the last image (that already is not really trivial!), and opening the device for writing, a tape rewind happens, and in that case Amanda would happily erase ALL of the tape, containing possibly many days worth of backup.

Even a vtape (virtual tape emulated on disk) has that problem: a scsi bus reset does not rewind the vtape, but you still can mess with amcheck or ammt, or you are running amrecover to restore a file using the chg-disk changer from the level 0, while the backup is still running and you forgot that while hunting to find the tape with the right label, it rewinds each tape. (But on vtapes you care less about the not-used space at the end of a vtape anyway.)

Until someone can create a patch that gives enough confidence that such a sequence cannot happen, many experienced sysadmins will stay with one run = one (set of) tapes.

When you have indeed grossly over sized the tape drive, and there is no budget anymore to buy more cartridges because all the money went into the expensive tape drive, then there also a plan B.

Buy a large holding disk instead. Set the default "reserve 100" parameter in amanda.conf to something less, like 30, and set the parameter "autoflush true" as well. Do not insert a tape for a few days and let Amanda collect the backups on the holding disk. When you believe the accumulated backup images on the holding disk will fill a tape, insert a tape, and run amflush, or just let Amanda autoflush the collected images, together with the backup of that night to tape.

But first ask yourself, "If my data is worth so little that I can not afford a few more tapes, why am I backing it up?"

Note

Most of the time it won't be YOU paying for the tapes as you may be working for some company. If your boss tries to force you into doing this multiple-dumps-on-one-tape thing, be sure to point him at this risk. Business people tend to understand the price-difference between some tapes and a major data-loss. -- Stefan G. Weichinger