How to check if tape drives are detected in the system?

Solution Verified - Updated

Environment

  • Red Hat Enterprise Linux (RHEL)
    • tape drives

Issue

  • How to check if tape drives are detected in the system?

Resolution

  • Check to see if the expected tape drives are present in the kernel configuration

    • If the tape drive is detected, you should see something like the following in the /var/log/dmesg file from sosreport or in dmesg command

      st: Version 20070203, fixed bufsize 32768, s/g segs 256
      st 3:0:9:0: Attached scsi tape st0
      st0: try direct i/o: yes (alignment 512 B)
      
    • In /proc/scsi/scsi file, you should see similar to

      Host: scsi3 Channel: 00 Id: 09 Lun: 00
      Vendor: HP       Model: C5713A           Rev: H304
      Type:   Sequential-Access                ANSI SCSI revision: 03
      
  • If one or more tape drives are not present as expected, rescan the scsi host bus adpaters:

    • as root: find /sys/class/scsi_host -maxdepth 1 -name "host*" -exec sh -c 'echo "- - -" > {}/scan' \; , or
    • if package sg3_utils is installed use rescan-scsi-bus.sh
    • recheck /proc/scsi/scsi or `lsscsi' output to verify the expected tape drives are now present
    • if after rescan of the scsi bus, the expected tape drives are still not present, raise a Red Hat support case
  • Once the tape drives are detected check the status by running the following command

    #mt -f /dev/st0 status
    

Note : st module should be present to detect the tape devices.

[root@host1 ~]# modinfo st
filename:       /lib/modules/2.6.32-431.el6.x86_64/kernel/drivers/scsi/st.ko
alias:          scsi:t-0x01*
alias:          char-major-9-*
license:        GPL
description:    SCSI tape (st) driver
author:         Kai Makisara
srcversion:     90119E15C8FC0B44A345478
depends:        
vermagic:       2.6.32-431.el6.x86_64 SMP mod_unload modversions 
parm:           buffer_kbs:Default driver buffer size for fixed block mode (KB; 32) (int)
parm:           max_sg_segs:Maximum number of scatter/gather segments to use (256) (int)
parm:           try_direct_io:Try direct I/O between user buffer and tape drive (1) (int)
parm:           try_rdio:Try direct read i/o when possible (int)
parm:           try_wdio:Try direct write i/o when possible (int)
[root@host1 ~]# lsmod |grep st
xt_state                1492  2 
nf_conntrack           79758  2 nf_conntrack_ipv6,xt_state
[root@host1 ~]# modprobe st
[root@host1 ~]# lsmod |grep st
st                     38398  0 
xt_state                1492  2 
nf_conntrack           79758  2 nf_conntrack_ipv6,xt_state
SBR
Components
Category

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.