Sunday, 03 May 2015 23:42

How to increase storage on TP-Link TL-MR3020 with ExtRoot

How to increase storage on TP Link TL MR3020 with

The TP-Link TL-MR3020 N150 3G/4G Travel Router is a very small device with a size of 74mm x 67mm x 22mm, it has only 4MB flash and 32MB memory. The router have about 428KB (67%) space available after installing OpenWRT Barrier Breaker 14.07, you may encounter shortage of storage when installing certain extensions due to limited of router space. 

By employing OpenWrt's extroot, you can expand the storage capacity of your root file system using the additional space of an added storage device.

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.

MiniTool Partition Wizard Free

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.
kmod: failed to insert /lib/modules/3.10.49/sd_mod.ko
Configuring kmod-usb-storage.
Configuring kmod-crypto-hash.
Configuring kmod-lib-crc16.
Configuring block-mount.
Configuring kmod-fs-ext4.
kmod: failed to insert /lib/modules/3.10.49/ext4.ko

 

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
mount /dev/sda1 /mnt/sda1
mkdir -p /tmp/cproot
mount --bind / /tmp/cproot
tar -C /tmp/cproot -cvf - . | tar -C /mnt/sda1 -xf -
umount /tmp/cproot

 

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'
option anon_swap '0'
option anon_mount '0'
option auto_swap '1'
option auto_mount '1'
option delay_root '5'
option check_fs '0'

config 'mount'
option target '/mnt/sda1'
option uuid 'cdfd73b1-8c85-d001-c0f0-72b18c85d001'
option enabled '0'

config 'swap'
option device '/dev/sda2'
option enabled '0'

 

Chage it to the following. Take note that target is changed from /mnt/sda1 to /

config 'global'
option anon_swap '1'
option anon_mount '1'
option auto_swap '1'
option auto_mount '1'
option delay_root '5'
option check_fs '0'

config 'mount'
option target '/'
option uuid 'cdfd73b1-8c85-d001-c0f0-72b18c85d001'
option enabled '1'

config 'swap'
option device '/dev/sda2'
option enabled '1'

 

Reboot the router and check  your space

[email protected]:~# df -h
Filesystem   Size      Used     Available    Use%   Mounted on
rootfs         6.0G     7.4M     5.7G          0%       /
/dev/root    2.3M     2.3M     0               100%   /rom
tmpfs         14.1M   356.0K  13.7M        2%       /tmp
/dev/sda1   6.0G     7.4M     5.7G          0%       /
tmpfs         512.0K  0          512.0K      0%       /dev

Read 37748 times Last modified on Thursday, 04 August 2016 12:54
Back to Top