Monday, April 26, 2021

Get Extroot working on TP-Link TL-WDR4300 v1 with OpenWRT 18.06.2, 21.02.0 rc1

Update 2021/04/25: Also works on 21.02.0 rc1



This is just a quick copy paste way for me to remember in the future how I got my Extroot working using SSH putty
Note: This works on all 17.01 and so far up to 18.06.2 and now 21.02.0 rc1 (newest version at time of writing)


First "What is Extroot"

Extroot works by setting another overlay partition in the external storage device, and during boot this new overlay partition will be mounted over the internal storage's overlay partition. This approach allows easy fallback in case the external storage device is removed, as your device will still have its own overlay partition and thus will load all configuration from there.
Which means that it will behave exactly the same as just before you set up extroot. 




What packages do I need to install

Before you do anything else make sure you have the proper packages,  You can run these commands and don't worry if you have them already nothing will break.

Note: If you build your own firmware like I do using Chef Imagebuilder just add them, Links at bottom of page for imagebuilder.

Copy all of the highlighted text and paste it into SSH (putty)

opkg update && opkg install block-mount curl e2fsprogs fdisk kmod-fs-ext4 kmod-usb-ohci kmod-usb-storage kmod-usb-uhci nano

  If you reboot your router you will have to do opkg update again if you need to add more packages

Just copy paste one highlighted command at a time

 

 Attach USB stick to the router, If you have more than one stick in the router I would suggest running "block info" before and after inserting the stick and make note of the changing "sda" device name


block info 

mount /dev/sda1 /mnt ; tar -C /overlay -cvf - . | tar -C /mnt -xf - ; umount /mnt



block detect > /etc/config/fstab; \

sed -i s/option$'\t'enabled$'\t'\'0\'/option$'\t'enabled$'\t'\'1\'/ /etc/config/fstab; \

sed -i s#/mnt/sda1#/overlay# /etc/config/fstab; \

cat /etc/config/fstab;

Last thing to do is reboot then check if you got more space on your router
reboot

df -h 

Just remember one line at a time, don't think about how weird it looks just do it.


Here is a pick, you will see what I mean when I say it looks weird

Note the > after the "block detect" command.



Check for more space




Build your own firmware the easy way.
Chef Imagebuilder 
https://github.com/libremesh/chef
https://github.com/aparcar/attendedsysupgrade-server

2 comments: