使用飞牛 OS 当 TrueNAS 的前端
Linux NAS飞牛 OS 很好用,但飞牛 OS 很好用不太可能。
TrueNAS 只是一个很纯粹的 NAS 系统,没有网页浏览图片的功能。macOS 对于网络目录的支持很差,在大量文件的 SMB 目录里会卡死。所以使用其他的轻量 NAS 系统挂载 TrueNAS 的分享是一个简单的解决方案。
飞牛 OS 0.8.36 还并不支持把 SMB 目录像本地目录一样看待,所以需要手动修改配置文件。
TL;DR
这个文件
nano /etc/systemd/system/mount-cifs.service
内容这样
[Unit]
Description=Mount CIFS shares after local disks and network are up
After=local-fs.target network-online.target trim_main.service
Wants=local-fs.target network-online.target trim_main.service
[Service]
Type=oneshot
ExecStart=/usr/local/bin/mount-cifs.sh
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
那个文件
nano /usr/local/bin/mount-cifs.sh
内容这样,很普通的 mount 命令格式。
#!/bin/bash
# 记录日志
mount -t cifs //10.8.2.10/landis /vol1/1000/landis -o username=sen,password=yourpassword,nofail,uid=1000,gid=1001
mount -t cifs //10.8.2.10/archive /vol1/1000/archive -o username=sen,password=yourpassword,nofail,uid=1000,gid=1001
mount -t cifs //10.8.2.10/backup /vol1/1000/backup -o username=sen,password=yourpassword,nofail,uid=1000,gid=1001
打开服务
sudo systemctl enable mount-cifs.service
sudo systemctl start mount-cifs.service
题外话
截止到 0.8.36 版本,飞牛 OS 的远程访问还未支持两步验证,可能会有爆破风险,需要注意安全。
macOS 和 iOS 的 SMB 支持太烂了,一个 SMB 目录里有 4000 张小图片会使文件浏览器加载很久。
飞牛 OS 手动挂载的 SMB 目录不支持回收站功能。