Tape naming scheme
The tape device driver assigns minor numbers along with an index number when a physical tape device comes online.
Device | Names | Minor numbers |
---|---|---|
Non-rewinding character devices | ntibm<n> | 2×<n> |
Rewinding character devices | rtibm<n> | 2×<n>+1 |
The index number and corresponding minor numbers and device names are not permanently associated with a specific physical tape device. When a tape device goes offline, it surrenders its index number. The device driver assigns the lowest free index number when a physical tape device comes online. An index number with its corresponding device names and minor numbers can be reassigned to different physical tape devices as devices go offline and come online.
When the tape device driver is loaded, it dynamically allocates a major number to channel-attached character tape devices. A different major number might be used when the device driver is reloaded, for example when Linux® is rebooted.
- /sys/class/tape390/ntibm<n>
- /sys/class/tape390/rtibm<n>
Each of these directories has a dev attribute. The value of the dev attribute has the form <major>:<minor>, where <major> is the major number for the device and <minor> is the minor number specific to the logical device.
Example
In this example, four physical tape devices are present, with three of them online. The TapeNo column shows the index number and the BusID column indicates the associated physical tape device. In the example, no index number is allocated to the tape device in the last row. The device is offline and, currently, no names and minor numbers are assigned to it.
# lstape --ccw-only
TapeNo BusID CuType/Model DevType/DevMod BlkSize State Op MedState
0 0.0.01a1 3490/10 3490/40 auto UNUSED --- UNLOADED
1 0.0.01a0 3480/01 3480/04 auto UNUSED --- UNLOADED
2 0.0.0172 3590/50 3590/11 auto IN_USE --- LOADED
N/A 0.0.01ac 3490/10 3490/40 N/A OFFLINE --- N/A
Bus ID | Index (TapeNo) | Device | Device name | Minor number |
---|---|---|---|---|
0.0.01a1 | 0 | non-rewind | ntibm0 | 0 |
rewind | rtibm0 | 1 | ||
0.0.01a0 | 1 | non-rewind | ntibm1 | 2 |
rewind | rtibm1 | 3 | ||
0.0.0172 | 2 | non-rewind | ntibm2 | 4 |
rewind | rtibm2 | 5 | ||
0.0.01ac | not assigned | n/a | n/a | not assigned |
# cat /sys/class/tape390/ntibm0/dev
254:0
# cat /sys/class/tape390/rtibm0/dev
254:1
# cat /sys/class/tape390/ntibm1/dev
254:2
# cat /sys/class/tape390/rtibm1/dev
254:3
# cat /sys/class/tape390/ntibm2/dev
254:4
# cat /sys/class/tape390/rtibm2/dev
254:5
In the example, the major number is 254. The minor numbers
are as expected for the respective device names.