Chg-disk

From wiki.zmanda.com
Revision as of 16:13, 23 June 2008 by Dustin (talk | contribs) (from Changers with some additions)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Clone of the chg-zd-mtx, but modified to be applied on local directories instead of tapes. This changer emulates a robot that uses virtual tapes instead of real ones, where the virtual tapes are real directories on a hard disk.

The directory tree should be:

$slot_root_dir -|
                |- info
                |- data -> slot1/
                |- slot1/
                |- slot2/
                |- ...
                |- slotn/

Where "$slot_root_dir" appears in the tapedev as "file:$slot_root_dir", and "n" is the tapecycle parameter.

A plain VFS Device is given a directory $DIR, and stores dumps in $DIR/data. This changer uses a symlink to point $DIR/data to the requested slot -- a clever trick. As a result, it is not possible to manually point an application directly at a slot:

amrestore tape:$slot_root_dir/slot7      # DOESN'T WORK

instead, use amtape to "load" that slot:

amtape CONFIG slot 7

or set the symlink manually:

( cd $slot_root_dir; rm data; ln -s slot7 data )