我遇到了一个问题,每当重新启动库、安装卡式驱动器或执行任何操作时,Linux 都会更改库的路径,从而无法自动执行备份处理,当我在库上有两个驱动器时,情况会更糟,因为系统会将 xxx0 更改为 xxx1 并反向更改,当 fc 拔出时,系统会重新启动或 w/e
我想知道如何在 udev 上进行持久配置,以便每次根据其序列号将相同的路径分配给相同的磁带设备,例如,因为它绝不变化,因此 SN 1234 每次都会是 xxx0,5678 会是 xxx1,等等。即使系统重新启动...
我使用基于Debian发行版,所以 Debian 上运行的所有内容都可以在我的发行版上运行......
希望你能帮助我,谢谢。
这是我的信息...
root@wbsairback:~# cat /proc/scsi/scsi
Attached devices:
Host: scsi1 Channel: 00 Id: 00 Lun: 00
Vendor: IBM Model: ULT3580-HH5 Rev: D2AD
Type: Sequential-Access ANSI SCSI revision: 06
Host: scsi1 Channel: 00 Id: 00 Lun: 01
Vendor: IBM Model: 3573-TL Rev: C.00
Type: Medium Changer ANSI SCSI revision: 05
它安装在
root@wbsairback:/etc/udev/rules.d# ls -l /dev/tape/by-id
total 0
lrwxrwxrwx 1 root root 9 ago 26 08:25 sch-IBM-3573-TL-00X2U78Z7696_LL0 -> ../../sg4
lrwxrwxrwx 1 root root 11 ago 26 08:25 st--- -> ../../nst0m
lrwxrwxrwx 1 root root 10 ago 26 08:25 st-IBM-ULT3580-HH5-5000e11159a60001 -> ../../nst0
这是我的udev配置
ACTION!="add|change", GOTO="persistent_storage_tape_end"
# "Medium Changers"
KERNEL=="sg[0-9]*", \
SUBSYSTEMS=="scsi", ATTRS{type}=="8", \
IMPORT{program}="/lib/udev/scsi_id --export --sg-version=3 --whitelisted --device=$tempnode"
KERNEL=="sg[0-9]*", SUBSYSTEMS=="scsi", ATTRS{type}=="8", IMPORT{program}="scsi_id --sg-version=3 --page=0x80 --export --whitelisted --device=$tempnode", SYMLINK+="tape/by-id/sch-$env{ID_VENDOR}-$env{ID_MODEL}-$env{ID_SERIAL_SHORT}"
SUBSYSTEM!="scsi_tape", GOTO="persistent_storage_tape_end"
KERNEL=="st*[0-9]|nst*[0-9]", ATTRS{ieee1394_id}=="?*", \
ENV{ID_BUS}="ieee1394", ENV{ID_SERIAL}="$attr{ieee1394_id}"
KERNEL=="st*[0-9]|nst*[0-9]", ENV{ID_SERIAL}!="?*", \
SUBSYSTEMS=="usb", \
IMPORT{program}="usb_id --export $devpath"
KERNEL=="st*[0-9]|nst*[0-9]", ENV{ID_SERIAL}!="?*", \
SUBSYSTEMS=="scsi", KERNELS=="[0-9]*:*[0-9]", \
ENV{BSG_DEV}="$root/bsg/$id"
KERNEL=="st*[0-9]|nst*[0-9]", ENV{ID_SERIAL}!="?*", \
WAIT_FOR="$env{BSG_DEV}", \
ENV{ID_BUS}="scsi", \
IMPORT{program}="scsi_id --export --device=$env{BSG_DEV}"
KERNEL=="st*[0-9]", ENV{ID_SERIAL}=="?*", \
SYMLINK+="tape/by-id/$env{ID_BUS}-$env{ID_SERIAL}"
KERNEL=="nst*[0-9]", ENV{ID_SERIAL}=="?*", \
SYMLINK+="tape/by-id/$env{ID_BUS}-$env{ID_SERIAL}-nst"
KERNEL=="nst[0-9]*", SUBSYSTEM=="scsi_tape", IMPORT{program}="scsi_id -u -g -x -d $tempnode", SYMLINK+="tape/by-id/st-$env{ID_VENDOR}-$env{ID_MODEL}-$env{ID_SERIAL_SHORT}"
KERNEL=="st*[0-9]|nst*[0-9]", \
IMPORT{program}="path_id $devpath"
KERNEL=="st*[0-9]", ENV{ID_PATH}=="?*", \
SYMLINK+="tape/by-path/$env{ID_PATH}"
KERNEL=="nst*[0-9]", ENV{ID_PATH}=="?*", \
SYMLINK+="tape/by-path/$env{ID_PATH}-nst"
# end of processing
LABEL="persistent_storage_tape_end"