Extroot and Swap on Wrt160NL with OpenWRT

I have met the space limitations of my router, so I thought I should extend it.

I have bought an usb pendrive, and I did a little research. Luckily OpenWrt supports space extension of the router. There are many ways of doing that. There is an overlay directory on the router, which can be used for extending the filesystem.



After all, I chose my own way and mounted manually to overlay. I think it is a better way because you can’t brick the router in this way even tough there is an automatic way for that, but my problem was, first this way didn’t work (maybe I misunderstood something), it seemed you can easily brick your router this way (it is only my opinion, I was lazy to do further research).

Here are the steps what I did:

1. I had a 8GB pendrive, so I formatted it to 6 GB with ext2, and the rest with swap.

2. I installed the following packages:
block-extroot
block-hotplug
block-mount
Depending on your medium (USB-Device, IDE-Device, SATA-Device or SD/MMC device) you need:
kmod-usb-core Kernel support for USB
kmod-usb2 Kernel support for USB2 (EHCI) controllers
kmod-usb-ohci Kernel support for USB OHCI controllers
kmod-usb-storage Kernel support for USB Mass Storage devices

For more info.

3. I copied the overlay directory to the pendrive.
mount /dev/sda1 /mnt/pend1 #my pendrive is sda1, it can be different in your system.
df -h # only for testing the mounting is worked

cd /mnt/pend1 # another way

The instructions of copying:
tar -C /overlay -cvf - . | tar -C /mnt/pend1 -xf -
#Also, you can create your on file on the pendrive, for the testing, but there is an other way, that will be mentioned later.

4. I have mounted my pendrive to the overlay directory
mount /dev/sda1 /overlay
df -h # only for testing the mounting is worked

# or you can go to lucy and see it.

Swap:

Requirements.

I didn’t need all the packages, because the busybox already provided on of the necessary things(swap-utils). I already formatted the FS for the swap as it mentioned above. The only thing is left to do this:
swapon /dev/sda2

You can check it by the command:
free

For more information: link.

That’s all.

Advertisements

One thought on “Extroot and Swap on Wrt160NL with OpenWRT

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s