Results 1 to 10 of 10

Thread: Tape Library help

  1. #1

    Default Tape Library help

    Hello

    I'm trying to config a Tape Library with Amanda 2.6.1 with CentOS 5.4 server and clients. I've gotten Amanda to work with vtapes and harddisk backups, as well as backups to a single tape drive, but I'm struggling with configuring our Tape Library (HP StorageWorks MSL 2024).

    I tried the following:

    $ amserverconfig TestLibrary --template tape-changer \
    --mailto root@localhost --dumpcycle 7 --runspercycle 5 \
    --tapecycle 12 --runtapes 2 --tapetype HP-LTO4 \
    --tapedev /dev/sg3 --tpchanger chg-zd-mtx --changerdev /dev/sg3


    which appeared to work until I ran the amcheck, and got the following:

    $ amcheck TestLibrary
    Amanda Tape Server Host Check
    -----------------------------
    slot 1:Error reading label: File /dev/sg3 is not a tape device.
    slot 2:Error reading label: File /dev/sg3 is not a tape device.


    Which seems odd to me, as the output of
    #mtx -f /dev/sg3 inquiry
    #mtx -f /dev/sg3 status
    commands returns valid output when using /dev/sg3...

    I'm not sure about the tpchanger, tapetype, tapedev, changerdev and changerfile config options, so these are kind of a best guess, but I'm surpised that /dev/sg3 doesn't seem correct as my mtx commands return valid output:

    $ mtx -f /dev/changer inquiry
    Product Type: Medium Changer
    Vendor ID: 'HP '
    Product ID: 'MSL G3 Series '
    Revision: '4.60'
    Attached Changer: No

    $ mtx -f /dev/changer status
    Storage Changer /dev/changer:1 Drives, 24 Slots ( 0 Import/Export )
    Data Transfer Element 0:Full (Storage Element 1 Loaded):VolumeTag = CS7100L4
    Storage Element 1:Empty
    Storage Element 2:Full :VolumeTag=CS7101L4
    Storage Element 3:Full :VolumeTag=CS7102L4
    Storage Element 4:Full :VolumeTag=CS7103L4
    Storage Element 5:Full :VolumeTag=CS7104L4
    Storage Element 6:Full :VolumeTag=CS7105L4
    Storage Element 7:Full :VolumeTag=CS7106L4
    ...


    I'm labeling my tapes now and will try it again using /dev/nst1 for tapedev, but I'm still grasping at straws and could use some helpful advice or direction on working with changers/libraries.

    Many thanks in advance.

    -pkb

  2. #2
    Join Date
    Aug 2008
    Location
    Sunnyvale, CA
    Posts
    306

    Default

    It looks like you have already solved it. The only thing that looks incorrect is also using /dev/sg3 for tapedev. Looks like your tape device name is /dev/nst1 and this is what should be used for tapedev. You should be able to just edit amanda.conf and make this change for tapedev for things to work.

    Paul

  3. #3

    Default progress

    After changing the tapedev to /dev/nst1 and labeling the tapes it appears that my first test backup to our HP MSL2024 Tape Library succeeded.

    Though when trying to do a test restore, without the proper tape in the drive (returned to its storage slot), I got an error to load 'such and such' tape.

    How do I know which slot in the library that tape is, since the label on the exterior of the tape doesn't match the labels I used with amlabel?

    -pkb

  4. #4
    Join Date
    Aug 2008
    Location
    Sunnyvale, CA
    Posts
    306

    Default

    Is it an error or information? Usually all that is needed is for the tapes mentioned in the message to be within the slots configured. As long as they are, Amanda will find the tapes and load as needed when you continue.

  5. #5

    Default

    Well I thought it was an error, but it was probably just an informational message which I'm not sure how to react to. i.e. "How do I know which slot TestLibraryXX tape is in if 'mtx -f /dev/changer status' lists the barcode labels instead of the Amanda labels?"

    In other words, how do I keep the location of the tapes straight with regard to their Amanda Labels and the physical slots in the library? Or do I not need to? Does Amanda manage this for me?

    In either case, I'm re-running the test now to get the exact syntax of the message to post again here.

  6. #6
    Join Date
    Aug 2008
    Location
    Sunnyvale, CA
    Posts
    306

    Default

    No, you don't really need to. What Amanda is really getting at is "are every one of these tapes going to be found by the changer during the restore" or are they sitting on a shelf somewhere. Some people may configure their changer to use 5 slots and rotate a 5 new tapes in each week, for instance. In that case, not all the tapes needed for the restore may be found in the changer at any given time. If the full set of tapes used by Amanda remain in your changer, then you know the tapes are there and can just continue.

    FYI, you can run "amtape <config> show" to have Amanda scan through all the slots used by the config and read off any Amanda label found for you. This can take a long time to load and unload each tape though.

  7. #7

    Default

    Ok, I ran:

    #amtape {config} show

    and can see the desired tapes sitting is slots 1,2,3...

    -sh-3.2$ amtape TestLibrary show
    amtape: scanning all 24 slots in tape-changer rack:
    slot <error>: Drive not ready after 120 seconds: File /dev/nst0 is not a tape device
    slot 1: time 20100602182913 label TestLibrary-01
    slot 2: time X label TestLibrary-02
    slot 3: time X label TestLibrary-03
    ...
    slot 11: time X label TestLibrary-11
    slot 12: time 20100603170359 label amtapetype-1489586884
    amtape: slot 13: Error reading Amanda header
    ...


    (I've since run 2 more amdumps, and oddly, the 2nd backup appears, from the output above, to have been written to tape TestLibrary-12, in slot 12.... Don't know how this happened, I expected it to go to tape2 in slot2... Peculiar, but probably due to something I did ... ideas?)

    Then just completed a third amdump, and intentionally unloaded the tape back to its slot (3).

    Now back to the original question:

    I reran/attempted another amrecover, and here's the output that I get:

    amrecover> add RHEL_5.5.tgz
    Added file /tmp/RHEL_5.5.tgz
    amrecover> extract

    Extracting files using tape drive /dev/nst0 on host lab.xxx.yyy.edu.
    The following tapes are needed: TestLibrary-03

    Restoring files into directory /tmp/scratch
    Continue [?/Y/n]? y

    Extracting files using tape drive /dev/nst0 on host lab.xxx.yyy.edu.
    Load tape TestLibrary-03 now
    Continue [?/Y/n/s/d]?
    Load tape TestLibrary-03 now
    Continue [?/Y/n/d]?
    Not an amanda tape: Tape device /dev/nst0 is not ready or is empty
    Load tape TestLibrary-03 now


    I know the tape is not in the drive, but it is in the library. It's sitting in slot 3 of 24.

    It appears that Amanda can't tell that my TestLibrary3 tape is sitting in slot 3 of my Library.

    Did I miss a config step somewhere, or do I need to manually load the correct tape from its storage slot into the drive?

    Thanks again.

  8. #8
    Join Date
    Aug 2008
    Location
    Sunnyvale, CA
    Posts
    306

    Default

    After the extract, it says, "Extracting files using tape drive /dev/nst0 on host lab.xxx.yyy.edu." This is not using the "changer" but is using the stand-alone tape drive /dev/nst0 which is why the tape is not being loaded by the changer. In this case, Amanda is expecting you to load the tape in the drive /dev/nst0. Where is Amanda getting this tape device name? Are you specifying it from the amrecover prompt or is it specified in the amanda-client.conf file on the client?

  9. #9

    Default

    Ok... It's using /dev/nstx because that's what *I* put in the client's /etc/amanda/TestLibrary/amanda-client.conf:

    tapedev "/dev/nst0"

    But this circles back to the original post/question. In that, I used this syntax:

    $ amserverconfig TestLibrary --template tape-changer \
    --mailto root@localhost --dumpcycle 7 --runspercycle 5 \
    --tapecycle 12 --runtapes 2 --tapetype HP-LTO4 \
    --tapedev /dev/sg3 --tpchanger chg-zd-mtx --changerdev /dev/sg3


    Where tapedev ==> /dev/sg3, tpchanger ==> chg-zd-mtx, and changerdev ==> /dev/sg3

    Which lead to the following error when running amcheck:

    slot 1:Error reading label: File /dev/sg3 is not a tape device.

    Which I followed up by doing 2 things:
    a) labeling 12 of the 24 tapes in the library, and
    b) changing the tapedev from /dev/sgx to /dev/nstx

    So, since the amdump seems to work correctly using these values from /etc/amanda/TestLibrary/amanda.conf:

    tpchanger "chg-zd-mtx"
    tpchanger "chg-zd-mtx"
    tapedev "/dev/nst0"
    changerfile "/etc/amanda/TestLibrary/changer.conf"
    changerdev "/dev/changer"
    tapetype HP-LTO4


    I'm guessing I'm going wrong somewhere in my definitions of tpchanger, tapedev, changerfile, changerdev ...

    Do I *not* need to specify tapedev = /dev/nstx if I specify a changerdev & tpchanger?

    The whole changer/library thing is still grey to me...

    Questions:

    Q1: How do I know which tpchanger to use?

    (The mtx command I use to control the library needs commands like:
    # mtx -f /dev/sg2 status
    So I assumed I need 'chg-zd-mtx' based on the 'chg-mtx' wiki page. This same page says 'changerdev' and 'tapedev' will likely reference the same device, which is why I used /dev/nstx in the tapedev, but perhaps this is incorrect?...)

    Q2: Is the 'chg-zd-mtx' even the right changer script to use with the HP StorageWorks MSL 2024?

    Q3: Do I need to specify all tapedev, changerdev & tpchanger?


    Sorry, the more I think I understand, the more questions arise...

    Thanks for you generous help so far!

    -pkb

  10. #10
    Join Date
    Aug 2008
    Location
    Sunnyvale, CA
    Posts
    306

    Default

    Quote Originally Posted by pkb View Post
    Q1: How do I know which tpchanger to use?

    (The mtx command I use to control the library needs commands like:
    # mtx -f /dev/sg2 status
    So I assumed I need 'chg-zd-mtx' based on the 'chg-mtx' wiki page. This same page says 'changerdev' and 'tapedev' will likely reference the same device, which is why I used /dev/nstx in the tapedev, but perhaps this is incorrect?...)
    I am not certain about with the chg-mtx script but, at least with chg-zd-mtx, the two device names will not be the same. One will be for the changer device name and the other for the tape drive device name.

    Q2: Is the 'chg-zd-mtx' even the right changer script to use with the HP StorageWorks MSL 2024?
    As the wiki says, this depends more on your server's mtx command than the hardware you are using. Given the output you show, I would say yes.

    Q3: Do I need to specify all tapedev, changerdev & tpchanger?
    Yes, you should specify the desired values for all three.

    As for the restore, I believe all you need to do is to comment out the tapedev line you show for /etc/amanda/TestLibrary/amanda-client.conf. Not specifying this should get amrecover to work with your changer instead of only your tape drive.

    Sorry, the more I think I understand, the more questions arise...

    Thanks for you generous help so far!
    No problem. Hope this helps.

Tags for this Thread

Posting Permissions

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