© 2009 admin

Setting Up A Low Cost NAS Using Tomato

In this post I’ll describe the steps needed to setup a low cost NAS using the Tomato firmware on the Asus 520gu.  This should work with Asus 500 as well.

If you have no idea what a NAS is, think of it as a shared storage device within your home network that you can access via an ip address to store and retrieve documents, wirelessly. If you and your wife/girlfriend/partner have two separate computers, you could store, say vacation photos in this shared storage. This device would appear as a folder/drive on both a Mac and a PC. You can simply drag and drop files to it.

What you need:

A note about our homebrew NAS…
I’m going to tell what most don’t about setting up a USB Wifi NAS. It is pretty cool to put to good use your spare usb drive or external harddisk. But don’t expect blazing speeds.

Storing files, documents, music, photos are fine. But if you are thinking of doing a hard drive backup or store full length videos, the speeds may not be acceptable.

But don’t let that discourage you! It is still pretty cool! We use it as a back up storage device for our photos and serves that purpose pretty well!

Formatting the USB drive
Tomato supports these filesystems:
FAT32 (Windows/Mac/Linux)
FAT16 (Windows/Mac/Linux)
EXT2 (Linux)
EXT3 (Linux)

When you buy a hard drive, it is most likely formatted to FAT32 since most operating systems support it without having to install additional drivers.

So why pick another filesystem?
FAT32 is by Microsoft! If that doesn’t convince you, you have a file size limitation of 4GB, plus FAT32 provides no security and in general quite inefficient.

FAT16. Don’t even consider it! This was the standard used by old MS DOS OS.

EXT2 is mostly used by Linux Operating Systems. Neither Windows nor Mac can read EXT2 drives natively

EXT3 is EXT2 with journalling enabled. Without the technobabble, that means EXT3 helps prevents file corruption in case of an non graceful system shutdown (if you simply pull the USB drive out without unmounting it first)

EXT3 is most preferred. But the disadvantage is once formatted to this format, you can’t plug in your USB drive to your PC or Mac and try to read or write files. You need a Linux system to do that. (There are ways to get PCs and Macs recognize EXT2/EXT3 drives, but that involves additional work).

The biggest advantage of FAT32 is most drives come preformatted to this format. You can plug in the USB drive to your Mac or PC and you will be able to see this drive as another mount point.

What I’ve done is partitioned my old Seagate 160GB hard drive to both FAT32 and EXT3. They now appear as two mount points on both Windows and Mac.

If all this is too technical, just plug in darn drive into the ASUS router! Chances are that it’ll just work!

Getting Started
Set up Tomato on the Asus router

In the admin screen goto USB and NAS

tomato-nas-usb-support

Your config should look like the screenshot above with the exception of Attached Devices.  Don’t attach the USB device yet.  Save the configuration above and restart the router.  Now, come back to this screen and you should see your storage device listed.

If the device shows up as not mounted, make sure the hard drive is formatted to either FAT or EXT and not HFS+ (Mac) or NTFS(XP).  Both are not supported and the hard drive will have to be reformatted. Restart the router with the USB drive plugged in.  Check this screen, the device should show up as mounted.

If you’ve gotten this far, you are almost there!  Getting the device to mount is usually the biggest hurdle.  Now using telnet login to 192.168.1.1:

Trying 192.168.1.1...
Connected to davinci.
Escape character is '^]'.
davinci login: root
Password:

Tomato v1.23.8615 ND USB

BusyBox v1.12.3 (2009-01-28 23:18:53 EST) built-in shell (ash)
Enter 'help' for a list of built-in commands.

root@davinci:/tmp/home/root# cd /mnt
root@davinci:/tmp/mnt# ls
disc0_1 disc0_2
root@davinci:/tmp/mnt#

disc0_1 and disc0_2 are the partitions in my USB drive. If you have only one partition, you’ll see only one disc. Note down this info.

Go to File Sharing under USB and NAS. Enter the info as in this screenshot below:
tomato-nas-file-sharing

For each directory under /mnt, give a share name and description and save. Set the code page and workgroup name (Windows default is workgroup). Set the access level to Read/Write. Save.

Now on a Mac:
Open Finder
Goto Go..Connect to Server
picture-17
You will now be displayed the mount points and your share will appear under ‘Shared’ in Finder!

On a PC:
Your shares should appear automatically in Network Neighborhood with the share name you specified

Now you drag and drop files to your NAS device over a wifi network. Pretty cool huh?!

  1. So How Fast Is NAS Under Tomato? You May Be Surprised!
  2. How to format a drive to Ext2/Ext3 from a Mac (or Windows)
  3. An Easy Guide to Installing Tomato on the Asus 520gu
  4. Case For Setting Up a Low Cost Home Surveillance System

58 Responses to “Setting Up A Low Cost NAS Using Tomato”

  1. ravishi says:

    What kind of transfer speeds are you able to achieve? It very very slowly ramps up to a max of about 250 KB/s. It takes a good 3-4 minutes to get to that speed. With a PC to PC transfer, I get about 600 KB/s. Note these are all wireless transfer speeds.

  2. admin says:

    I haven’t done a formal speed test yet, but if feels slower than a PC-PC transfer (I’ve updated the post to reflect this). You are right, Wifi might not be the bottleneck. Might have something to do with the USB drivers+Samba on the firmware.

  3. Vij says:

    This is a fantastically useful post! I really appreciate it! Thanks so much!

  4. admin says:

    @ravishi, I did some formal benchmarking with Mac-PC and Mac-Router+USB_Drive, the results are quite surprising!

    http://www.society9.com/so_how_fast_is_nas_under_tomato/

  5. Davi says:

    The problem is I can’t find the USB and NAS menu in my Tomato. I’m using Tomato 1.23 and WL-520GU.. Thanks

  6. admin says:

    You cannot use official tomato. Download it from the place I’ve linked to

  7. davi says:

    ^^

    Where is the link?

  8. foobar says:

    Thanks for the doc. Set things up as indicated… router sees the flash drives but refuses to mount them. Checked filesystem types and tried several different flash drives, no luck. Any ideas on what is wrong or how to troubleshoot this. Thanks!

  9. phsieh says:

    Hi,

    Thanks for the steps. It only took me a couple of minutes to set it up. I can access the USB drive from MS Windows. But, I am not able to access the USB drive from Ubuntu 8.10 – does not know how. Can someone post the steps? Thanks!

    phsieh

  10. foobar says:

    Found why I was having problems…

    The router does not understand how to mount a drive that does not have a partition table on it (whole device being used w/o partitions). So, just created a /dev/sdb1, mkfs vfat on it, and then the router sees it fine and can unmount and mount it from the tomato gui.

  11. davi says:

    Hi, it’s me again… Just one question…
    We all know that WL-520GU has a USB port. Is it possible to connect it to a GSM/CDMA modem via that USB port? Using Tomato or DD-WRT?

    Thank you….

  12. admin says:

    @davi,
    No that wouldn’t work. Tomato doesn’t come with drivers for a modem.

  13. davi says:

    ^^

    @ admin
    Then, Do you know firmware that can do that?

  14. admin says:

    Nothing can at the moment

  15. Nathan says:

    I have the NAS set up and it is working well. However, I cannot get the print server to work. It recognizes my HP C3180 but will not let it mount. How do I set it up to print wirelessly using the wl-520gu and Tomato?

    • admin says:

      To setup the printer look at the comments here:http://www.society9.com/an-easy-guide-to-installing-tomato-on-the-asus-520gu/

  16. Lutte says:

    This is a fantastic post, thank you so much.

    I have a couple of what might be obvious questions;

    First, I’m new to Tomato and I’m wondering if MLPPP is enabled by default or if in this version it’s simply not available. I’m having trouble finding where the settings for it are.

    My second question is even more straightforward. As a test I’ve used a thumb drive formatted with FAT32 and it works fine but I’d like to use an external hard drive. The only one that I have is formatted with NTFS and it isn’t “powered” (if that means plugs into the wall), but the WL-520gu seems to get it spinning up pretty well. Before I go ahead and reformat my drive I’m wondering if it needs to be powered externally.

    Thanks again.

  17. admin says:

    Tomato doesn’t support ntfs. The drive has to be fat or ext2/3. No the drive needn’t be powered. Under basic->network->type there is a pppoe option

  18. coldfeet says:

    already mounted and shared my 8gb on the router.. and its working fine..is it possible to convert this to a torrentbox? how will i add the torrent application etc..

  19. DB says:

    Awesome tutorial, nice clear and concise.

    Are you by any chance working on any other tutorial?

  20. admin says:

    @db: Yes have a few more in the pipeline!

  21. Alan says:

    I followed your instructions and it works great. I do however have a question, under windows network, I see 2 folders “disc0_1″ and “Shared” (My shared folder). Am i suppose to see both folders or only “Shared”?

  22. Alan says:

    Actually scrap the question. In tomato 1.25 there is a option “Auto-share all USB Partitions” I had it on Read/Write.

  23. Allen says:

    ok, I mounted my flash drive and set the file sharing. I can see it in my network but it’s netwrok name is RT-0022158D92ED and it’s subfolders are the usb drive that I shared, the name that I put on the share name box and the printer folder. Is it right? because from what I undertood is that the share name that i inputted should be the one displaying on my network and it’s subfolder should be the usb drive. Hoping for your answer thank you.

  24. Al says:

    Your tutorial was very helpful. I’ve got a 80GB USB2 drive up and spinning.

    I want to store bandwidth utilization data on the USB HDD. I’ve looked for documentation on how to do that rather than to have another system running with a network share. I could do it that way but this is more useful as I can go look at the data from any number of systems in the house. I see how to do this from a NAS device external to the Tomato router but not how to do the save to the directly attached USB device.

    Thanks.

  25. BMX says:

    anyway to add a codepage.936 to this firmware?

  26. David says:

    Thanks. My little 160 GB usb drive is now the center point, shared point of our house system.

  27. Shawn says:

    I’ve got the drive setup and it shows as being mounted, but I have no idea how I’d telnet into it (haven’t telnetted since the Win 3.1 days).

    Several months back, when I originally setup this router w/ Tomato using the related post, I WAS able to setup a USB flash drive to work, but I have no idea how I ended up accessing it from my PC. That computer was Vista, this one is Win7, if that matters.

    Thanks,
    Shawn

    • Kevin says:

      To answer your telnet question in relation to Win 7 and Vista -
      Telnet is disabled by default in Vista and Windows 7, so you need to turn on the feature:
      * open control panel
      * Then go into programs
      * Then in ‘programs and features’ there should be a part that says ‘turn windows features on or off ‘
      * Click ‘turn windows features on or off ‘ then on the list that appears simply choose: Telnet Client

      Now open a ‘cmd’ window and type ‘telnet 192.168.1.1′ and you’ll see the login prompt for the router

      • Shawn says:

        Thanks Kevin –

        I got Telnet turned on and working. When I enter “telnet 192.168.1.1″ I get “unknown login:” and I enter my username
        then it says “Password:” and I enter my password.
        Result is “Login incorrect”

        I’m positive my username/password are the same. I’ve tested it by clearing cache, and relogging into the router via the browser page.

        Any ideas? Thanks.

        • Kevin says:

          This may answer your question:
          As ‘VoIP Tips’ says on July 23, 2009 on the http://www.society9.com/an-easy-guide-to-installing-tomato-on-the-asus-520gu/comment-page-3/#comments

          “Note that when using Telnet to access DD-WRT, the username is always root, regardless of the username to access the web interface. The password is the same as the password to access the web interface.”

          Hope this works / keep trying – I got mine set up last night with a powered USB Hub so that I have a NAS, a standard USB printer, and an older 1284 parallel printer (with an USB to parallel cable) all simultaneously working together.

          • Robin says:

            Which USB to parallel cable are you using with Tomato and the 520GU? It seems they have different chips in them (e.g. mine has a MOSCHIP MCS7715). I was wondering mine will work with the 520GU and Tomato. Since yours works, maybe I should just get the same cable so I know it works.

            Thanks,

            Robin

          • Kevin says:

            Hi Robin,
            I used a BYTECC 4.5 ft. USB-Parallel Cable With IEEE 1284 Bridge Model USB-1284
            Item#:N82E16812270237 from Newegg

            All the info Newegg gives is that it’s a single chip (ASIC). Package came with a mini-CD driver disk, but I obviously didn’t need to load a thing. Just selected USB 1 & 2 support in Tomato and added the printer port in operating systems. I’m using the cable with an old Xerox DocuPrint P12.

            Hope this helps,
            Kevin

  28. Westo says:

    Awesome read thanks! I think this much easier now with the latest builds of the Tomato USB hack as it has automount functions.

    Just got my NAS mounted on the router. Minutes later I had it mounted on my ATV (via NitoTV SMBFS mount) and shows up in the NitoTV menu under Files. If only I could run an iTunes streaming server (without an extra computer) then i’d be set for life.

    40GB AppleTV (craigslist): $130
    ASUS WL-520GU+Tomato (newegg): $45
    For another $100 you can get a 1TB drive

    pretty sweet deal if you ask me

  29. Shawn says:

    Still hoping someone can get me from “mounted” to “accessing the drive via my PC.”

    Thanks,
    Shawn

  30. Shawn says:

    Still hoping? Purty please?

  31. Nam Vu says:

    I have Win7, and after getting the USB to mount, I simply reset the router, then go to ‘Network’ in Windows Explorer, and there I find it. If you can access it from there, you can then assign a drive letter to it so you can easily get to it later from My Computer. To do that, right click on “My Computer”, choose “Map Network Drive” and enter the network address of the USB drive.

    That’s what I did, I didn’t even telnet’d into the router. I don’t know if that creates any problem or not, but right now, my flash drive seems to be read-only in every computer in my network.

  32. Shawn says:

    Thanks Nam. I’m still having issues. Thinking it might just be my USB HD that was the issue, I tried reinserting the USB flash drive that I HAD gotten to work previously. No luck – still don’t see it in the Network view in Explorer.

    Here’s what Tomato is saying. Maybe someone speaks better Tomato than I. There’s some key phrases in there that indicate trouble for my USB HD (Unable to connect USB device to the SCSI subsystem) but no warnings for the flash drive and it also doesn’t work.

    17:44 is when I turned the USB Hard Drive on
    18:55:11 is when I tuned it off
    18:55:33 is when I plugged the USB Flash Stick in

    Nov 2 17:44:08 unknown user.info kernel: hub.c: new USB device 00:03.1-1, assigned address 3
    Nov 2 17:44:08 unknown user.warn kernel: Unable to connect USB device to the SCSI subsystem
    Nov 2 17:44:08 unknown user.debug kernel: WARNING: USB Mass Storage data integrity not assured
    Nov 2 17:44:08 unknown user.debug kernel: USB Mass Storage device found at 3. Host: 0
    Nov 2 17:44:08 unknown user.debug hotplug[9062]: Waiting for device /proc/bus/usb/001/003 [INTERFACE=8/6/80 PRODUCT=4971/ce13/104] to settle before scanning
    Nov 2 17:44:11 unknown user.info hotplug[9062]: USB partition at /dev/discs/disc0/part1 already mounted on /tmp/mnt/1PT540TB40NAS
    Nov 2 17:44:11 unknown user.warn kernel: Device busy for revalidation (usage=2)
    Nov 2 18:00:01 unknown cron.err crond[7128]: USER root pid 9074 cmd logger -p syslog.info — – MARK –
    Nov 2 18:00:01 unknown syslog.info root: — MARK –
    Nov 2 18:55:11 unknown user.info kernel: usb.c: USB disconnect on device 00:03.1-1 address 3
    Nov 2 18:55:11 unknown user.warn kernel: Unable to disconnect USB device from the SCSI subsystem
    Nov 2 18:55:13 unknown user.info hotplug[9118]: USB partition busy – will unmount ASAP from /tmp/mnt/1PT540TB40NAS
    Nov 2 18:55:13 unknown user.warn kernel: Device busy for revalidation (usage=2)
    Nov 2 18:55:27 unknown user.info kernel: hub.c: new USB device 00:03.1-1, assigned address 4
    Nov 2 18:55:27 unknown user.info kernel: scsi1 : SCSI emulation for USB Mass Storage devices
    Nov 2 18:55:27 unknown user.warn kernel: Vendor: TOSHIBA Model: TransMemory Rev: PMAP
    Nov 2 18:55:27 unknown user.warn kernel: Type: Direct-Access ANSI SCSI revision: 02
    Nov 2 18:55:27 unknown user.warn kernel: Attached scsi removable disk sdb at scsi1, channel 0, id 0, lun 0
    Nov 2 18:55:29 unknown user.warn kernel: SCSI device sdb: 7936000 512-byte hdwr sectors (4063 MB)
    Nov 2 18:55:29 unknown user.warn kernel: sdb: Write Protect is off
    Nov 2 18:55:29 unknown user.info kernel: /dev/scsi/host1/bus0/target0/lun0: p1
    Nov 2 18:55:29 unknown user.debug kernel: WARNING: USB Mass Storage data integrity not assured
    Nov 2 18:55:29 unknown user.debug kernel: USB Mass Storage device found at 4. Host: 1
    Nov 2 18:55:29 unknown user.debug hotplug[9123]: Waiting for device /proc/bus/usb/001/004 [INTERFACE=8/6/80 PRODUCT=930/6545/100] to settle before scanning
    Nov 2 18:55:32 unknown user.warn kernel: SCSI device sdb: 7936000 512-byte hdwr sectors (4063 MB)
    Nov 2 18:55:32 unknown user.warn kernel: sdb: Write Protect is off
    Nov 2 18:55:32 unknown user.info kernel: /dev/scsi/host1/bus0/target0/lun0: p1
    Nov 2 18:55:32 unknown user.info hotplug[9123]: USB vfat fs at /dev/discs/disc1/part1 mounted on /tmp/mnt/TOSHIBA

  33. ME says:

    i’ve run the process multiple times and i get my external hd mounted and i can view it via telnet but i can get my pc to communicate nor see it. i have also enabled file sharing. Is there something i am missing? Anyone experience the same issue or have a solution. Appreciate any help, happy holidays!

  34. ME says:

    sorry that should read “I can NOT get my pc to communicate nor …”

  35. bottle says:

    Trying to get the print server to work in Windows 7..

    I can’t even access the printer, it shows in tomato GUI, but not sure how to set up.

    Any help is appreciated.

  36. Shawn says:

    ME – I’m in the same boat as you. Drive shows as mounted on the Tomato page, but it doesn’t show up in the Network view in win7. I’m using Win7 x64 – might the 64-bit be an issue?

    Kevin – Thanks! That did the trick. I can access it via telnet, and it’s mounted (although it auto-mounted anyway, I suppose, so I didn’t need the telnet step).

    Now if I could only get my “network” to see it. Any suggestions for ME and I?

  37. Shawn says:

    Just a thought – I’m not seeing my ASUS router in the “network” view either. Shouldn’t I be?

  38. Kevin says:

    Hi Bottle – Concerning your printer issue.

    I did a similar process to the one suggested by Kyle (Jun 1st, 2009 at 12:15 pm)

    1. Load drivers on all the computers you wish to use the printer.

    2. Enable usb router settings

    3. Plug printer into router. Verify it’s recognized (doesn’t have to be mounted) in the tomato GUI (You say it already is)

    4. Go into Windows’ print server properties and click add new port. Choose standard tcp/ip, and enter ip of the router as the address. It’ll think for a bit and then choose generic network card. Verify that the settings are port 9100 and raw format (default settings).

    5. Save. Exit and print a test page.

    This worked for me on XP, Vista, and Win7 (64) After you have the printer ported to the correct address you’ll be able to access its properties.

  39. Chris says:

    i’m trying to move over 1gb files and it doesnt seem to to transfer over. can anyone help me? smaller files are no problem. just larger ones dont seem to want to transfer over.

  40. Chris says:

    cant seem to move over 1gb files. can anyone help me? smaller files are no problem. just larger ones dont seem to want to transfer over.

  41. Chris says:

    nvm i figured it out. it works by ftping in. i’ve got another question though is it possible to ftp in through the web? if so how would i accomplish this?

  42. Matt says:

    What kind of speeds are you getting with a NTFS formatted drive? It takes about 15-20 minutes to transfer 670mb which seems very slow.

  43. Misc says:

    Great tutorial!

    Managed to set up mine Low Cost NAS. It works for me :) .
    I have one question though.
    What are the options to make attached USB HDD accessible over internet from remote locations? And also being secure. So I can upload and download files from any remote location.
    Is it possible?

    Hoping!

  44. Greag says:

    I have got the drive mounted and I am using Tomato 1.27 on an ASUS router. For some reason I do not see the “file sharing” option listed under USB and NAS on my router? Is it because 1.27 does not support file sharing?

  45. Harry says:

    This is a fantastic post, thank you so much. I was looking for this since long time. Once i use your post it work like charm.

    Thanks

  46. chanakya says:

    I don’t think it matters. USB, no matter what chip it has, follows either USB 1.x or 2.0 specs and should work.

  47. Robin says:

    If it is true that all USB to parallel to cables are supported in Tomato because it is based on the USB 1.1 or 2.0 spec, then why does Moschip (or in fact a user rather than the company https://forum.openwrt.org/viewtopic.php?pid=80886f) release a Linux driver? This Moschip based cable is kind of weird in that I need to install a USB component driver on a Windows computer to be able to use the cable. Then I would need to install the printer drivers to use the printer. I can’t just plug the cable into XP and start using it. Why would it be different in Tomato unless there is a built-in driver for this chip to interface with the p910nd print daemon. Tomato doesn’t see the printer when I plug it in with this cable. I can try another cable, but I would prefer to buy a USB to parallel cable that is known to work from another manufacturer, so I don’t have to return it. I am tempted to solder a male header onto the serial leads on the 520GU board and connect via a terminal client so I can see what is happening with the operating system.

  48. Robin says:

    If it is true that all USB to parallel to cables are supported in Tomato because it is based on the USB 1.1 or 2.0 spec, then why does Moschip release a Linus driver? https://forum.openwrt.org/viewtopic.php?pid=80886f) This Moschip based cable is kind of weird in that I need to install a USB component driver and USB to LPT driver on a Windows computer to be able to use the cable. Then I would need to install the printer drivers to use the printer. I can’t just plug the cable into XP and start using it. Why would it be different in Tomato unless there is a built-in driver for this chip to interface with the p910nd print daemon. Tomato doesn’t see the printer when I plug it in with this cable. I can try another cable, but I would prefer to buy a USB to parallel cable that is known to work from another manufacturer, so I don’t have to return it. I am tempted to open up my 520GU, solder a male header onto the serial leads, and connect via a terminal program (terminal on my MBP or hyperterminal in Windows) so I can see what is happening with the operating system and my printer recognition.

Leave a Reply

CAPTCHA image