OpenWrt学习笔记3 -- U盘自动挂载
2017-02-12 00:00
543 查看
OpenWrt提供了一个mountd机制,用于自动挂载usb存储设备。
运行
选择以下配置为y(即*):
Kernel Modules ---> USB Support --->kmod-usb-storages-extras
Kernel Modules ---> Filesystems --->kmod-fs-ntfs 和 kmod-fs-vfat
Kernel Modules ---> Native Language Support ---> kmod-nls-cp437和kmod-nls-iso8859-1
Utilities ---> mountd
退出,保存到.config,编译,烧录。
补充说明:nls如果不设置的话,挂载U盘的时候会报错:
烧录完毕后,每次开机、插上U盘就会自动挂载到/tmp/run/mountd目录下。
用mount命令查看:
可以看到最后一行就是mountd帮我们自动挂载上去的U盘了。
如果需要用到ntfs格式的U盘/移动硬盘的话,需要安装ntfs-3g,方法如下:
下载好后,在menuconfig => Utilities => Filesystem,选上ntfs-3g
运行
make menuconfig
选择以下配置为y(即*):
Kernel Modules ---> USB Support --->kmod-usb-storages-extras
Kernel Modules ---> Filesystems --->kmod-fs-ntfs 和 kmod-fs-vfat
Kernel Modules ---> Native Language Support ---> kmod-nls-cp437和kmod-nls-iso8859-1
Utilities ---> mountd
退出,保存到.config,编译,烧录。
补充说明:nls如果不设置的话,挂载U盘的时候会报错:
root@OpenWrt:/tmp# dmesg | tail -n 5 [ 23.000000] br-lan: port 1(eth0.1) entered forwarding state [ 23.000000] br-lan: port 1(eth0.1) entered forwarding state [ 25.000000] br-lan: port 1(eth0.1) entered forwarding state [ 66.940000] random: nonblocking pool is initialized [ 89.650000] FAT-fs (sda1): codepage cp437 not found
烧录完毕后,每次开机、插上U盘就会自动挂载到/tmp/run/mountd目录下。
用mount命令查看:
root@OpenWrt:/tmp/run/mountd/sda1# mount rootfs on / type rootfs (rw) /dev/root on /rom type squashfs (ro,relatime) proc on /proc type proc (rw,nosuid,nodev,noexec,noatime) sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,noatime) tmpfs on /tmp type tmpfs (rw,nosuid,nodev,noatime) tmpfs on /tmp/root type tmpfs (rw,noatime,mode=755) tmpfs on /dev type tmpfs (rw,nosuid,relatime,size=512k,mode=755) devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,mode=600) debugfs on /sys/kernel/debug type debugfs (rw,noatime) mountd(pid1040) on /tmp/run/mountd type autofs (rw,relatime,fd=5,pgrp=1039,timeout=60,minproto=5,maxproto=5,indirect) /dev/mtdblock6 on /overlay type jffs2 (rw,noatime) overlayfs:/overlay on / type overlay (rw,noatime,lowerdir=/,upperdir=/overlay/upper,workdir=/overlay/work) /dev/sda1 on /tmp/run/mountd/sda1 type vfat (rw,relatime,uid=1000,gid=1000,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)
可以看到最后一行就是mountd帮我们自动挂载上去的U盘了。
如果需要用到ntfs格式的U盘/移动硬盘的话,需要安装ntfs-3g,方法如下:
scripts/feeds update packages scripts/feeds install ntfs-3g
下载好后,在menuconfig => Utilities => Filesystem,选上ntfs-3g
相关文章推荐
- hotplug_uevent机制_修改mdev配置支持U盘自动挂载学习笔记
- hotplug_uevent机制_修改mdev配置支持U盘自动挂载学习笔记
- OpenWrt(7)------ 自学笔记挂载U盘
- U盘自动挂载配置 笔记
- openwrt自动挂载U盘【信息过时】
- openwrt下10-mount自动挂载u盘脚本
- LINXU 学习笔记---虚拟机下挂载U盘(linux)
- [Openwrt 项目开发笔记]:USB挂载& U盘启动(三)
- 通过mdev实现Linux下U盘自动挂载(笔记)
- 如何在openwrt上实现 U盘的自动挂载
- 学习笔记-《Linux基础知识之挂载详解(mount,umount及开机自动挂载)》
- Linux 第八周学习笔记(2) nfs,ldap网络帐号,autofs自动挂载服务
- [Openwrt 项目开发笔记]:USB挂载& U盘启动(三)
- Linux学习笔记-----挂载U盘
- openwrt自动挂载U盘
- linux 自动执行 crontab学习笔记
- Oracle学习笔记[1] - 自动逻辑备份并删除过期备份
- Struts 1 学习笔记-5-3(Struts的自动处理异常以及模式套用)
- 解决无法自动挂载U盘问题
- ITCAST视频-Spring学习笔记(让Spring自动扫描和管理Bean)