電訊茶室's Archiver

角色 發表於 2013-11-23 19:59

【OpenWRT】—— TL-WR1043ND USB port for expansion of root file system

[i=s] 本帖最後由 角色 於 2013-11-23 20:30 編輯 [/i]

因为系统的ROM Flash只有8M,如果要安装很多packages,那么8M Flash就不够了。我们可以通过USB 2.0的port,然后安装flash drive后,通过适当的settings,那么就可以安装很多packages了。

[attach]2971[/attach]

Root file system只有4.78M剩余。

角色 發表於 2013-11-23 20:29

[i=s] 本帖最後由 角色 於 2013-11-23 20:56 編輯 [/i]

1. Install the following packages[code]
opkg update
opkg install kmod-usb-storage block-mount block-hotplug kmod-fs-ext4 kmod-fs-vfat kmod-nls-cp437 kmod-nls-iso8859-1
[/code]Ignore the error messages[code]
Collected errors:
* opkg_install_cmd: Cannot install package block-hotplug.
[/code]2. Install additional package to give mkfs.ext4 from the package e2fsprogs[code]
opkg e2fsprogs
[/code]3. Insert the USB flash drive at the rear of the router

4. Reboot the system

5. Using SSH to enter the system and format the flash drive using the following command[code]
root@OpenWrt:/dev# mkfs.ext4 /dev/sda1
mke2fs 1.42.4 (12-June-2012)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
486720 inodes, 1944576 blocks
97228 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=1992294400
60 block groups
32768 blocks per group, 32768 fragments per group
8112 inodes per group
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632

Allocating group tables: done
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done

root@OpenWrt:/dev#
[/code]6. Using a browser to enter the GUI of the router. Go to [System]->[Mount Points]
[attach]2972[/attach]

7. Edit the device and select the option "Use as filesystem". Afterward, click the command "Save"
[attach]2973[/attach]

8. Check the mount points again to see whether the following figure you have. Enable this mount point and followed by "Save & Apply" command.
[attach]2974[/attach]

9. Reboot the system and flash drive becomes the root filesystem. The size of remaining file system for package installation is increased from 4.78M to 7.16G
[attach]2975[/attach]

10. In system using SSH, the system message of mounting device is[code]
root@OpenWrt:~# df
Filesystem           1K-blocks      Used Available Use% Mounted on
rootfs                 7753428    245596   7118920   3% /
/dev/root                 2048      2048         0 100% /rom
tmpfs                    30852       580     30272   2% /tmp
tmpfs                      512         0       512   0% /dev
/dev/sda1              7753428    245596   7118920   3% /overlay
overlayfs:/overlay     7753428    245596   7118920   3% /
root@OpenWrt:~#
[/code]

Skypeus 發表於 2013-11-23 20:47

赞一个。:)

頁: [1]

Powered by Discuz! Archiver 7.2  © 2001-2009 Comsenz Inc.