Prerequisites
- TP-Link TL-MR3020 router must flashed with OpenWRT, I'm using Barrier Breaker 14.07 for my router.
- TP-Link TL-MR3020 router must connected to the internet. Click here for more information.
Preparing the flash drive
The first step is to format the flash drive with two partitions, the Ext4 & Linux Swap partition as shown in figure below. I'm using MiniTool Partition Wizard Free to format the flash drive.
After completing the formatting, eject the pen drive from the computer and plug it into the router.
Install required packages
Login to router via SSH and install all the required packages.
opkg install block-mount kmod-usb-storage kmod-fs-ext4 |
Chances are you will be seeing the following errors (failed to insert /lib/modules/3.10.49/ext4.ko). Just reboot the router without doing anything.
Configuring kmod-scsi-core. |
Get the name of the flash drive
I,m using a 8GB falsh drive, it was /dev/sda1
[email protected]:~# block info /dev/mtdblock2: UUID="20ad40ea-d33a421e-785b7d2d-ada99230" VERSION="4.0" TYPE="squashfs" /dev/mtdblock3: TYPE="jffs2" /dev/sda1: UUID="cdfd73b1-8c85-d001-c0f0-72b18c85d001" NAME="EXT_JOURNAL" VERSION="1.0" TYPE="ext4" /dev/sda2: VERSION="2" TYPE="swap" |
Copy the rootfs from flash memory to flash drive
After entering all the following command, the flash drive now has a copy of the router’s root filesystem on it.
mkdir /mnt/sda1 |
Make the router boot from flash drive
Login to router via WinSCP and edit the /etc/config/fstab file. Below is my original configuration.
config 'global' config 'mount' config 'swap' |
Chage it to the following. Take note that target is changed from /mnt/sda1 to /
config 'global' config 'mount' config 'swap' |
Reboot the router and check your space
[email protected]:~# df -h |