How to increase storage on TP-Link WR703N with ExtRoot

tp-link wr703n with thumbdriveA few days ago I wrote about how you can flash OpenWRT on the TP-Link WR703N router and build a ~20$ cheap OpenWrt router this way. OpenWrt actually works quite well on the WR703N, but in retrospect the following problem arises.
Unfortunately the WR703N has only 4MB flash (memory), so (depending on the selected image/firmware) after installing OpenWrt there will be just about 900 kB of free memory available. If you now want to install one or more extensions for OpenWrt, which in my opinion is one of the main benefits of using a OpenWrt system, you will be confronted with “no space available” messages in really no time. One solution to “bypass” this problem is to “ExtRoot” your router.

ExtRoot is a functionality that can be used to outsource the OpenWrt file system of the router to an external storage medium. This can be for example a USB flash drive or an external hard drive. How to set up the TP-Link WR703N for the ExtRoot feature is what I want to show you in the following.

ExtRoot on the TP-Link WR703N

For following instructions, I decided to use a USB thumbdrive for the outsourcing of the file system. However it would be possible (as described above), to use an external hard drive for example.

Step 0

Before we can start, a USB flashdrive with the ext4 file system is needed. Theoretically you could create these directly under OpenWrt on the router, but I hadn’t enough memory to install both, the format tools for USB flash drive and the tools for ExtRoot, on my TP-Link WR703N. So I had to create the ext4 USB flashdrive by the help of my computer.

how to extroot a tp-link wr703n (1)  how to extroot a tp-link wr703n (2)

How to create a USB thumbdrive with ext4 file system on Linux, you can read here (with gui) and here (by Shell). How you can create a USB stick with ext4 file system on Windows, I have described here.

If you’ve prepared your USB flashdrive, plug it into the WR703N and log in to the router by using SSH (e.g. with Putty).

Step 1

First you have to check if your router has recognized the USB flashdrive and if its firmware provides USB storage support.

ls /dev/sd*

The above command should list all external drives. If the result of the command is empty, you need to install the package for USB storage support. (Previously you should update the package list.)

how to extroot a tp-link wr703n (3)  how to extroot a tp-link wr703n (4)

#Update package list
opkg update

#Install USB storage support
opkg install kmod-usb-storage

After successful installation of the package you can try to run the first command (“ls /dev …”) again. Now you should see your USB flashdrive listed up in the output of the command.

Step 2

Next we need to install the packages that are needed for ExtRoot and ext4 file system support. This works by subsequent command.

opkg install kmod-fs-ext4 block-mount

Step 3

Now we copy the file system to the USB drive. (One command per line.)

mkdir -p /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
umount /mnt/sda1

Step 4

Now need to make a small adjustment to the /etc/config/fstab file.

vi /etc/config/fstab

Within vi you can change into the edit-mode by pressing the i-key. Then you have to change the following two lines inside the config mount-block.

how to extroot a tp-link wr703n (5)  how to extroot a tp-link wr703n (6)

option target /home
option enabled 0

option target /
option enabled 1

By pressing the ESC-key you can leave the edit-mode of vi. With ! you enter the command-mode. With :w you can save your changes and with :q you can close vi if you’re ready with the editing.

Step 5

Now you only have to restart your router.


After rebooting the router, connect again to it (via SSH). By subsequent command you can test, if everything worked fine.

#Show mounts

In the line rootfs you should now see that the storage capacity is the same as the one of your USB flash drive.  A look into the router’s web backend (at the System->Software tab) should also disclose whether everything went fine.

how to extroot a tp-link wr703n (7)  how to extroot a tp-link wr703n (8)

That’s it. The article may look like it’s a lot of work to get things done, but don’t be scared by that. It’s done really fast and if you have any questions, then don’t be afraid to write me a comment.

About the author: This article, as well as 131 more on en.code-bude.net, were published by Raffi. – Since 2011 I've been blogging here and on code-bude.net, the german counterpart, about programming and my software, write tutorials and try to share my knowledge, as well as possible, with my readers. Furthermore I write at derwirtschaftsinformatiker.de on subjects of my studies.
  //    •  • Facebook  • Twitter

  1. Stan says:

    Thanks for providing this information in an easy to use format. I see several people are having problems as their USB drive isn’t coming up as expected. My ext4 partition didn’t show up as sda1 either, but this didn’t surprise me. Maybe you should update the instructions to indicate that sda1 may not be the correct partition and suggest how they identify which one, and how they should change the commands to match.

    Thanks again!

  2. load.nikon says:

    I ran into a problem when I tried to do this where I had formatted a 16GB drive with 8G of FAT32, 100MB linux swap, and the rest to ext4. I followed your directions exactly, half figuring that it would fail because ls showed 5 different sda things. After getting a nasty “you’re out of space” message, ds showed sda7 was the one I wanted to make the extroot point to for storage. ds did not show the FAT32 partition so that narrows things down for my following question.

    While following your instructions above, how do I point out the linux swap partition (once I figure out which sda* it is?

    here’s the ds I got:

    root@OpenWrt:~# ls /dev/sd*
    /dev/sda /dev/sda1 /dev/sda5 /dev/sda6 /dev/sda7
    root@OpenWrt:~# df
    Filesystem 1K-blocks Used Available Use% Mounted on
    rootfs 1088 1016 72 93% /
    /dev/root 2048 2048 0 100% /rom
    tmpfs 14608 460 14148 3% /tmp
    tmpfs 512 0 512 0% /dev
    /dev/mtdblock3 1088 1016 72 93% /overlay
    overlayfs:/overlay 1088 1016 72 93% /
    overlayfs:/overlay 1088 1016 72 93% /tmp/cproot
    /dev/sda7 6693988 12522 6324551 0% /mnt/sda7

    • load.nikon says:

      Uh, sorry. That last bit didn’t display here very nicely…

    • john says:

      Hi Load.Nikon
      I to am getting exactly the same scenario as yourself with multiple sda’s & I dont seem to be able to run these commands without throwing up an error.
      mkdir -p /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
      umount /mnt/sda1

      Did you manage to sort this out & get this working?


  3. […] How to increase storage on TP-Link WR703N with ExtRoot […]

  4. blgoh says:

    Hi Raffi ,
    I am new to linux. However I managed to install madox image dated Oct 2012 when I first got my 703N. It is working perfect as a client and AP. Recently I managed to extroot using 4gb flash drive as per your instructions. Later I attached a 4 port USB hub and attached the 4gb flash drive, a printer, a usb DAC and also a hard disc drive. I managed to install MPD by following instructions your instructions and succeeded to output music to my earphone. I also managed successfully to install the printer software.
    Regarding the MPD, I copied only one wav file to the 4gb flash for testing purpose. All my wav files are in the usb hdd, how do I go about accessing the hard disk drive?
    All the items were available when I issued a lsusb command.

    • Raffi says:

      You should “mount’ your harddrive. Maybe you have to install some stuff to support the filesystem (like NTFS) of your harddrive. At which point do you stuck?

      • blgoh says:

        HI Raffi,
        When I replaced the usb hdd with a flash drive, it was mounted as shown on Luci. Let’s say if I ever managed to get the hdd mounted later on, how do I go about linking my MPD music directory to the hard disc drive which contains all my music files.

  5. […] Expand TL-WR703N’s memory using ExtRoot […]

  6. sanja_nvkz says:

    Thanks, works like a charm!

  7. Nathan says:

    After this, what will happen if my flashdrive breaks down? I don’t want to brick my router for this.

    • Raffi says:

      The router config will be dropped and extroot feature will be forgotten by the router. It will run like it has run before you added the extroot feature.

      Nevertheless you should simply clone your usb thumbdrive, so that you have one if the first dies or gets lost.

  8. Aquoibon says:

    It works,cool~!!
    Thanks for your tutorial.

  9. seko says:

    I tried it with an SD card and it worked! Thank you!!!

  10. tyler roberts says:

    is it posible to do this with an sd card?

    • Raffi says:

      This should be also possible. Just try it. I think an usb sd card reader/writer in combination with a sd card should work.

      If you tried it and had success (or whatever failed), please leave another comment, so that I can share your experience with the other readers of my blog.

  11. toketin says:

    I tried to set transmission-daemon on this Wr703n, but it crashes down after about 10 seconds. Do you guess this is a lack of ram problem?

  12. toketin says:

    Thanks great guide :D

  13. steven says:

    Hi,guys.I found a portable power bank specifically designed for TP-Link mini wireless router WR702N and WR703N,you can order it at http://igg.me/at/sofa/x/989539.

  14. rmanna says:

    thanks for the tutorial btw :)

  15. rmanna says:

    in step 3, “mount /dev/sda1 /mnt” should be “mount /dev/sda1 /mnt/sda1″