• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

The Geek Diary

CONCEPTS | BASICS | HOWTO

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • Linux Services
    • VCS
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
    • Data Guard
  • DevOps
    • Docker
    • Shell Scripting
  • Interview Questions
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

How to Configure Persistent Names for Tape Devices in CentOS/RHEL

By admin

On Linux, the device name may get change after reboot. This post illustrates how to configure persistent name binding for the tape device. There are 2 types of tape devices on Linux i.e. /dev/st* and /dev/nst*

/dev/stX and /dev/nstX are pointed to a same tape device, the difference is that /dev/stX is a rewinding device while /dev/nstX is non-rewinding device. When you perform operations to rewinding devices, /dev/stX will rewind to beginning of tape, and /dev/nstX would not.

Tape Device Persistent Naming Configuration

Assume that /dev/nst0 is the device need persistent naming.

Note: The following procedure does not require a reboot.

1. Get the ID_SERIAL from the tape device:

# udevadm test /class/scsi_tape/nst0
...
udevadm_test: ID_SERIAL=3500104f000c8bfa2
udevadm_test: ID_SERIAL_SHORT=500104f000c8bfa2
udevadm_test: ID_WWN=0x500104f000c8bfa2
udevadm_test: ID_WWN_WITH_EXTENSION=0x500104f000c8bfa2
udevadm_test: ID_SCSI_SERIAL=HU1143K8BF
udevadm_test: ID_BUS=scsi
udevadm_test: ID_PATH=pci-0000:06:00.0-fc-0x500104f000c8bfa3-lun-0
udevadm_test: run: 'socket:@/org/freedesktop/hal/udev_event'

You may also try the below command which will report a same ID_SERIAL:

# udevadm test /class/scsi_tape/st0

2. Create a new udev rule file /etc/udev/rules.d/70-persistent-tape.rules. The udev load rules by the the numeric order in filename, start sequence ID 70 was chosen here, because it is greater than 60 of the default storage rule /lib/udev/rules.d/60-persistent-storage-tape.rules, hence this customized udev rule runs afterwards. Add the following lines to the file:

# vi /etc/udev/rules.d/70-persistent-tape.rules
KERNEL=="st*", ENV{ID_SERIAL}=="3500104f000c8bfa2",SYMLINK+="st/tape0" 
KERNEL=="nst*", ENV{ID_SERIAL}=="3500104f000c8bfa2", SYMLINK+="nst/tape0"

Where,
3500104f000c8bfa2 is taken from step 1, the ID_SERIAL field.

3. Test the configuration.

# udevadm test /class/scsi_tape/nst0

If everything is fine, you should be able to see /dev/tape/tape0, and use it as a reference to the tape device.

4. Execute the following commands & apply the changes without rebooting the server:

# udevadm control –reload-rules
# udevadm trigger

Filed Under: CentOS/RHEL 6, CentOS/RHEL 7, Linux

Some more articles you might also be interested in …

  1. How to Transfer files securely using SCP Command in Linux
  2. How To Create Virtual Data Optimizer(VD0) in CentOS/RHEL 7 and 8
  3. mdadm: Cannot open /dev/sda1: Device or resource busy
  4. CentOS / RHEL : How to Change the login shell of the user
  5. What’s the difference between locate and find command in Linux
  6. CentOS / RHEL 7 : How to enable telnet for a group of users
  7. How to backup Linux OS using “dd” Command
  8. Using vmstat to troubleshoot performance issues in Linux
  9. CentOS / RHEL 7 : Shutting Down, Suspending, or Rebooting Commands (systemctl)
  10. How to Change the filesystem Labels in CentOS/RHEL

You May Also Like

Primary Sidebar

Recent Posts

  • Oracle Database – Configuring Secure Application Roles
  • Extend rule sets by using factors in Oracle Database Vault
  • What are Command Rules in oracle Database
  • Using Rule Sets in Oracle Database Vault
  • Archives
  • Contact Us
  • Copyright

© 2021 · The Geek Diary