Expanding OpenWRT Storage With an 8GB USB Drive on TP-Link TL-WR902AC: a Step-by-Step Guide
236 Views, 1 Favorites, 0 Comments
Expanding OpenWRT Storage With an 8GB USB Drive on TP-Link TL-WR902AC: a Step-by-Step Guide
If you've ever tried to install additional software on a router like the TP-Link TL-WR902AC, you’ve probably run into storage issues due to its limited 8MB of internal flash memory. In this blog post, I'll walk you through how I expanded the storage of my TL-WR902AC using an 8GB USB drive and set up an FTP server with anonymous access, all while keeping things simple and efficient.
youtube link:
Why Expand Storage on OpenWRT?
By default, the TL-WR902AC router comes with only 8MB of flash memory, and after installing OpenWRT, you’re left with roughly 2MB of usable space. This makes it impossible to install additional packages like Samba, adblock, or even an FTP server, as the storage fills up too quickly. To solve this, I decided to use an external USB drive to expand the available space and store larger files.
Supplies
1. TPlink_tl-wr902ac v4 custom build: https://pastebin.com/rF3MFZqK
2. Expand storage OpenWrt using USB: https://pastebin.com/nFvrrpdS
3. FTP using vsFTPd in OpenWrt: https://pastebin.com/h6vX8pXr
Preparing the USB Drive for Expansion
I started by using an 8GB USB drive. To prepare it:
- Plug the USB into your Windows PC, right-click the Windows icon, and open Disk Management.
- Find your USB drive, delete all existing partitions, and eject it without creating any new partitions.
- Plug the USB drive into the router, and run the following script to partition and format the drive:
opkg update
opkg install block-mount kmod-fs-ext4 e2fsprogs parted kmod-usb-storage
This setup allows us to use 2GB for expanded router storage (extroot) and 5GB for an FTP server.
Expanding OpenWRT Storage
Once the drive was partitioned, I moved the root filesystem to the 2GB partition. This provided extra space for installing packages and ensured the system wouldn’t run into storage issues again.
Without this custom setup, any attempt to expand storage or install large packages would fail due to the lack of disk space.
Setting Up an FTP Server
With the extra storage in place, I installed vsftpd, a lightweight FTP server. I configured it for anonymous access so that anyone could upload and download files without the hassle of creating users or setting complex permissions.
However, I had to adjust the folder permissions:
- The root FTP directory (ftp_share) is secured with no access for anonymous users.
- The storage subdirectory is given full 777 permissions, allowing users to read, write, and execute files within it.
This setup ensures that the root folder remains secure while giving users the freedom to interact with the storage folder as needed.
DONT COPY AND PASTE DIRECTLY!
Resolving FTP Server Partition Auto-Mount Issues
Initially, after rebooting the router, the 5GB FTP partition wasn't auto-mounting. To fix this, I went into Mount Points in the LuCI web interface and enabled auto-mount for the ftp_share partition. After another reboot, everything mounted correctly, and the FTP server functioned as expected.
Final Thoughts
With this setup, I’ve transformed my TP-Link TL-WR902AC from a basic router with limited storage into a robust device with 2GB of usable space for packages and a 5GB FTP server. While this method works well, keep in mind that the TL-WR902AC is a low-powered device with a single-core CPU. Pushing it too hard may affect performance or even cause issues, so always keep your setup lightweight.
Future Plans
In future videos, I’ll dive into more advanced FTP server setups, such as user authentication and firewall configurations that restrict access to specific devices. But for now, this simple, anonymous FTP setup works perfectly!
Additional Resources
Check out my other videos for tutorials on setting up ad blockers, 5GHz Wi-Fi, and more on OpenWRT. All the links, commands, and resources mentioned in this post are available in the video description!
youtube links:
TP-Link TL-WR902AC v4 Usb tethering OpenWrt: A friendly guide.
https://www.youtube.com/watch?v=oitYRDxWo5A
OpenWrt adblocking in router Tp-Link TLWR902AC: A friendly guide.
https://www.youtube.com/watch?v=hDm8THMLGYA
Thanks for reading, and until next time!