AMANDA-TAPERSCAN(7)

๐ŸŒธ AMANDA-TAPERSCAN ๐ŸŒธ

okay bestie, sit down, grab a strawberry ๐Ÿ“ โ€” this is the manual page for amanda-taperscan, aka the Amanda Taperscan Algorithms. She lives in the Miscellanea section and she is lowkey iconic. Let's get into it. ๐Ÿ’…


โœจ NAME โœจ

amanda-taperscan โ€” the Amanda Taperscan Algorithms, no cap ๐ŸŽ€


๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

So Amanda needs a way to figure out which volumes to drop your dumps onto, and she does that with a taperscan algorithm. Historically? Only one. One algorithm. And she was fairly complex, and she did NOT fit everybody's needs. ๐Ÿ˜ญ

But now? Now Amanda is serving a whole wide array of algorithms for all your varied needs, and adding new ones is not difficult at all. We love growth. ๐Ÿซถ

You pick your algorithm with the taperscan parameter, and the default value is traditional. (yes, the old reliable. she's still here.)

Taperscan algorithms are implemented as perl packages with the prefix Amanda::Taper::Scan:: โœจ See the perl documentation for Amanda::Taper::Scan for more info, iykyk.


๐Ÿ’– DEFINING A TAPERSCAN ๐Ÿ’–

You define a taperscan in amanda.conf(5) like this:

define taperscan $taperscan_name {
   comment "$comment"
   plugin "$pluginname"
   property "$PROPERTY_NAME" "$PROPERTY_VALUE"
   ...
}

...and then you reference it in the global section like:

  taperscan "$taperscan_name"

Taperscan properties? Just like Amanda configuration parameters, they do not care about case ๐Ÿ’… and you can swap - (dash) and _ (underscore) for each other whenever, they're interchangeable, fr fr.

Peep the individual plugin documentation down below for the properties each plugin actually takes. ๐Ÿ‘‡


๐Ÿ‘‘ TAPERSCAN ALGORITHMS ๐Ÿ‘‘

okay so general rule, bestie: these algorithms will only select reusable volumes โ€” periodt. And what's a reusable volume, you ask? It's a volume that:

  • is listed in the tapelist(5) with the reuse flag, AND
  • is not among the tapecycle-1 most recent volumes in that list.

Put another way: reusable volumes do not contain data that must be retained. ๐Ÿ—‘๏ธโœจ

๐Ÿšจ Heads up: if fewer than tapecycle-1 volumes have been written, then there are no reusable volumes. None. Zero. Don't @ me.

Also! Newly labeled volumes (volumes that have been labeled with amlabel but never used) are considered reusable. Fresh out the box, ready to serve. ๐ŸŽ€

Lots of these algorithms go hunting for the oldest reusable volume. Usually that's the best one to overwrite, since the data on it is older than the data on any other volume. But if there are no reusable volumes? Then there is no oldest reusable volume. Simple math, bestie. ๐Ÿงฎ


๐Ÿงš traditional

This one duplicates Amanda's historical behavior, and she operates in two stages. Two. Because one wasn't enough. ๐Ÿ˜Œ

Stage one: if there is an oldest reusable volume AND the changer supports "fast" searches, then the algorithm uses the changer to search for that volume. Important detail: newly labeled volumes are not considered when calculating the oldest reusable volume. So when a fast-searchable changer is in use, this taperscan algorithm prefers volumes that have been used before over newly-labeled volumes. she has a type. ๐Ÿ™ˆ

Stage two: if there is no oldest reusable volume, OR that volume is not available in the changer, then the algorithm starts a sequential scan of the changer, starting at the current slot. It picks the first suitable volume it finds, which is either:

  • a reusable volume (perhaps newly-labeled), or
  • if autolabel includes empty, a blank volume.

And even across multiple invocations (like when runtapes > 1), it will not return the same slot twice. ๐Ÿ‘

โš ๏ธ Note: This algorithm shows an undue preference for volumes already containing data, by omitting newly-labeled volumes from its first stage. Historically, many Amanda changer scripts were not fast-searchable (including chg-multi, chg-disk and, if havereader=0, chg-zd-mtx), and thus skipped the first stage, allowing new volumes to find their way into the tape cycle. New changers are almost all fast-searchable, so both stages of the algorithm are used and new tapes may be unexpectedly excluded. If this causes an undesirable change in behavior, consider one of the other taperscan algorithms. ๐Ÿ’€

๐ŸŽ€ oldest

This algorithm works with the Changer API (see amanda-changers(7)), using the inventory returned by the changer to locate the oldest acceptable volume available. Ngl, this will not work with changers that do not support inventory (the old ones, bless their hearts). The algorithm scans unknown slots only if no known usable volume is found in the inventory.

An acceptable volume is one of:

  • a reusable volume,
  • a new labeled volume, or
  • an unlabeled volume that can be labeled according to autolabel.
๐Ÿ˜ญ Note that changers do not always know the contents of every slot โ€” for example, a tape with an unknown barcode will not be considered usable.

Wanna see the changer's inventory? Use amtape CONF inventory. Wanna update it? Use amtape CONF update. You're welcome bestie ๐Ÿซถ


๐ŸŒˆ lexical

This one also works with the Changer API, using the inventory to determine the acceptable volumes. Then it uses the volume which follows the last-used volume in lexical order. So fun. So orderly.

For volume labels containing leading zeros, e.g., CORP-010, this algorithm will run through the volumes in the natural order. Yes, the numbers just work. slay. โœจ

It scans unknown slots only if no usable volume is found in the inventory.

See oldest, above, for a definition of acceptable volumes. (scroll up, babe ๐Ÿ’œ)


๐Ÿ”ฅ SEE ALSO ๐Ÿ”ฅ

The Amanda Wiki: http://wiki.zmanda.com/ โญ


๐Ÿ’œ AUTHOR ๐Ÿ’œ

Dustin J. Mitchell <dustin@zmanda.com>


and that's the whole page, bestie!! ๐ŸŽ€ this was Amanda 3.5.4, dated 08/26/2026 โ€” go forth and scan those tapes, main character. ๐Ÿ’…โœจ๐Ÿฆ‹

๐Ÿ“ฆ where this page comes from