Bacula配置后lsscsi无法识别Dell TL4000光纤磁带库changer
Troubleshooting Disappearing Mediumx (Dell TL4000 Changer) After Exiting Bacula bconsole
Let’s walk through the most likely causes and actionable fixes for this issue:
1. Check for Stale Bacula Processes Holding the Changer Device
When you exit bconsole, it’s possible the Bacula Storage Daemon (bacula-sd) hasn’t properly released the mediumx device handle. Here’s how to verify and fix this:
- Run
lsof /dev/mediumxorfuser /dev/mediumxto see if any processes are still attached to the changer device. - If you spot Bacula-related processes, stop the storage daemon gracefully first:
If the process won’t stop, usesystemctl stop bacula-sd # For systemd-based systems # Or service bacula-sd stop for init.d systemskill <PID>to terminate the stuck process directly. - After stopping the process, re-run
lsscsito check if the mediumx device reappears.
2. Verify Device Permissions and Group Ownership
Bacula runs under a dedicated bacula user, and incorrect permissions on the mediumx device can make it "invisible" after Bacula accesses it:
- Check current permissions with:
The device should ideally be owned by thels -l /dev/mediumxbaculauser/group (ortapegroup) with permissions likecrw-rw----. - If permissions are wrong, create a udev rule to set ownership automatically:
- Create a file like
/etc/udev/rules.d/99-bacula-tape.ruleswith:SUBSYSTEM=="scsi_generic", ATTRS{model}=="TL4000", OWNER="bacula", GROUP="bacula", MODE="0660" - Reload udev rules and trigger a rescan:
udevadm control --reload-rules udevadm trigger
- Create a file like
3. Validate Bacula Storage Daemon Configuration
Misconfigurations in bacula-sd.conf can lead to improper device handling:
- Open your
bacula-sd.confand check the autochanger definition:
EnsureAutochanger { Name = TL4000-Changer Device = Drive-0, Drive-1 ChangerDevice = /dev/mediumx ChangerCommand = "/usr/sbin/mtx-changer %c %o %S %a %d" AutoChanger = yes }ChangerDevicepoints to the correct/dev/mediumxpath, andAutoChangeris set toyes. - Restart the storage daemon after making changes:
Then test again by entering/exitingsystemctl restart bacula-sdbconsoleand runninglsscsi.
4. Unlock the SCSI Changer Device
Some SCSI devices get locked by processes, preventing them from being listed by lsscsi. Use the sg3_utils toolset to unlock it:
- Install
sg3_utilsif missing:apt install sg3_utils # Debian/Ubuntu yum install sg3_utils # RHEL/CentOS - Run the unlock command:
Re-runsg_unlock /dev/mediumxlsscsito check if the device reappears.
5. Check System Logs for SCSI Errors
System logs may reveal why the device is disappearing:
- Check
dmesgfor SCSI-related issues:
Look for errors like "device disconnected" or "I/O error".dmesg | grep -i scsi dmesg | grep mediumx - Also check
/var/log/messagesor/var/log/syslogfor Bacula-specific errors that might point to communication issues with the changer.
内容的提问来源于stack exchange,提问作者Brosig
相关产品推荐
相关产品推荐

