openWRT USB设备的自动挂载
2014-11-11 13:45
429 查看
已经挂载好的分区可以通过df -h来查看,连接的设备可以通过fdisk -l来查看。比如:
root@OpenWrt:~# fdisk -l
Disk /dev/mtdblock0: 192 KiB, 196608 bytes, 384 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/mtdblock1: 64 KiB, 65536 bytes, 128 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/mtdblock2: 64 KiB, 65536 bytes, 128 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/mtdblock3: 15.7 MiB, 16449536 bytes, 32128 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/mtdblock4: 14.7 MiB, 15419904 bytes, 30117 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/mtdblock5: 4.6 MiB, 4784128 bytes, 9344 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/sda: 15.5 GiB, 16634675200 bytes, 32489600 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x017e1ea1
Device Boot Start End Blocks Id System
/dev/sda1 * 64 32489599 16244768 b W95 FAT32
Disk /dev/sdb: 12 MiB, 12517376 bytes, 24448 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x00000000
Device Boot Start End Blocks Id System
/dev/sdb1 64 24447 12192 4 FAT16 <32M
U盘就是其中的/dev/sda1 和/dev/sdb1 两个分区。把打的15G的分区挂在上,可以通过mount /dev/sda1 /mnt/udisk来挂在到目录下
自动挂载,可以通过两种方式:
1.直接修改/etc/config/fstab,添加:
config 'mount'
option 'device' '/dev/sda1'
option 'options' 'rw,sync'
option 'enabled_fsck' '0'
option 'enabled' '1'
option 'target' '/mnt/udsik'
2.通过UCI命令来完成,具体可以参考如下 start on boot章节:
http://wiki.openwrt.org/zh-cn/doc/howto/usb.storage
root@OpenWrt:~# fdisk -l
Disk /dev/mtdblock0: 192 KiB, 196608 bytes, 384 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/mtdblock1: 64 KiB, 65536 bytes, 128 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/mtdblock2: 64 KiB, 65536 bytes, 128 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/mtdblock3: 15.7 MiB, 16449536 bytes, 32128 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/mtdblock4: 14.7 MiB, 15419904 bytes, 30117 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/mtdblock5: 4.6 MiB, 4784128 bytes, 9344 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/sda: 15.5 GiB, 16634675200 bytes, 32489600 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x017e1ea1
Device Boot Start End Blocks Id System
/dev/sda1 * 64 32489599 16244768 b W95 FAT32
Disk /dev/sdb: 12 MiB, 12517376 bytes, 24448 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x00000000
Device Boot Start End Blocks Id System
/dev/sdb1 64 24447 12192 4 FAT16 <32M
U盘就是其中的/dev/sda1 和/dev/sdb1 两个分区。把打的15G的分区挂在上,可以通过mount /dev/sda1 /mnt/udisk来挂在到目录下
自动挂载,可以通过两种方式:
1.直接修改/etc/config/fstab,添加:
config 'mount'
option 'device' '/dev/sda1'
option 'options' 'rw,sync'
option 'enabled_fsck' '0'
option 'enabled' '1'
option 'target' '/mnt/udsik'
2.通过UCI命令来完成,具体可以参考如下 start on boot章节:
http://wiki.openwrt.org/zh-cn/doc/howto/usb.storage
相关文章推荐
- 树莓派Raspberry Pi实战之命令行下实现USB存储设备自动挂载
- 树莓派USB存储设备自动挂载
- TP-LINK WR703N 刷OpenWrt并设置pppoe联网、安装LUCI、添加新用户、挂载USB设备、配置ftp服务、借由transmission实现脱机下载(续)
- 树莓派自动挂载usb移动存储设备
- 树莓派Raspberry Pi实战之命令行下实现USB存储设备自动挂载
- 在嵌入式开发平台中实现USB设备的自动挂载
- Raspberry Pi 自动挂载USB存储设备
- Linux 自动挂载 usb 设备
- Raspberry Pi 自动挂载USB存储设备
- 树莓派-USB存储设备自动挂载
- 树莓派上手实战之命令行下实现USB存储设备自动挂载
- Cubieboard下的Usb及Sata存储设备自动挂载
- 树莓派USB存储设备自动挂载
- 树莓派上手实战之命令行下实现USB存储设备自动挂载
- 树莓派2(Raspberry pi)取消 usb 存储设备的自动挂载
- Raspberry Pi-2 启动自动挂载USB设备
- TP-LINK WR703N 刷OpenWrt并设置pppoe联网、安装LUCI、添加新用户、挂载USB设备、配置ftp服务、借由transmission实现脱机下载
- TP-LINK WR703N 刷OpenWrt并设置pppoe联网、安装LUCI、添加新用户、挂载USB设备、配置ftp服务、借由transmission实现脱机下载
- Linux下C语言来检测USB设备以及自动区分U盘和硬盘并自动挂载
- OpenWrt挂载USB储存设备实现Samba共享