Wednesday, July 24, 2013

Tomato router and usb ext3 fs

I was copying some files to my routers external hd and sshed into it to notice that 75% of the CPU was being used by the ntfs daemon.  I had formatted the drive and used it with a windows machine before attaching it to the router.  I wanted to change it over to ext3 to hopefully bottle neck the router with smb instead :).

I ran into a problem making the fs on Tomato though, I had to create a swap device and turn it on for the mke2fs command to run successfully.  I didn't realize it would take so much memory.  But simple solution.  I also had to write the partition table after deleting the old partitions.

fdisk /dev/sda # adjust for disk if necessary
p # to see existing partitions
d # to delete partition if any
w # write table
fdisk /dev/sda
n # new swap
p # primary
1 # partition 1 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
2 # partition 2 Data
 # default start block
 # default remaining blocks
p # check partitions
w # write it all out and exit
mkswap -L swap /dev/sda1
swapon
mke2fs -j -L data /dev/sda2