Question & Answer
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 Spectrum Protect 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 :
Depending on the Linux kernel, the udevinfo may not be available. In this case, use udevadm. For example :
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 :
For example, using the udevadm output from step 1 :
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: Reload udev:
/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: Reload udev:
udevadm control --reload-rules
4: . Verify the persistent names are created as expected.
Use the "ls -al" command to list the device names. For example :
5. Define the drive and the drive path using the device persistent name. For example :
4: . 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
5. 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
[{"Product":{"code":"SSGSG7","label":"Tivoli Storage Manager"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Component":"Server","Platform":[{"code":"PF016","label":"Linux"}],"Version":"All Supported Versions","Edition":"","Line of Business":{"code":"LOB26","label":"Storage"}}]
Was this topic helpful?
Document Information
Modified date:
30 May 2019
UID
swg21459487