Tape drive : Miscellaneous commands and tips



You will find here some quick notes that may be useful when dealing with a tape drive.
Those tiny notes applies for a PowerVault LTO-3 Tape Drive, but i am sure you can adapt them quite quickly to works with other brand.






More “sysadmin” posts


1) Check for tape drive correct detection

  • To ensure that your tape drive is correctly detected by your *nux box:
    grep -i ULTRIUM /proc/scsi/scsi

Sample Code :

[root@server ~]# grep -i  ULTRIUM /var/log/messages
Sep  4 17:18:40 epr-mod-70 kernel:   Vendor: IBM       Model: ULTRIUM-TD3       Rev: 93G6
[root@server ~]#

2) Check the tape drive status

  • To ensure that your tape drive is up and accessible:
    mt -t /dev/st0 status

Sample Code :

[root@server ~]# mt -t /dev/st0 status
SCSI 2 tape drive:
File number=-1, block number=-1, partition=0.
Tape block size 0 bytes. Density code 0x0 (default).
Soft error count since last status=0
General status bits on (50000):
[root@server ~]#


3) Find the tape drive serial number

I could not find it using the omreport tools, nor lspci, i had to use the smartctl command : You are welcome to tell us hos to do it using another utility ! (the comment section might be useful in this case)

smartctl -a /dev/nst0

Sample Code :

[root@server ~]# smartctl -a /dev/nst0
smartctl 5.42 2011-10-20 r3458 [x86_64-linux-2.6.18-194.el5] (local build)
Copyright (C) 2002-11 by Bruce Allen, http://smartmontools.sourceforge.net

Vendor:               IBM
Product:              ULTRIUM-TD3
Revision:             93G6
Serial number:        1210420003
Device type:          tape
Local Time is:        Fri Sep  6 14:23:57 2013 CEST
NO MEDIUM present on device
A mandatory SMART command failed: exiting. To continue, add one or more '-T permissive' options.
[root@server ~]#


– add commands to send (replace, add at the end of current files etc …) , list and retrieve from a tape drive
– add commands to change position of tape magnetic band (rewind etc …)



  • man mt
  • man smartctl
Tagged on: , , , ,

Leave a Reply

Your email address will not be published. Required fields are marked *

This site supports SyntaxHighlighter via WP SyntaxHighlighter. It can highlight your code.
How to highlight your code: Paste your code in the comment form, select it and then click the language link button below. This will wrap your code in a <pre> tag and format it when submitted.