Tomato ND USB Mod


freddyspam,
The swapon command as you use it will not work if kernel assigns different host number to your drive after a reboot. However, it doesn't explain why the partition name was displayed incorrectly in the GUI.
With USB drives, it's not a good idea to depend on any kind of kernel-assigned host/drive number. The kernel assigns those dynamically, depending on the order it recognises them in, the order it deigns to process them in, the locking order of internal kernel locks, the phase of the moon, and how you hold your mouth. It is usually the same order from a clean bootup with no cabling changes, but nothing is guaranteed. That's why I thought that mount-by-label was vital to Tomato.

I don't see any obvious flaws in the code that can cause it, but it looks like reading from procfs files (/proc/scsi/scsi or /proc/partitions etc) while kernel is writing to these files can make scsi/usb subsystem to go wild - I'll do more research on that.
Yup. No bugs in Tomato (probably). What there is, is a kernel bug. Finding it will be a bitch. I have it on my todo list-----but way down---after jffs improvements and webcam support. To do it, I'm planning on building the kernel and Tomato's USB code on a PC, and using the PC console & kernel debug facilities. This is not something that can be easily done on router hardware.

BTW, the kernel doesn't "write to these files". The /proc files are a window into the kernel. The contents are generated on-the-fly as you read them. That's why the sizes of the /proc files always display as zero.
 
BTW, the kernel doesn't "write to these files". The /proc files are a window into the kernel.
I know it doesn't actually "write" procfs files, but I'm not sure how exactly it works internally - I suppose it just calls a function that writes into an output buffer. "While the content is changing" then... Or whatever the proper way to name it. What happens is if you read from, for example, /proc/partitions while partition list is changing, or from /proc/bus/usb/devices when devices are added or removed, the kernel may lock up. It's easily reproducible by running "cat /proc/<file_name>" in a loop while plugging and unplugging devices. In case of /proc/partitions I can only reproduce the problem if there are drives with multiple partitions plugged in.
Is there a "more proper" way of reading from procfs files?

I'm more and more leaning towards upgrading the whole kernel to 2.4.37 - even though it still has many issues, a lot of bugs were fixed in later releases of 2.4 kernel, and I'm getting tired of searching for and porting some of the fixes back to 2.4.20...
 
Thank you so much

I want to thank you so much for releasing this firmware. It has been very helpful to me. My old WRTSL54GS had Thibor on it, but you have helped me move it to the Tomato generation of firmware. That is quite a feat. Two thumbs up for you!

If you don't mind a question ... I'm trying to save my bandwidth log to my flash drive. The flash drive is a Kingston, and the volume label is KINGSTON. It seems to be mounted as /tmp/mnt/KINGSTON. I want to save my bandwidth monitoring history to my flash drive.

I've tried /tmp/mnt/KINGSTON/history/ and it doesn't seem to save the history on my flash drive.

Would you mind telling me how to save my bandwidth history to the flash drive.

Thank you very much.
 
Update:

I tried using fstab but it still gave me the same error. I think it was still trying to use the second partition instead of the third. Telnet'ing into the router and trying to manually swapon the correct partition would give the same error. Finally, I "reorganized" the drive and placed the swap as the first partition, and that seemed to make the labeling issue go away. I'm sure it was a combination of factors that caused this to occur, so it might not be worth debugging.


-----

I have two questions somewhat unrelated to my previous problem.

I've had to reboot my router a few time by force. This has caused some errors on my drive even though I'm using ext3. I simply hooked up my drive to a linux box and ran e2fsck to fix it, but is there an easier way to have periodic checks while still attached to the router? A way to check only a small portion of the drive at a time maybe? I tried running e2fsck on the router, but with a 300bg drive, it took hours, and of course, without a swap, that wouldn't even be possible.

Secondly, I've noticed that the transfer rates are limited to usb 1.1 rates (which is probably why e2fsck takes so long). I've read in other forums (which I can't find at the moment) that the hardware (on the asus 520gu) is actually 1.1. So is it the processor/flash limiting the transfer rate or is it actually just usb 1.1?
 
Gold and a9988cd,

You both have PMs with a link to the test build that may work on WL-500gD. If it boots up, but some minor things don't work properly - like buttons and LEDs - we can try to troubelshoot and fix them. But if it doesn't even boot, unfortunately I won't be able to do anything else without the router on hands - all I could do by guessing and looking at other firmware codes has been done...


hi teddy_bear!

can you send me the link too? or is the compatibility already given in the latest release? i have a wl500g deluxe and want to test you tomate mod! whould be really great to see it running on my little router! thank you very much!

greetings,
moviecut
 
moviecut,
Unfortunately, that build did not work. The easy "blind" approach (porting code from other firmwares) did not work out, and without the router on hands I can't do much more...

freddyspam,
The USB transfer rate depends on many different factors. The info you found elsewhere is correct - wl-520gu hardware is faster than 1.1 bit it's not "true" usb 2.0. I'm getting about 3 MB/sec rates on 520gu.
As for running e2fsck, I don't think there's a way to check a portion of a partition. It works ok for 1-16GB flash drives on the router, but for large drives you probably need to do it on a computer...

pandora,
Did you make sure "history" folder exists on your Kingston flash drive? If yes, I don't know what's wrong - I'll try it when I get a chance.
 
thanks TB for your response.

I figured out the problem. wl country code was set to "JP". I think Jon did this to fix the upper wireless channels 12-14, but it's no good for me. I am going to patch the init.c and set my country code as "US" instead (in Tomato 1.19 it was "ALL", maybe I'll try that too)
 
moviecut,
Unfortunately, that build did not work. The easy "blind" approach (porting code from other firmwares) did not work out, and without the router on hands I can't do much more...


thank you for the fast reply! i tested it yesterday, but it dont work as you said (didnt read your answer before because i was so excited in running tomato ;). i went back to openwrt now. anyway, great support here!:thumbup:
 
pandora,
Did you make sure "history" folder exists on your Kingston flash drive? If yes, I don't know what's wrong - I'll try it when I get a chance.
You are correct, the folder didn't exist. I assumed it would be created. My bad.

Currently the only significant problem I'm having with the firmware is hangs when moving large files. I'm using Samba and my 8GB USB stick attached as a network drive in FAT format. When I move a 580MB file (3DMark06_v110_oct07_installer.exe) the router times out, and the file is not correctly moved.

I'm Windows based, and would have difficulty reading a Linux format drive. :( Is there a known problem with large files to FAT drives? Is there a fix in the works?

Thanks!

BTW, kudos on making such a fantastic firmware. I'm running it on a WRTSL54GS and it is just wonderful.
 
A really bad bug was introduced in the last v22 build.
So far only one person complained about issues caused by this bug. It may not be affecting you at all - depending on what features you're using.

However, here's the list of what's broken in v22:
- when using multi-partitioned drives, mount may incorrectly mount/unmount wrong partitions, mounting by label or UUID may not work sometimes, "mount -a" command may generate an error;
- mke2fs (in "Extras" build) may not be able to format a partition, e2fsck may work incorrectly;
- mkswap may not work for some partitions;
- incorrect partition labels and filesystem types may be displayed in the GUI.

I will release an update fixing this as soon as I finish testing it - probably tomorrow. Until then you can downgrade to v21 that did not have this problem, or just continue using v22 if you have not experienced any issues yet - but I would recommend not to use mke2fs and e2fsck in this build.
 
Do you know if the update can fix the problem of Samba hanging when transferring large files to a FAT flash? I'd like to copy some large folders to a FAT drive, but every time it starts to move any single large file the network drive times out. :(
 
Hi,

I'm having some memory problems with this firmware.

I have an Asus WL-500GP v2 router, with 32MB memory. After some hours running I get only 2% - 3% (average) available memory. I notice that the network becomes a little sluggish as soon as the available memory decreases to these levels. CPU Load is low as usual.

I'm running Samba and FTP server (therefore with USB enabled), QOS is disabled.

With Tomato vanilla firmware I usually get 17 to 19 MB free memory all the time. When changing/upgrading firmwares I always erase the nvram before and after the process.

What may be the cause of this memory "leakage"?
 
The_Unknown,
I'm running it on 16MB RAM Asus, with Samba, FTP, Asterisk and QoS, and did not notice any "leakage" :). Granted, USB and additional applications will consume more memory and resources. Depending on your actual network usage, it may or may not cause some slow downs - the router still has limited resources, and is not a full-blown Linux box. However, for most home users with a few clients the difference should not be noticeable.

Also this memory is not always "used" by these applications. Most of the time it's "cached", and as such can be given to other applications on demand. You can try to check "Show cached memory as free memory" box on "Debugging" page - then you'll see how much memory is actually available when needed.
 
Do you know if the update can fix the problem of Samba hanging when transferring large files to a FAT flash? I'd like to copy some large folders to a FAT drive, but every time it starts to move any single large file the network drive times out. :(

Are you pushing the file from your big computer to the router? Or pulling it (command from the router, "cp /cifs1/bigfile /mnt/flashdrive")?

I can well believe that pushing may be a problem--Samba can easily shove packets into the router faster than the router can write them to the USB drive. Try opening a telnet session on the router and cp from your big box. What happens? Does that work?
 
Update - build 23.

Bug fix release.
  • Fixed serious bug of previous build 22 described a few posts above.
  • Display additional info in the GUI for attached USB devices: always show filesystem type even for unmounted drives, show size for mounted partitions, fixed display of multiple attached printers.
  • Allow domain name as admin access restriction - from StPepper' VPN mod.
  • Fixed DST rules for some Russian timezones.
  • Added Country/Region setting to "Advanced Wireless" page. This is mostly intended to help with setting Tx Power value (see this thread for details).
  • Minor fixes, code optimization and cleanup.
Links to the firmware binaries and the git repository with sources are in the 1st post. The complete sources of this build can also be downloaded as a git snapshot in tar format.
 
I am trying to add a 320 GB external notebook drive to my Linksys WRTSL54GS using your firmware. For some reason it won't mount.

Is there a partition / file size limit in your firmware?

Other than that it works great, it works well with my flash drive.

What Linux utilities / commands would I use to partition and format my drive from telnet using my router?
 
For some reason it won't mount.
Could be many reasons...
How is it formatted - what filesystem? FAT/NTFS/Ext(2|3)?

Is it recognized at all by the router? What is in the logs when you connect it? Can you see the drive in the "Attached devices" list in the GUI? Does it have an external power supply, or does it use USB power? Does it spin up when you connect it?

As for the commands to partition and format the drive, read the first post.

Guys, when asking for help please provide as much information as you can, otherwise it will be very difficult if at all possible to help you, or explain why it doesn't work!
 
Thanks for your help. It is formatted as a FAT32 drive.

The device seems to be detected. The following is visible from "Attached Devices" in the GUI / USB Support tab -

Storage 0 Iomega Iomega eGo USB/FW400 Por000000504191
Partition 'TOMATO' vfat is not mounted

When I click the "Mount" button the following error is reported - <192.168.1.1>

Failed to mount. Verify the device is plugged in, and try again.

The log reads as follows -

Mar 25 18:31:22 Tomato user.warn kernel: USB device disconnected from the SCSI subsystem
Mar 25 19:00:02 Tomato syslog.info root: -- MARK --
Mar 25 19:22:10 Tomato user.info kernel: usb-uhci.c: $Revision: 1.275 $ time 18:30:40 Mar 24 2009
Mar 25 19:22:10 Tomato user.info kernel: usb-uhci.c: High bandwidth mode enabled
Mar 25 19:22:10 Tomato user.info kernel: usb-uhci.c: v1.275:USB Universal Host Controller Interface driver
Mar 25 19:22:50 Tomato user.info kernel: hub.c: new USB device 01:02.2-1, assigned address 4
Mar 25 19:22:50 Tomato user.warn kernel: Vendor: Ext Hard Model: Disk Rev:
Mar 25 19:22:50 Tomato user.warn kernel: Type: Direct-Access ANSI SCSI revision: 02
Mar 25 19:22:50 Tomato user.warn kernel: Attached scsi disk sda at scsi0, channel 0, id 0, lun 0
Mar 25 19:22:50 Tomato user.warn kernel: SCSI device sda: 625142448 512-byte hdwr sectors (320073 MB)
Mar 25 19:22:51 Tomato user.info kernel: /dev/scsi/host0/bus0/target0/lun0: p1
Mar 25 19:22:51 Tomato user.warn kernel: USB device connected to the SCSI subsystem
Mar 25 19:22:51 Tomato user.debug kernel: WARNING: USB Mass Storage data integrity not assured
Mar 25 19:22:51 Tomato user.debug kernel: USB Mass Storage device found at 4. Host: 0
Mar 25 19:22:51 Tomato user.info hotplug[878]: Waiting for device [8/6/80 59b/472/1] to settle before scanning
Mar 25 19:22:54 Tomato user.warn kernel: SCSI device sda: 625142448 512-byte hdwr sectors (320073 MB)
Mar 25 19:22:54 Tomato user.info kernel: /dev/scsi/host0/bus0/target0/lun0: p1
Mar 25 19:24:41 Tomato user.warn kernel: MSDOS FS: IO charset utf8
Mar 25 19:24:41 Tomato user.warn kernel: MSDOS FS: Using codepage 437
Mar 25 19:24:41 Tomato user.warn kernel: VFS: Can't find a valid FAT filesystem on dev 08:01.
Mar 25 19:24:41 Tomato user.warn kernel: FAT: freeing iocharset=utf8
Mar 25 19:24:41 Tomato user.warn kernel: MSDOS FS: IO charset utf8
Mar 25 19:24:41 Tomato user.warn kernel: MSDOS FS: Using codepage 437
Mar 25 19:24:41 Tomato user.warn kernel: VFS: Can't find a valid FAT filesystem on dev 08:01.
Mar 25 19:24:41 Tomato user.warn kernel: FAT: freeing iocharset=utf8
 

Back
Top