đĄ 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/sda2
isnâ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/sda2
mounted 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/fstab
Tell 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
/overlay
mounted 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!