Ubuntu 挂载蓝牙设备的实用技巧
一、先弄清设备类型与正确方式
二、文件传输类设备的挂载流程(OBEX/FTP)
bluetoothctlscan onpair <MAC>trust <MAC>connect <MAC>(若提示失败,可改用 Blueman 发起连接)。obexfs(FUSE 文件系统,将手机“文件”目录映射为本地目录)。sudo apt install obexfsmkdir -p ~/bluetooth-phoneobexfs -b <MAC> -B FTP ~/bluetooth-phone(部分设备用 -B OBEX 或 -B MFE 等,按设备支持情况尝试)fusermount -u ~/bluetooth-phonebluetoothctl 成功 connect。sudo 运行(FUSE 更安全的方式是配置用户组权限)。sudo systemctl restart bluetooth,必要时删除设备后重配对。rfcomm 绑定串口后再传输,但这已不常见,优先使用 OBEX。三、音频与输入类设备的连接要点(不走挂载)
sudo apt install bluez blueman pulseaudio-module-bluetoothsudo systemctl start bluetooth && sudo systemctl enable bluetoothpactl load-module module-bluetooth-discover(部分系统会自动加载)。pulseaudio-module-bluetooth 支持,Blueman 可更方便地建立 HFP 连接;在声音设置中选择“Headset”作为输入/输出。四、图形化工具与命令行组合建议
sudo apt install blueman。obexfs 挂载到本地目录。bluetoothctl 连接 A2DP/HFP → PulseAudio 选择输出/输入设备。五、故障排查清单
hciconfig(应看到 hci0 且状态为 UP);若未启动:sudo hciconfig hci0 up。lsusb;重启蓝牙服务:sudo systemctl restart bluetooth。bluetoothctl 的 devices、paired-devices、info <MAC> 检查状态;必要时 remove <MAC> 后重配对。obexftp -b <MAC> -l 测试能否列目录;若失败,换 -B FTP/OBEX/MFE 再试。journalctl -u bluetooth -b,根据报错信息调整步骤。