lin_tape device persistent naming

Technote (FAQ)


Question

This technote provides a example on how to create persistent naming devices with the lin_tape driver.

Cause

Linux uses udev to manage the persistent naming. This technote provides details on how to write the udev rule file for the lin_tape device driver and how to implement it with the Tivoli Storage Manager server.

Answer

Persistent naming on Linux is controlled by Linux "udev". After a successful lin_tape install, a lin_tape udev rule file will be created at the following location :

/etc/udev/rules.d/98-lin_tape.rules.

This rule file needs to be edited to create the lin_tape persistent names. The following steps may be used.

1. Find out the device serial or WWN attribute of the tape drive.

Run the udevinfo command for each lin_tape or /dev/IBMtapex device.

For example, using /dev.IBMtape1 :

#udevinfo -a -p 'udevinfo -q path -n /dev/IBMtape1'
...
  looking at parent device '/devices/pci0000:00/0000:00:09.0/0000:09:00.0/host2/rport-2:0-2/target2:0:0/2:0:0:1':
    ID=="2:0:0:1"
    BUS=="scsi"
    DRIVER=="lin_tape"
    SYSFS{primary_path}=="NA"
    SYSFS{ww_port_name}==""
    SYSFS{ww_node_name}=="0x20020000C9D93932"
    SYSFS{serial_num}=="111411000"
...

Depending on the Linux kernel, the udevinfo may not be available. In this case, use udevadm. For example :

udevadm info --attribute-walk --name /dev/IBMtape1
...
ATTR{serial_num}=="1114110004"
ATTR{ww_node_name}=="0x20020000C9D93932"
ATTR{ww_port_name}=="0x10000000C9D93932"
ATTR{primary_path}=="NA"
ATTR{sys_encryption_proxy}=="1"
ATTR{sys_encryption_write}=="2"


2. Create the /etc/udev/rules.d/98-lin_tape.rules file based on the output from step 1.
There should be one line for each device.

For example, using the udevinfo output from step 1 :

KERNEL=="IBMtape*[!n]", SYSFS{serial_num}=="111411000",SYMLINK="lin_tape/by-id/lin_tape1_111411000"


For example, using the udevadm output from step 1 :

KERNEL=="IBMtape*[!n]", ATTR{serial_num}=="1114110004",SYMLINK="lin_tape/by-id/lin_tape1_111411000"

Note :
The device name in the SYMLINK parameter can be changed. In this example, the serial number was appended to the device name, e.g., lin_tape1_111411000, to allow the Linux administrator to see the serial number as part of the device name. This is not necessary as it can be any name.

3. Unload lin_tape.
Before doing this, make sure the application (for example, the Tivoli Storage Manager server), is stopped to prevent the use of tape devices. Once this is done, run the modprobe command to unload the lin_tape driver. For example

modprobe -r lin_tape


4. Reload lin_tape.
Run the modprobe command to load the lin_tape driver. For example

modprobe lin_tape


5. Verify the persistent names are created as expected.
Use the "ls -al" command to list the device names. For example :

ls -al /dev/lin_tape/by-id
...
lrwxrwxrwx 1 root root 14 Feb 21 15:30 lin_tape1_111411 -> ../../IBMtape1
lrwxrwxrwx 1 root root 14 Feb 21 15:30 lin_tape0_100012 -> ../../IBMtape0


6. Define the drive and the drive path using the device persistent name. For example :

DEFINE DRIVE LIBRARY_Name DRIVE1 SERial=AUTOD element=AUTOD Online=YES
DEFINE PATH SERVER_NAME DRIVE1 SRCT=server DESt=drive LIBRARY=LIBRARY_Name device=/dev/lin_tape/by-id/lin_tape1_111411 online=yes

Rate this page:

(0 users)Average rating

Add comments

Document information


More support for:

Tivoli Storage Manager
Server

Software version:

All Supported Versions

Operating system(s):

Linux

Reference #:

1459487

Modified date:

2011-02-11

Translate my page

Machine Translation

Content navigation