Sunday, September 26, 2010

USB flash drive on OpenWRT 10.03 Backfire HOWTO


There's been a number of guides for using USB flash drives on OpenWRT, but they all seemed to be overly complicated, or for previous versions of OpenWRT before 10.03 Backfire, for which it's now pretty simple.

This guide is written with the assumption that your USB flash drive is already formatted in ext2 or ext3, but ends with pointers on what to do if not.

Starting with a clean install of OpenWRT, the following packages are already installed.


root@OpenWrt:/mnt# opkg list-installed | grep usb
kmod-usb-core - 2.6.32.16-1
kmod-usb-ohci - 2.6.32.16-1
kmod-usb2 - 2.6.32.16-1


1. Install USB mass storage support. 


root@OpenWrt:~# opkg install kmod-usb-storage
Installing kmod-usb-storage (2.6.32.16-1) to root...
Downloading http://downloads.openwrt.org/backfire/10.03.1-rc3/ar71xx/packages/kmod-usb-storage_2.6.32.16-1_ar71xx.ipk.
Installing kmod-scsi-core (2.6.32.16-1) to root...
Downloading http://downloads.openwrt.org/backfire/10.03.1-rc3/ar71xx/packages/kmod-scsi-core_2.6.32.16-1_ar71xx.ipk.
Configuring kmod-scsi-core.
Configuring kmod-usb-storage.


2. Install the necessary file system support, in this minimalist case, ext2. (Other common file systems include ext3, reiserfs, hfs, msdos, vfat and ntfs.)

root@OpenWrt:~# opkg install kmod-fs-ext2Installing kmod-fs-ext2 (2.6.32.16-1) to root...
Downloading http://downloads.openwrt.org/backfire/10.03.1-rc3/ar71xx/packages/kmod-fs-ext2_2.6.32.16-1_ar71xx.ipk.
Installing kmod-fs-mbcache (2.6.32.16-1) to root...
Downloading http://downloads.openwrt.org/backfire/10.03.1-rc3/ar71xx/packages/kmod-fs-mbcache_2.6.32.16-1_ar71xx.ipk.
Configuring kmod-fs-mbcache.
Configuring kmod-fs-ext2.


3. Create a mount point. I chose to use /mnt/usb for my USB flash drive.

root@OpenWrt:/mnt# mkdir /mnt/usb

4. Mount the USB flash drive. The "-o noatime" is used to reduce the number of disk writes (as USB flash drives have a limited number of write accesses) and to slightly improve performance.

root@OpenWrt:/sbin# mount -o noatime /dev/sda1 /mnt/usb

5. That's it, done.

root@OpenWrt:/mnt/usb# ls -l /mnt/usb
drwx------    2 root     root        12288 Sep 26 10:52 lost+found
root@OpenWrt:/mnt/usb# df -h | egrep "system|usb"
Filesystem                Size      Used Available Use% Mounted on
/dev/sda1               232.9M      6.0M    214.8M   3% /mnt/usb

What if the above steps doesn't work out?

A possible reason is that the USB flash drive isn't formatted in ext3. You can then either install other file system support (by replacing step 2 with kmod-fs-vfat, kmod-fs-ntfs, kmod-fs-msdos, kmod-fs-ext2, etc. as necessary) or format the USB flash drive to ext3 using fdisk followed by mkfs.ext3.

Another possibility may be that you need to install the appropriate character encoding (also known as code-pages) to suit your language/locality. Such modules are typically named kmod-nls-xxxx, eg. kmod-nls-cp437, kmod-nls-iso8859-1 or kmod-nls-utf8.

Saturday, September 11, 2010

Gargoyle Router Management Utility on the TP-Link WR-1043ND

Since my Googling hasn't really turned out any meaningful results, just to add a short "web-note" that Gargoyle seems to run well on the TP-Link WR-1043ND.

Will update as I have more meaningful information to add.

Friday, September 10, 2010

OpenWRT 10.03 on TP-Link WR-1043ND wifi not accessible

Recently bought a TP-Link WR-1043ND, and after trying out the current latest firmware from TP-Link, immediately tried to install OpenWRT on it.

Following the instructions on the OpenWRT wiki, and installed version 10.03, which is the latest stable release. The installation went without a hitch, and I was immediately trying out the web-interface, but the installation didn't detect the wifi interface. After a period of Googling, rebooting and general fiddling, I gave up, and installed the latest beta release, 10.03.1-rc3.

This time, it immediately detected the wifi interface, and I'm now happily using and exploring OpenWRT.