|
我刷m大的 OpenWrt 1.6版,默认情况下也不行连盘都找版到,后来通过以下方法搞定了,u盘可读可写,电脑里面共享的设备是sda4(证明u盘硬改是成功的)。
现在的问题是,我不喜欢OpenWrt系统,所以最终还是希望官改里能搞定。
我在OpenWrt里装了个e2fsprogs 想对U盘格式化。
输入:mkfs.ext3 /dev/sda4
可是总是提示:/dev/sda4 is mounted; will not make a filesystem here!
umount -v /dev/sda4后也不行
话说如何才能格式化成fat32
在OpenWrt 1.6里成功的方法如下:
1用putty连接路由器,用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-ext3 #安装ext3分区格式支持组件
opkg install kmod-fs-vfat #挂载FAT
opkg install ntfs-3g #挂载NTFS
opkg install mount-utils #挂载卸载工具
opkg install block-mount
opkg install luci-app-samba #SAMBA网络共享服务
/etc/init.d/samba enable #启用并开始SAMBA共享
/etc/init.d/samba restart
注意 在线安装软件包需保证路由器Wan口可以连接Internet
2用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
重启路由器就成功了 |
|