文档详情

openwrt如何挂载usb硬盘.doc

发布:2017-01-30约字共5页下载文档
文本预览下载声明
1、设置源并更新 opkg update 2、安装USB驱动,这里是BCM4712芯片的,其他芯片自己查 opkg install kmod-usb-ohci opkg install kmod-usb-storage 3、安装EXT3文件系统 opkg install kmod-fs-ext3 4、安装文件系统格式化及检查工具 opkg install e2fsprogs 5、插上USB硬盘,如果正确识别输入dmesg命令就可以查看到U盘信息,如/dev/scsi/host0/bus0/target0/lun0: p1等等 6、格式化USB硬盘,这里的part1代表第一分区 mke2fs -j /dev/scsi/host0/bus0/target0/lun0/part1 7、挂载USB硬盘 mount -t ext3 /dev/scsi/host0/bus0/target0/lun0/part1 /mnt 8、df一下应该就可以看到挂载的USB硬盘了 下面写一个启动脚本,让路由器在启动时自动挂载USB硬盘。 vim /etc/init.d/usbdisk 写入脚本: #!/bin/sh /etc/mon START=99 STOP=10 start() { mount-text3-onoatime/dev/scsi/host0/bus0/target0/lun0/part1/mnt } stop() { sync umount/dev/scsi/host0/bus0/target0/lun0/part1 } restart() { stop start } 加入可执行权限 chmod 755 /etc/init.d/usbdisk 加入到启动目录 ln -s /etc/init.d/usbdisk /etc/rc.d/S99usbdisk 恩,完事了 ----以下是方法2----------------------------------------------------------------------------- openwrt 自动挂载U盘、移动硬盘 2011年01月07日 星期五 21:35 openwrt 自动挂载U盘、移动硬盘 opkg update opkg install kmod-usb-core opkg install kmod-usb-ohci #安装usb ohci控制器驱动 #opkg install kmod-usb-uhci  #UHCI USB控制器 opkg install kmod-usb2 #安装usb2.0 opkg install kmod-usb-storage #安装usb存储设备驱动 opkg install kmod-fs-ext3 #安装ext3分区格式支持组件 opkg install mount-utils #挂载卸载工具 opkg install ntfs-3g #挂载NTFS opkg install kmod-fs-vfat #挂载FAT opkg install block-mount opkg install fdisk opkg install usbutils #安装了这个后可以用 lsusb #U盘,移动硬盘自动挂载脚本 编辑/etc/hotplug.d/block/10-mount (用winscp工具连接路由,编辑文件) ___________________________以下是文件内容_________________________________ #!/bin/sh # Copyright (C) 2009 OpenW (C) 2010 OpenW 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` ];
显示全部
相似文档