TRIUMF Grid Software and Applications

SC Tape Setup - Some Useful Commands

Here are some notes on useful commands:

  1. Query the autochanger:
    /usr/sbin/mtx -f /dev/sg2 status
  2. Query the status of a drive:
    mt -f /dev/nst0 status
  3. Find out which block on tape we are at:
    mt -f /dev/nst1 tell
  4. Find out which devices are attached to tape server:
    
    mysql -u taper -p smallhsm
    mysql> select name, hostname, mediatype, changerdev, tapedev0, tapedev1 from library;
    +-----------------+-----------------+-----------+------------+-----------+-----------+
    |name           | hostname        | mediatype | changerdev | tapedev0  | tapedev1  |
    +-----------------+-----------------+-----------+------------+-----------+-----------+
    | 4560SLX-1       |sc4.triumf.ca    | SDLT-320  | /dev/sg2  | /dev/nst0 | /dev/nst1 |
    | 4560SLX-2       |sc4.triumf.ca    | SDLT-320  | /dev/sg4   | /dev/nst2 | NULL      |
    | OVERLAND neo    |tw00.triumf.ca   | SDLT-320  | /dev/sg1   | /dev/nst0 | NULL      |
    | OVERLAND amanda |amanda.triumf.ca | SDLT-600  | /dev/sg1   | /dev/nst0 | NULL      |
    +-----------------+-----------------+-----------+------------+-----------+-----------+
  5. Delete all files from database and restart library daemons:
    
    mysql -u taper -p smallhsm
    mysql> delete from files;
    mt -f /dev/nst0 rewind
    cd ~/smallhsm/bin/
    nohup ./smallhsm_libd >>../var/daemon.log 2>&
  6. Get summary of bytes, tape labels and # files from database:
    mysql> select sum(bytesize),label, count(pnfsid) as nfiles from files group by label;
    +---------------+--------+--------+
    | sum(bytesize) | label  | nfiles |
    +---------------+--------+--------+
    |    4458573880 | PRY763 |     20 |
    +---------------+--------+--------+