SC Tape Setup - Some Useful Commands
Here are some notes on useful commands:
- Query the autochanger:
/usr/sbin/mtx -f /dev/sg2 status - Query the status of a drive:
mt -f /dev/nst0 status - Find out which block on tape we are at:
mt -f /dev/nst1 tell - 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 |
+-----------------+-----------------+-----------+------------+-----------+-----------+ - 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>& - 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 |
+---------------+--------+--------+