在系统启动时挂载 ltfs 驱动器 Mac OS X

在系统启动时挂载 ltfs 驱动器 Mac OS X

Mac OS X Server 10.6.8
LTO 5 驱动器:IBM System Storage TS2250 磁带驱动器
HBA:ATTO 的 ExpressSAS H680

我已将 HBA 和 LTO 安装在 Mac 中,并且能够格式化和安装磁带介质。我希望在系统启动时安装磁带介质。我创建了一个 LaunchAgent:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"  "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>Label</key>
    <string>com.pilotware.ltfs_mount</string>
    <key>ProgramArguments</key>
    <array>
            <string>/usr/local/bin/ltfs</string>
            <string>/mnt/ltfs</string>
            <string>-o</string>
            <string>devname=0</string>
    </array>
    <key>RunAtLoad</key>
    <true/>
</dict>
</plist>


但是,每当我重新启动机器时,磁带介质都不会安装,尽管系统日志显示它确实安装好了:

9/19/12 3:15:32 PM  com.pilotware.ltfs_mount[321]   LTFS9015W Setting the locale to 'en_US.UTF-8'. If this is wrong, please set the LANG environment variable before starting ltfs.
9/19/12 3:15:32 PM  com.pilotware.ltfs_mount[321]   LTFS14000I LTFS starting, LTFS version 1.2.5 (201202290), log level 2
9/19/12 3:15:32 PM  com.pilotware.ltfs_mount[321]   LTFS14058I LTFS Format Specification version 2.0.0
9/19/12 3:15:32 PM  com.pilotware.ltfs_mount[321]   LTFS14063I Sync type is "time", Sync time is 300 sec
9/19/12 3:15:32 PM  com.pilotware.ltfs_mount[321]   LTFS12158I Opening a device through iokit driver (0)
9/19/12 3:15:32 PM  com.pilotware.ltfs_mount[321]   LTFS12118I Drive identification is 'ULT3580-HH5     '
9/19/12 3:15:32 PM  com.pilotware.ltfs_mount[321]   LTFS12162I Vendor ID is IBM     
9/19/12 3:15:32 PM  com.pilotware.ltfs_mount[321]   LTFS12159I Firmware revision is BBNF
9/19/12 3:15:32 PM  com.pilotware.ltfs_mount[321]   LTFS12160I Drive serial is 1068062747
9/19/12 3:15:32 PM  com.pilotware.ltfs_mount[321]   LTFS17160I Maximum device block size is 1048576
9/19/12 3:15:32 PM  com.pilotware.ltfs_mount[321]   LTFS11005I Mounting the volume
9/19/12 3:15:32 PM  com.pilotware.ltfs_mount[321]   LTFS12015I Attempting to load the medium
9/19/12 3:15:52 PM  com.pilotware.ltfs_mount[321]   LTFS11031I Volume mounted successfully


如果我运行“mount”,则不会列出挂载。如果我手动运行命令 /usr/local/bin/ltfs /mnt/ltfs -o devname=0,磁带介质挂载,mount:
ltfs on /mnt/ltfs (osxfusefs, nodev, nosuid,synchronous, mounted by pw)

我尝试将命令封装到 bash 脚本中并让 LaunchAgent 执行脚本,但无济于事。我甚至添加了更多选项,/usr/local/bin/ltfs /mnt/ltfs -o devname=0 -o gid=20 -o uid=501 -o work_directory=/tmp/ltfs

我不确定它是 Mac OS X(我看到 /private/etc/security/audit_control 和 /etc/security/audit_class 在 launchd 执行时打开,但手动执行时没有打开),ltfs(1.2.5)还是 FUSE(IBM 使用 OSXFUSE 2.3.8)。
具有讽刺意味的是,如果我将 bash 命令放入 Automator 应用程序中并通过系统偏好设置将其作为用户登录项启动,则磁带介质就会挂载。LaunchAgent

的权限是正确的,我尝试过 LaunchDaemons 和 User LaunchAgents。我甚至编辑了 /etc/security/audit_control,删除了策略 argv 并删除了 naflags。

我不明白。任何帮助表示感谢。

答案1

必须补充:

<string>-f</string>

到 LaunchAgent 中的 ProgramArguments 数组,以便 FUSE 将操作置于前台并正确执行...

相关内容