利用block

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#更新包列表
opkg update

#添加USB驱动支持
opkg install kmod-usb-storage kmod-usb-ohci kmod-usb2 kmod-usb-uhci

#添加从USB启动的工具软件
opkg install block-mount block-hotplug block-extroot

#添加EXT3文件系统支持
opkg install kmod-fs-ext3

#添加EXT4文件系统支持
opkg kmod-fs-ext4

#挂载根目录到/tmp/cproot
mkdir -p /tmp/cproot
mount --bind / /tmp/cproot

#挂载sda1到/mnt
mount /dev/sda1 /mnt

#复制flash所有文件到usb
tar -C /tmp/cproot -cvf - . | tar -C /mnt -xf -

#卸载/根目录
umount /tmp/cproot

资料参考:http://www.openwrt.org.cn/bbs/forum.php?mod=viewthread&tid=268