Free WiFi for all : Headlines

Thursday, October 21, 2010

How to Prepare USB Disk for Optware Installation on Tomato Firmware

How to Prepare USB Disk for Optware Installation on Tomato Firmware

Tool needed
-Router with USB support
-Router install with TomatoUSB firmware
-Putty program (for telnet)

Instructions


1) Open Tomato menu. On the USB Support page, be sure to check Core USB Support, USB 2.0 Support, USB Storage Support, Ext2/Ext3, and Automount. Save this. Your disk should appear lower on the page under Attached Devices. On the right hand side, if it is Mounted, click Unmount.

2) Telnet to the router (I use Putty program)

Code:
fdisk -l
To see available devices . Should be /dev/sda.

3) Use fdisk to create the partitions. In the following lines, # and after are comments. is the enter key.

Code:
fdisk /dev/sda # adjust for disk if necessary
p # to see existing partitions
d # to delete partition if any
n # new partition
p # primary partition
1 # a one for partition 1 for Optware
# start at default 1 block
+368M # size of Optware partition in MB; can be larger
p # check partition
n # new swap
p # primary
2 # partition 2 Swap
# start at default block
+64M # size of Swap in MB; can be larger
t # set type of Swap partition
2 # partition 2 is Swap
82 # swap type
p # check partitions
n # new Data for remaining
p # primary
3 # partition 3 Data
# default start block
# default remaining blocks
p # check partitions
w # write it all out and exit
4) Now you need to format the partitions as ext3 and swap: (adj disk ref as necessary). Names after -L below are partition labels you can change as desired.
Code:
mke2fs -j -L Optware /dev/sda1
mkswap -L Swap /dev/sda2
mke2fs -j -L Data /dev/sda3
5) Now if you reboot and check the USB Support page under Attached Devices you should see your disk with all three partitions listed under Description with all but Swap mounted. Of course the Swap partition won't be mounted but you should see /tmp/mnt/Optware and /tmp/mnt/Data or whatever you named it.

6) Then add the following script in Run after mounting (just below Automount checbox) to mount the Optware partition as /opt for use with Optware.
Code:
if [ -d /mnt/Optware ]; then
mount -o bind /mnt/Optware /opt
transmission-daemon -g /opt/share/transmission/config
fi
Execute the mount command from the above script and check to see /opt is correct.