Page 1 of 5 123 ... LastLast
Results 1 to 15 of 66

Thread: [HowTo] Getting started (Firmware upgr, Storage, Samba, SSH)

  1. #1

    [HowTo] Getting started (Firmware upgr, Storage, Samba, SSH)

    I recently bought me an Asus WL-500g and a LaCie 200Gb mobile harddrive (USB2.0). I intented to use them as router (DUH) and as samba-storage on my home network. Speed wasn't really an issue, so that the Asus uses USB1.0 instead of 2.0 i can live with. Maybe, in a year or so, I'll replace it with an Asus version which has USB 2.0.

    Anyways, on installing the 'damn' thing I encountered many small problems. Thanks to this forum, i overcame them all, but it took some search effort. Especially 'the little facts' are scattered all over the place, making something which i think is very common (using your router as a router and attaching storage to it) harder than it needs to be.

    Therefore I made this post. Goal of this post is to explain how to accomplish attaching your asus as a router with storage, including all the little details.

    In this howto I assume you got the router bit working already, and know how to set it up again, if needed. If not, you might start working on that first Also I do not take any responsibility; if you screw over your asus, your computer or your harddrive (or anything, for that matter) I'm not responsible. Use at your own risk.

    First thing that becomes obvious after the installation of the WL500G is that the Asus firmware just doesn't cut it, at least not if you want to use Samba (Samba = windows based file sharing). I knew it was possible, since I researched that subject before purchasing the device. So I came here, and downloaded one of Oleg's excellent firmware images, to be precise, i downloaded this one:
    (choose the one applicable for your device)

    Then to upgrade the firmware. Step one is to reset your router to factory defaults. I didn't do this at first go, and got stuck with a router that wouldn't respond (luckily pressing the reset button like 6 seconds did the trick). To reset the router to factory defaults, visit the router homepage (usually, select 'system setup', then select 'factory defaults' and click the 'restore' button.

    Note that this will most likely lose you your internet connection, so if you're planning on using guides from the internet (like this one), have them open in your browser, or print them.

    After your router comes back up (you might have to re-establish the connection yourself, see the last part of this howto for an explanation), go to the homepage again, select 'system setup', then select 'Firmware Upgrade'.

    click the 'browse' button, select the firmware you downloaded, and click 'upload'. Your router will now upload and install the firmware, this might take a minute or so.

    After your router is back up, visit the homepage again. Go back to 'system setup', select 'Firmware Upgrade' and check if the numbers given correspond with the version you uploaded. If so, the firmware is succesfully updated. If not, you might want to try again.

    Now restore the settings needed for your internet connection, and save them. Also, if you want to use samba, enable the FTP under the 'USB Applications' section in the web interface. Though this is not strictly needed, without doing this the smb.conf doesn't exist.

    The new firmware comes with a telnet and ssh daemon. Telnet is a simple command-line interface. You can use it by doing 'start->run->telnet'. SSH is basically the same, but then over a secure channel. To use SSH on windows, i recommend downloading putty.

    Before you can use SSH, you need to generate 'keys'. These are used to encrypt the connection. To do so, telnet to your router. Log in as 'admin' with password 'admin'. Type the following to generate the keys:
    mkdir -p /usr/local/etc/dropbear
    dropbearkey -t dss -f /usr/local/etc/dropbear/dropbear_dss_host_key
    dropbearkey -t rsa -f /usr/local/etc/dropbear/dropbear_rsa_host_key
    mkdir -p /usr/local/sbin/
    echo "#!/bin/sh" >> /usr/local/sbin/post-boot
    chmod +x /usr/local/sbin/post-boot
    echo "dropbear" >> /usr/local/sbin/post-boot
    After this, the SSH daemon is running and you can connect to it with putty. Notice that we haven't saved these changes yet, so if you reboot your router now, you lose these settings. To save settings, do:
    flashfs save
    flashfs commit
    flashfs enable
    Connecting the remote storage (USB HDD/USB-stick/etc) is the next step. Simply plug in the device. Now for some thoughts on file-systems. Most likely your device is formatted with the NTFS filesystem. Though linux does have write support for NTFS (in contradiction to what i've seen people say on this board), the write support wasn't enabled in the firmware. So if your drive uses an NTFS filesystem, you won't be able to write to it. The logical choice for filesystem would be EXT2 or EXT3, since they are the native linux filesystems. Drawback of this would be that you can't use your USB HDD on a windows machine anymore. If the device is smaller than 32Gb, you could format it with a 'FAT32' filesystem. Both windows and the Asus can use this filesystem, and read/write from/to it. The easiest way to do this, is to connect your drive to your windows system and format it, choosing 'FAT32' as file system.

    If your device is bigger than 32Gb however, you can't use FAT32 for the whole device, since FAT32 has a limit of 32Gb. You could create several 32Gb FAT32 partitions (use windows to do this), or you could do what i did: create one 32Gb Fat32 partition, and use the rest as an EXT3 partition. That way you don't get a lot of partitions, but you will be able to use your device on both windows and the asus (note: on windows you'll only be able to use the 32Gb partition).To do this, connect the device to your Asus router and do the following:
    fdisk /dev/scsi/host0/bus0/target0/lun0/disc
    fdisk is the disk partitioner linux uses. use 'p' to print out the partition table, use 'n' to create a partition, use 'd' to delete a partition, use 'w' to write the partition table to the disk and use 'q' to quit fdisk. The /dev/scsi[..] part tells fdisk where your disk is. First print all partitions using 'p'. Notice the partitions have numbers. Then use 'd' to delete the partitions. After deleting all the partitions, first create your 32Gb windows partition. Type 'n', select 'primary', press enter (start block=1), type +32000M as the end block. This will result in a partition roughly 30Gb big. Now create another partition, select 'extended' and press enter on all questions. Then create the ext3 partition, by selecting 'n', 'logical' and press enter on the size questions. Then save your work by typing 'w' and quit fdisk by typing 'q'.

    Your disk has now been partitioned, but the Asus kernel doesnt know this. To let it know, reboot your device. You can do this by typing 'reboot' at the command prompt. Notice that unsaved changes will be lost, so it might be wise to save your changes (see above on how to do that). Fdisk changes won't be lost.

    After your router is rebooted, telnet of ssh back into it. Now to format the partitions. The trick to this is that the Asus doesn't have enough memory to format the biggest partition (at least, it didn't for my 200Gb drive). To be able to format this partition, you need to create a swap. You can temporarely use the windows partition to do this. Type:
    mkeswap /dev/scsi/host0/bus0/target0/lun0/part1
    swapon /dev/scsi/host0/bus0/target0/lub0/part1
    Now we'll create a ext3 file system on the logical partition:
    mke2fs -j /dev/scsi/host0/bus0/target0/lub0/part5
    Depending on the size of your disk, this might take a while. After this is done, you can use the partition. To format the 30Gb windows partition, the most easy way is to connect the drive back to your windows computer, delete the swap partition and create a primary partition. Be sure to format it as FAT32!. (you can do this by using the disk manager, start->settings->control panel->administrative tools->computer management->disk manager).

    Now that your drive is partitioned and formatted, the asus will be mounting the two partitions automatically. If you telnet to the device, you'll vind there's a 'harddisk' in the /tmp/ folder. This contains the first (FAT32) partition. In this harddisk folder there's also a subdirectory called 'part1', containing your second (EXT3) partition.

    Now to enable Samba (=windows file sharing). Edit your smb.conf by typing
    vi /etc/smb.conf
    Vi is an editor. If you want to start typing into the file, press the 'i' key (=insert) on the location where you want to add stuff. If you're done typing press the <ESC> button to get back to command mode. To save your work, type :w. To exit vi, type :q. To exit without saving, type :q!.

    Probably the easiest thing to do is to just erase any existing config. Then start by typing in:
            workgroup = <workgroup name>
            guest account = nobody
            security = share
            browseable = yes
            guest ok = yes
            guest only = no
            log level = 1
            max log size = 100
            encrypt passwords = yes
            dns proxy = no
    this section contains the global parameters for your samba setup. Replace <workgroup name> by the name your windows workgroup uses. If you're using windows 98 or older, you might want to set 'encrypt passwords' to no.

  2. #2

    howto - second part

    I take it the posts are moderated before they are actually posted. However, this means I can't add the second part of the howto to the thread. Here it is:

    Now you can set up your shares. I kept it simple, and made two shares, one for the fat32 partition, and one for the EXT3 partition:
      writeable = yes
      browseable = yes
      force user = admin
      writeable = yes
      browseable = yes
      force user = admin
    After you have created the smb.conf, make sure the system saves it when you save changes. To do this, do:
    echo /etc/smb.conf >> /usr/local/.files
    Now to make sure samba is started whenever your router is started.
    echo "/usr/sbin/smbd -D" >> /usr/local/sbin/post-boot
    echo "/usr/sbin/nmbd -D" >> /usr/local/sbin/post-boot
    and save your changes, and reboot:
    flashfs save
    flashfs commit
    flashfs enable
    After your router rebooted, you're ready! Type \\ in your internet explorer to explore the shares on your Asus!

  3. #3
    I also found I had to manually add my hostname (set by cable modem DHCP via ISP), to /etc/hosts by copying it off the commandline and next to localhost.

  4. #4

    FAT32 size limitations?

    Hi hezik, greet howto!

    I'm a little bit confused when you speek about 32GB limit in fat32.

    I'm using Acronis Partition Expert under WinXP and I have partitioned my 120GB disk when connected to my PC like this:

    first partition: FAT32 / 20GB / primary
    second partition: FAT32 / 99GB / logical
    third partition: EXT3 / 1GB / logical

    ... and it seems to work fine when plugged to the wl-500g! All partition are recognized and I have read/write access.

    So, do I miss something?

  5. #5
    I got worried when I read that, thinking that perhaps I would soon have problems--I converted a 120GB external hard drive from NTFS to FAT32 using PartitionMagic or some such to work with the router with write support a while back... Anyway, here's what I found.

    Quote Originally Posted by
    "While the FAT32 file system can support drives up to a standard theoretical size of 2 terabytes, (it 'can' be jury-rigged under Windows Millennium Edition to support partitions of up to 8 TB). Windows 2000 Professional and XP Professional cannot FORMAT a volume larger than 32 GB in size using their native FAT32 file system.

    "The FastFAT driver can mount and support volumes larger than 32 GB that use the FAT32 file system, such as those created locally by Windows 98 or ME in dual boot configuration, (subject to other limits listed here for Windows 98, ME and 2000 and here for Windows XP), but you cannot CREATE one using the Format tool from within either Windows 2000 Professional or XP Professional. If you attempt to format a FAT32 partition larger than 32 GB, the format fails near the end of the process with the following error message:

    Logical Disk Manager: Volume size too big."

  6. #6
    Personally I use ext3 and a Windows ext2/3 driver when need be.

    I'm still looking for a native filesystem for Windows other than NTFS or FAT without using some driver... and I've yet to find one. Until then I can't seem to share my ext3 partition with Windows filesharing.

  7. #7
    Quote Originally Posted by tomilius
    I got worried when I read that, thinking that perhaps I would soon have problems--I converted a 120GB external hard drive from NTFS to FAT32 using PartitionMagic or some such to work with the router with write support a while back... Anyway, here's what I found.

    Do you know if there is a "technical reason" for that 32GB limit with the native formating tool under win 2k and xp ?

  8. #8
    Join Date
    Apr 2004
    Quote Originally Posted by Spot
    Do you know if there is a "technical reason" for that 32GB limit with the native formating tool under win 2k and xp ?
    No, it's a political decision MS made. Technically FAT32 is able to support 2TB, but then the FAT table would be some GB's big, also the cluster size would be 64 kb so small files would increase the 'slack' (unusable space) a lot. Up to a few hundred GB FAT32 works fine especially with large files. Otherwise NTFS is a better choice, also because of the better fault tolerance rate and security options.

  9. #9


    Hi, great HowTo!

    I succesfully created the partitions with fdisk.
    But there's no way to create the Swap on Windows partition.

    [admin@(none) root]$ mkeswap /dev/scsi/host0/bus0/target0/lun0/part1
    -sh: mkeswap: not found

    Is it possible only to create one big ext3 partition? How?

    I'm a noob in unix.
    Can you help me, please?!

  10. #10
    Windows doesn't use ext2 or ext3. Geberally you're stuck with NTFS and FAT to use for Windows itself. Even though there's a thing for this called `LFS` there isn't really a free version that's safe to rely on other than read-only.

    You might be able to format partitions though safely from Windows though. You could use Paragons ExtAnywhere. Maybe something like this has a utility to format a drive -

    Then again you could just format it from the router if that's what you're trying to do.

    Another way would be to use something like Knoppix.

    Lots of info here hope I haven't confused but I'm in a rush

  11. #11
    To kuka :

    Actually the command is mkswap and not mkeswap.....this will fix it!

  12. #12
    You could also just partition the whole drive as FAT32 either using Linux or a Windows Version of mkdosfs - just search google for it and you will be successful. I use my 200GB wit a single FAT32 partition and without any problems...

  13. #13
    Tidbit - I didn't have a '/usr/local/sbin/' directory ( on a 500gx) for the post-boot file. The howto for that is right here.

    I also found out I had to enable the FTP Server, because otherwise the Asus wouldn't look for my drive when booting ('/tmp/harddisk' missing).

    Can anyone confirm that?
    Last edited by Tuur; 26-04-2005 at 08:19.

  14. #14
    Quote Originally Posted by hezik
    echo /etc/smb.conf >> /usr/local/.files
    Thank you, it's a great howto.

    Would somebody please tell me why I input "echo /etc/smb.conf >> /usr/local/.files", the system replies "no such file or directory" ?

    Did I do something wrong ?

    Thank you
    Last edited by cmtsau; 19-05-2005 at 02:41.

  15. #15
    You need to make your smb.conf file. Make sure you're using the lates custom oleg firmware too.

    You can make it with `vi` (good luck!) or upload it with ftp

    Here's what mine looks like:

    [admin@censored root]$ cat /etc/smb.conf 
    workgroup = WORKGROUP
    guest account = nobody
    security = share
    browseable = yes
    guest ok = yes
    guest only = no
    log level = 1
    max log size = 100
    encrypt passwords = yes
    dns proxy = no
    writeable = yes
    browseable = yes
    force user = admin
    It says this in a guide somewhere so it sounds like you've missed that.

Page 1 of 5 123 ... LastLast

Similar Threads

  1. Firmware upgrading HOWTO
    By Styno in forum WL-500g/WL-500gx Tutorials
    Replies: 6
    Last Post: 30-07-2008, 21:00
  2. Started with Custom 1.1.28. Need some help
    By fleppuhstein in forum WL-HDD Q&A
    Replies: 0
    Last Post: 04-04-2005, 21:01
  3. Samba in firmware
    By viper_002 in forum WL-500g Q&A
    Replies: 7
    Last Post: 31-03-2005, 19:24
  4. RCAMD started 3 times ?
    By max2950 in forum WL-500g Q&A
    Replies: 0
    Last Post: 09-03-2005, 12:45
  5. Samba and Firmware
    By Arobs45 in forum WL-500g Q&A
    Replies: 29
    Last Post: 20-01-2005, 14:49

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts