|
原生纯净版下载地址http://downloads.openwrt.org/chaos_calmer/15.05.1/
先设置路由能上网
登录putty终端
粘贴下面命令
opkg update
opkg install kmod-usb-core
opkg install kmod-usb2 #安装usb2.0
opkg install kmod-usb-ohci #安装usb ohci控制器驱动
opkg install kmod-usb-storage #安装usb存储设备驱动
opkg install kmod-fs-vfat #挂载FAT
opkg install ntfs-3g #挂载NTFS
opkg install mount-utils #挂载卸载工具
opkg install block-mount
opkg install fdisk #磁盘工具
opkg install kmod-nls-cp437 kmod-nls-iso8859-1 #语言支持包
opkg install luci-app-samba #SAMBA网络共享服务
/etc/init.d/samba enable #启用并开始SAMBA共享
/etc/init.d/samba restart
重启路由后键入命令
mkdir -p /mnt/sta1
mount -t ntfs-3g /dev/sda1 /mnt/sta1 #挂载
可以在页面看到已经加载成功,可以看到硬盘了
进入共享
设置Samba共享
至此,已经可以通过网络访问移动硬盘了。
下面添加开机自动挂载
用WinSCP连接路由器,打开/etc/hotplug.d/block/10-mount文件(如果不存在请新建)
添加如下内容
#!/bin/sh
# Copyright (C) 2009 OpenWrt.org (C) 2010 OpenWrt.org.cn
blkdev=`dirname $DEVPATH`
if [ `basename $blkdev` != "block" ]; then
device=`basename $DEVPATH`
case "$ACTION" in
add)
mkdir -p /mnt/$device
# vfat & ntfs-3g check
if [ `which fdisk` ]; then
isntfs=`fdisk -l | grep $device | grep NTFS`
isvfat=`fdisk -l | grep $device | grep FAT`
isfuse=`lsmod | grep fuse`
isntfs3g=`which ntfs-3g`
else
isntfs=""
isvfat=""
fi
# mount with ntfs-3g if possible, else with default mount
if [ "$isntfs" -a "$isfuse" -a "$isntfs3g" ]; then
ntfs-3g -o nls=utf8 /dev/$device /mnt/$device
elif [ "$isvfat" ]; then
mount -t vfat -o iocharset=utf8,rw,sync,umask=0000,dmask=0000,fmask=0000 /dev/$device /mnt/$device
else
mount /dev/$device /mnt/$device
fi
if [ -f /dev/${device}/swapfile ]; then
mkswap /dev/${device}/swapfile
swapon /dev/${device}/swapfile
fi
;;
remove)
if [ -f /dev/${device}/swapfile ]; then
swapoff /dev/${device}/swapfile
fi
umount /dev/$device
;;
esac
fi
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?立即注册
×
|