OpenWrt Nas新玩法,软路由当Nas保姆级教程( 二 )


PS:我这里是分30G出来扩容opt系统跑跑Docker之类的 , 如果你不需要就直接分区一个整的数据分区 。

OpenWrt Nas新玩法,软路由当Nas保姆级教程

文章插图
 
分区格式选ext4 , 兼容性会好一点 。
OpenWrt Nas新玩法,软路由当Nas保姆级教程

文章插图
 
分区好了是立刻生效的 , 返回到diskman主菜单就可以看到刚刚做好的分区 。
docker扩容
OpenWrt Nas新玩法,软路由当Nas保姆级教程

文章插图
 
然后我们来到系统-挂载点 , 点击新增
OpenWrt Nas新玩法,软路由当Nas保姆级教程

文章插图
 
我这里选30G的分区挂载到/OPT , 用来玩docker
OpenWrt Nas新玩法,软路由当Nas保姆级教程

文章插图
 
另外一个分区随便挂载一个/SSD的目录 , 用来当下载缓存或者其他的 。然后保存应用 。
OpenWrt Nas新玩法,软路由当Nas保姆级教程

文章插图
 
来到docker就可以看到挂载成功了 。
网络共享
OpenWrt Nas新玩法,软路由当Nas保姆级教程

文章插图
 
然后来到系统-网络共享-点击编辑模板 , 填入以下模板代码
[global]
## 网络共享名称
netbIOS name = OpenWrt Nas
## 绑定到的网络接口
interfaces = br-lan
## 服务描述信息
server string = Samba on OpenWrt
unix charset = UTF-8
## 工作域
workgroup = WORKGROUP
 
## 加载相关功能模块(用来支持APF、弥补APF协议的一些缺陷以及一些功能扩展支持)
vfs objects = catia fruit streams_xattr
## 这个选项在某些环境下如果不指定目录权限不会被继承
fruit:nfs_aces = no
inherit permissions = yes
 
## This global parameter allows the Samba admin to limit what interfaces on a machine will serve SMB requests.
bind interfaces only = yes
 
## time for inactive connections to-be closed in minutes
deadtime = 30
 
## Log File
log level = 4
log file = /var/log/samba/samba.log
 
## disable core dumps
enable core files = no
 
## set security (auto, user, domain, ads)
security = user
 
## map unknow users to guest
map to guest = Bad User
 
## The old plaintext passdb backend. Some Samba features will not work if this passdb backend is used. (NOTE: enabled for size reasons)
## (tdbsam,smbpasswd,ldapsam)
passdb backend = smbpasswd
 
## LAN/WAN options (IPTOS_LOWDELAY TCP_NODELAY) WAN (IPTOS_THROUGHPUT)
socket options = IPTOS_LOWDELAY TCP_NODELAY
 
## disable loading of all printcap printers by default (iprint, cups, lpstat)
load printers = No
printcap name = /dev/null
 
## Enabling this parameter will disable Samba's support for the SPOOLSS set of MS-RPC's.
disable spoolss = yes
 
## This parameters controls how printer status information is interpreted on your system.
## (BSD, AIX, LPRNG, PLP, SYSV, HPUX, QNX, SOFTQ)
printing = bsd
 
## Allows the server name that is advertised through MDNS to be set to the hostname rather than the Samba NETBIOS name.
## This allows an administrator to make Samba registered MDNS records match the case of the hostname rather than being in all capitals.
## (netbios, mdns)
mdns name = mdns
 
## This is a list of files and directories that are neither visible nor accessible.
## Each entry in the list must be separated by a '/', which allows spaces to be included in the entry. '*' and '?' can be used to specify multiple files or directories as in DOS wildcards.
veto files = /Thumbs.db/.DS_Store/._.DS_Store/.apdisk/
 
## If a directory that is to be deleted contains nothing but veto files this deletion will fail unless you also set the delete veto files parameter to yes.
delete veto files = yes
 
################################################################
 
[SSD]
## 需要共享的目录所在路径 (我这里是单独一块硬盘的文件夹)
path = /mnt/sda3
 
## 设置谁可以访问这个目录 , 默认配置下这个用户名来自于 /etc/samba/smbpasswd 文件.
## 使用 @前缀表示哪个用户组可以访问, 多个用户或分组使用逗号(,)间隔.
valid users = timemachine,@root
 


推荐阅读