Setting persistent device names for tape devices in RHEL

Solution Verified - Updated

Environment

  • Red Hat Enterprise Linux

Issue

  • We got a tape library which keeps changing name, what are the steps to set persistent names for tape devices in RHEL?
  • We need to make tape devices /dev/nst* persistent for backup service. How do we configure it?

Resolution

To assign persistent name of tape devices, add a rule similar to below:

1. Go to /etc/udev/rules.d/:

# cd /etc/udev/rules.d/

2. Create new rules config file:

# vi 99-tape.rules

3. Add following rule:

ACTION=="add|change", ENV{ID_SERIAL}=="<ID_SERIAL>", SYMLINK+="my_tape_01"

4. Reload the udev configuration for changes to take effect.

This will assign name: /dev/my_tape_01 for this tape device which would be persistent across reboot. It will a symlink created for tape devices and the actual device would be intact.

Diagnostic Steps

  • We can set up persistent device naming using udev rules in RHEL 7 the same as RHEL 6.

  • Run the following command against the tape device to get details about the device:

      # udevadm info --query=all --name=/dev/<Tape_Device>
    

    For example:

      # udevadm info --query=all --name /dev/st0
      P: /devices/pci0000:00/0000:00:07.0/0000:0e:00.0/host8/rport-8:0-2/target8:0:0/8:0:0:5/scsi_tape/st0
      N: st0
      :
      E: ID_SERIAL=350223344ab000500
      :
    
SBR
Components

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.