Results 1 to 3 of 3

Thread: Using 'new' chg-disk with vtapes - what is drive0?

  1. #1

    Default Using 'new' chg-disk with vtapes - what is drive0?

    Hi all

    I am using Amanda 2.6.1p2. My configuration is:

    * SLES10 x64
    * Backing up to CIFS share
    * Using 'new' chg-disk changer

    I have configured the system as per the following documents:

    [url]http://wiki.zmanda.com/index.php/How_To:Set_Up_Virtual_Tapes[/url]

    [url]http://wiki.zmanda.com/index.php/How_To:Backup_to_Virtual_Tapes_on_a_non-UNIX_Filesystem[/url]


    And here is the relevant excerpt from my amanda.conf:

    Code:
    dumpcycle 1week         # the number of days in the normal dump cycle
    runspercycle -1         # the number of amdump runs in dumpcycle days
    tapecycle 10    # the number of tapes in rotation
    runtapes 1              # number of tapes to be used in a single run of amdump
    tpchanger "chg-disk:/var/lib/amanda/vtapes/myhost"     # the tape-changer glue script
    # tapedev "file:/var/lib/amanda/vtapes/myhost"        # the no-rewind tape device
    # changerfile "/etc/amanda/myhost/changer.conf"        # tape changer configuration parameter file
    changerdev "/dev/null"  # tape changer configuration parameter device
    tapetype HARDDISK       # what kind of tape it is
    # labelstr "tape-%%"    # label constraint regex: all tapes must match
    label_new_tapes "tape-%%"       # And then label any unlabelled tapes in this format
    dtimeout 1800   # number of idle seconds before a dump is aborted
    ctimeout 30     # max number of secconds amcheck waits for each client
    etimeout 300    # number of seconds per filesystem for estimates
    define dumptype global {
           comment "Global definitions"
           auth "bsdtcp"
    }
    define dumptype suse {
           global
           program "GNUTAR"
           comment "Dumped with GNU tar"
           compress none
           index yes
    }
    define tapetype HARDDISK {
           comment "Virtual Tapes"
           length 5000 mbytes
    }
    includefile "advanced.conf"
    includefile "/etc/amanda/template.d/dumptypes"
    includefile "/etc/amanda/template.d/tapetypes"
    I can label, I can backup, my problem is that Amanda cannot read the labels and hence never changes slots as it always believes slot 1 has no tape loaded which has no doubt has rendered the backup unreadable anyway.

    After running amcheck <myconfig>, I get the following:

    Code:
    /var/lib/amanda/vtapes/myhost # ll
    lrwxrwxrwx 1 amandabackup disk  5 2010-05-18 10:39 current -> slot1
    lrwxrwxrwx 1 amandabackup disk  5 2010-05-18 10:31 data -> slot1
    lrwxrwxrwx 1 amandabackup disk 40 2010-05-14 23:56 slot1 -> /mnt/amanda/vtapes/myhost/slot1
    lrwxrwxrwx 1 amandabackup disk 41 2010-05-14 23:56 slot10 -> /mnt/amanda/vtapes/myhost/slot10
    lrwxrwxrwx 1 amandabackup disk 40 2010-05-14 23:56 slot2 -> /mnt/amanda/vtapes/myhost/slot2
    lrwxrwxrwx 1 amandabackup disk 40 2010-05-14 23:56 slot3 -> /mnt/amanda/vtapes/myhost/slot3
    lrwxrwxrwx 1 amandabackup disk 40 2010-05-14 23:56 slot4 -> /mnt/amanda/vtapes/myhost/slot4
    lrwxrwxrwx 1 amandabackup disk 40 2010-05-14 23:56 slot5 -> /mnt/amanda/vtapes/myhost/slot5
    lrwxrwxrwx 1 amandabackup disk 40 2010-05-14 23:56 slot6 -> /mnt/amanda/vtapes/myhost/slot6
    lrwxrwxrwx 1 amandabackup disk 40 2010-05-14 23:56 slot7 -> /mnt/amanda/vtapes/myhost/slot7
    lrwxrwxrwx 1 amandabackup disk 40 2010-05-14 23:56 slot8 -> /mnt/amanda/vtapes/myhost/slot8
    lrwxrwxrwx 1 amandabackup disk 40 2010-05-14 23:56 slot9 -> /mnt/amanda/vtapes/myhost/slot9
    Mmmmnn... a 'current' symlink - not seen that one mentioned before...

    I now label my vtapes:

    Code:
    $ amlabel myhost <tape number> <slot number>
    Okay so lets have a look inside 'current' or 'data'

    Code:
    /var/lib/amanda/vtapes/myhost # ll -H current
    total 32
    -rw------- 1 root root 32768 May 18 10:39 00000.tape-01
    Yep - that looks labeled.

    Okay so lets run a backup and see what happens...

    Code:
    /var/lib/amanda/vtapes/myhost # ll
    total 0
    lrwxrwxrwx 1 amandabackup disk  5 May 18 10:51 current -> slot1
    lrwxrwxrwx 1 amandabackup disk  5 May 18 10:31 data -> slot1
    drwx------ 2 amandabackup disk 72 May 18 10:51 drive0
    lrwxrwxrwx 1 amandabackup disk 40 May 14 23:56 slot1 -> /mnt/amanda/vtapes/myhost/slot1
    lrwxrwxrwx 1 amandabackup disk 41 May 14 23:56 slot10 -> /mnt/amanda/vtapes/myhost/slot10
    lrwxrwxrwx 1 amandabackup disk 40 May 14 23:56 slot2 -> /mnt/amanda/vtapes/myhost/slot2
    lrwxrwxrwx 1 amandabackup disk 40 May 14 23:56 slot3 -> /mnt/amanda/vtapes/myhost/slot3
    lrwxrwxrwx 1 amandabackup disk 40 May 14 23:56 slot4 -> /mnt/amanda/vtapes/myhost/slot4
    lrwxrwxrwx 1 amandabackup disk 40 May 14 23:56 slot5 -> /mnt/amanda/vtapes/myhost/slot5
    lrwxrwxrwx 1 amandabackup disk 40 May 14 23:56 slot6 -> /mnt/amanda/vtapes/myhost/slot6
    lrwxrwxrwx 1 amandabackup disk 40 May 14 23:56 slot7 -> /mnt/amanda/vtapes/myhost/slot7
    lrwxrwxrwx 1 amandabackup disk 40 May 14 23:56 slot8 -> /mnt/amanda/vtapes/myhost/slot8
    lrwxrwxrwx 1 amandabackup disk 40 May 14 23:56 slot9 -> /mnt/amanda/vtapes/myhost/slot9
    Well now I've got a drive0 directory!!! And inside:

    Code:
    /var/lib/amanda/vtapes/myhost # ll drive0
    total 0
    lrwxrwxrwx 1 amandabackup disk 8 May 18 10:51 data -> ../slot1
    I've got another symlink pointing to slot1 ???

    Backup finished - looks good

    Code:
    /var/lib/amanda/vtapes/myhost # ll -hH current
    total 32K
    -rw------- 1 root root  32K May 18 10:51 00000.tape-01
    -rw------- 1 root root 2.7G May 18 10:51 00001.myhost._srv.0
    So it's backed up okay. Let's have a look at my tapes

    Code:
    $ amtape myhost show
    amtape: scanning all 10 slots in tape-changer rack:
    amtape: slot   1: Error loading device header -- unlabeled volume?
    slot   2: time X              label tape-02
    slot   3: time X              label tape-03
    slot   4: time X              label tape-04
    slot   5: time X              label tape-05
    slot   6: time X              label tape-06
    slot   7: time X              label tape-07
    slot   8: time X              label tape-08
    slot   9: time X              label tape-09
    slot  10: time X              label tape-10
    Mmmnnn...that's odd I could have sworn I just not only labeled it but backed up to it!

    Let's have a look in the amtape debug log:

    Code:
    1274177663.899867: amtape: Device file:/var/lib/amanda/vtapes/myhost/drive0 error = 'Couldn't open file /var/lib/amanda/vtapes/myhost/drive0/data//00000.tape-01: Permission denied'
    1274177663.899928: amtape: Device file:/var/lib/amanda/vtapes/myhost/drive0 setting status flag(s): DEVICE_STATUS_DEVICE_ERROR
    1274177663.899944: amtape: Device file:/var/lib/amanda/vtapes/myhost/drive0 error = 'Error loading device header -- unlabeled volume?'
    1274177663.899960: amtape: Device file:/var/lib/amanda/vtapes/myhost/drive0 setting status flag(s): DEVICE_STATUS_DEVICE_ERROR, DEVICE_STATUS_VOLUME_UNLABELED, and DEVICE_STATUS_VOLUME_ERROR
    Referencing drive0 which does not exist except at backup time when Amanda creates yet another symlink but only for the duration of the backup. Can anyone explain this behaviour for me?

    Many thanks

    James

  2. #2
    Join Date
    Mar 2007
    Location
    Chicago, IL
    Posts
    688

    Default

    Whenever I see bogus "Permission Denied" errors, I suspect selinux. Perhaps it is in the "nonfunction" configuration, also known as "enabled"? Try setting selinux to the "functional" configuration, also known as "disabled".

  3. #3

    Default

    This was down to bad permissions on the CIFS share. I was distracted by the log error inidcating symlinks that are not mentioned in the documentation.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •