💡 How Can I Use a USB External Drive in My OpenWRT Router as Software Installation Storage?
I run OpenWRT on a router with limited internal storage, and using a USB external drive (like an SSD or flash drive) as the main software installation path can be a lifesaver. I like to guide us through using Extroot to mount external storage for installing packages and storing data — even after a reboot.
If you’re running OpenWRT on a router with limited internal storage, using a USB external drive (like an SSD or flash drive) as the main software installation path can be a lifesaver. This guide walks you through using Extroot to mount external storage for installing packages and storing data — even after a reboot.
✅ Step-by-Step: Setting Up USB Drive as Software Storage on OpenWRT
🔄 1. Update the Package List
Before doing anything, log in to your router via SSH (using tools like PuTTY or Terminal), and update the available package list:
📦 2. Install Required USB and Filesystem Support Packages
Since OpenWRT often resets packages on reboot, make sure to (re)install all required packages:
🔍 3. Check If Your USB Drive Is Detected
Run the following commands:
You should see something like
/dev/sda1(for swap) and/dev/sda2(main storage). If you don’t, try unplugging and replugging the drive.💽 4. Format the Drive (If Needed)
If
/dev/sda2isn’t formatted properly, format it with ext4:⚠️ Warning: This will erase all existing data on
/dev/sda2.📁 5. Mount the USB Drive Manually
Create a directory and mount the drive:
Now verify it:
You should see
/dev/sda2mounted on/mnt/sda2.📤 6. Copy Existing System Data to the SSD
Copy the overlay data to your SSD:
This step ensures that your system data moves to the SSD.
⚙️ 7. Configure Extroot in
/etc/config/fstabTell OpenWRT to use the USB SSD as the overlay (installation path) on boot:
🔁 8. Reboot and Verify
Now, reboot your router:
After the reboot, run:
You should now see
/overlaymounted on/dev/sda2— congratulations, your OpenWRT router is now using the USB drive as the main storage!👨🔧 Final Tips
Got questions? Drop them in the comments or reach out to us at ITSupport.com.bd — we’re always happy to help!