Yes it's possible and it's great!
1. First make sure you have full working USB support: install these packages (on the device)
kmod-usb-storage
block-mount
block-hotplug
kmod-fs-ext2
2. prepare an USB stick by formating it with an ext2 filesystem - you won't be able to do this from the router itself (installing the filesystem tools packages takes too much space), either:
a) do it from Windows with various tools, for example: EASEUS Partition Master 9
b) do it from some other Linux with: mke2fs /dev/<usb device>
3. plug the stick in the router and mount it:
mount -t ext2 /dev/<usb device> /mnt/usb/
<usb device> usually it's sda1
/mnt/usb must be first created with mkdir, or you can use /mnt directly - from now on i'll assume /mnt/usb/ was used
4. prepare opkg for external installs
edit /etc/opkg.conf and add an extra line that maps the destination "usb" to the path where you mounted the stick
dest usb /mnt/usb/
5. prepare the extra paths for executables and libraries:
export USB=/mnt/usb
export PATH=$PATH:$USB/usr/bin:$USB/usr/sbin
export LD_LIBRARY_PATH=$USB/lib:$USB/usr/lib
6. install whatever you want on the external storage with:
opkg install <package> -d usb
so "-d usb" is the key, make sure you don't forget it otherwise packages will be installed in the router storage itself and will quickly fill it up leading to corruption!
NOTES:
* you will want to automate steps 3 and 5 somehow otherwise on the next reboot it won't work and you'll have to run them again
for #5 edit /etc/profile and add the variables there
* some programs need additional config files to run, you will have to create links between the root filesystem and the usb one
for example for successfully running Midnight Commander after installing it on usb run:
ln -s $USB/usr/share/terminfo/ /usb/share/
ln -s $USB/etc/mc /etc/mc
Enjoy!
(Last edited by valentingalea on 1 Apr 2012, 10:33)