Installing OpenWRT with extroot on TP-LINK TL-MR3020

Unfortunately, my tries to get installed a pre-compiled firmware on TL-MR3020, which I found in openwrt web page, wasn’t enough to my needs. I mean, if you want just install and use, yes, it work without problem, but, extroot config can’t just work, that’s because the device doesn’t has enough free space to install all necessary modules or packages.

While I was trying to make it, I’ve used Attitude Adjustment 12.09, Barrier Bricker 14.07 and Chaos Calmer 15.05, unfortunately Chaos Calmer was a little buggy, because, it didn’t save the changes, and, when I tried to uninstall software the free space was smaller (weird behavior), maybe, if I’ll make a deeper research (or “mtd -r erase rootfs_data”, who knows!), I’m sure I find the solution, but… i didn’t.

With Attitude Adjustment 12.09 everything worked fine, I still recommend doing a factory restore before start using it. Make a extroot it’s too easy follow the steps in openwrt wiki, let’s put the hands on the work:

ssh root@192.168.1.1# Or your ip TL-MR3020
opkg update ; opkg install block-mount kmod-fs-ext4 kmod-usb-storage-extras
mount /dev/sda1 /mnt ; tar -C /overlay -cvf - . | tar -C /mnt -xf - ; umount /mnt
block detect > /etc/config/fstab ; vi /etc/config/fstab

Replace only what you need (target and uuid),

config ‘mount’
option target ‘/mnt/sda1’
option uuid ‘18784ace-3ede-4ff1-aaf1-a1212a569176’
option enabled ‘0’

for this:

config ‘mount’
option target ‘/overlay’
option uuid ‘c91232a0-c50a-4eae-adb9-14b4d3ce3de1’
option enabled ‘1’

and

reboot

wait for reboot (yes pray a little).

This scenario is unhappier on Barrier Breaker 14.07, if you try to install block-mount kmod-fs-ext4 kmod-usb-storage-extras, you won’t get enough free space. The ext4 module is the bigger file, more or less 400K, you can download an image generator for barrier breaker (in this case) from here, uncompress it and cd to the created directory, now generate the image with:

make image PROFILE="TLMR3020" PACKAGES="kmod-fs-ext4 kmod-usb-storage-extras block-mount luci"

With that command, you’ll generate a custom image that can mount an usb and a web interface installed. The image created is on bin/ar71xx/, I personally prefer do a CLI firmware upgrade by ssh:

scp bin/ar71xx/openwrt-ar71xx-generic-tl-mr3020-v1-squashfs-factory.bin root@192.168.1.1:/tmp
(to send the file)

Connected by ssh:

sysupgrade -v -n /tmp/openwrt-ar71xx-generic-tl-mr3020-v1-squashfs-factory.bin

after reboot you get free space to make the extroot configuration, well, after reboot connect by ssh:

mount /dev/sda1 /mnt ; tar -C /overlay -cvf - . | tar -C /mnt -xf - ; umount /mnt
block detect > /etc/config/fstab ; vi /etc/config/fstab

Replace the values for your needs (uuid and target)

config ‘mount’
option target ‘/mnt/sda1’
option uuid ‘18784ace-3ede-4ff1-aaf1-a1212a569176’
option enabled ‘0’

for this:

config ‘mount’
option target ‘/overlay’
option uuid ‘c91232a0-c50a-4eae-adb9-14b4d3ce3de1’
option enabled ‘1’

and

reboot

Remember pre-format your usb with ext4, you could do it from your AP, but it’s a waste of space, because, you’ll have to download e2fsprogs.

Now you have an excellent and powerful widget on your hands to make your life more beautiful, you could install samba or torrent web client and let the AP make the download.

Now we know how it works, exist another automatic easy way method, here is the link Auto extroot.