Page 1 of 3 123 LastLast
Results 1 to 15 of 66

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

Hybrid View

Previous Post Previous Post   Next Post Next Post
  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:
    http://files.wl500g.info/asus/custom/oleg/1.9.2.7-4/
    (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 http://192.168.1.1), 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 192.168.1.1'. 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:
    Code:
    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
    dropbear
    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:
    Code:
    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:
    Code:
    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:
    Code:
    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:
    Code:
    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
    Code:
    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:
    Code:
    [global]
            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:
    Code:
    [fat32]
      path=/tmp/harddisk
      writeable = yes
      browseable = yes
      force user = admin
    [ext3]
      path=/tmp/harddisk/part1
      path=/tmp/harddisk
      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:
    Code:
    echo /etc/smb.conf >> /usr/local/.files
    Now to make sure samba is started whenever your router is started.
    Code:
    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:
    Code:
    flashfs save
    flashfs commit
    flashfs enable
    reboot
    After your router rebooted, you're ready! Type \\192.168.1.1 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 http://www.allensmith.net/Storage/HDDlimit/FAT32.htm
    "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
    Quote Originally Posted by hezik
    Code:
    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.

  9. #9
    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:

    Code:
    [admin@censored root]$ cat /etc/smb.conf 
    [global]
    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
                                                                                    
    [rshare]
    path=/tmp/harddisk
    writeable = yes
    browseable = yes
    force user = admin
    It says this in a guide somewhere so it sounds like you've missed that.

  10. #10
    So u just make txt file and rename it to smb.conf, and ftp it to the root af the drive and that it???

    Quote Originally Posted by jago25_98
    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:

    Code:
    [admin@censored root]$ cat /etc/smb.conf 
    [global]
    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
                                                                                    
    [rshare]
    path=/tmp/harddisk
    writeable = yes
    browseable = yes
    force user = admin
    It says this in a guide somewhere so it sounds like you've missed that.

  11. #11
    Man i have follewede this guide to the letter... but when i get to this point:

    mkeswap /dev/scsi/host0/bus0/target0/lun0/part1
    swapon /dev/scsi/host0/bus0/target0/lub0/part1

    It gives this feedback:
    [jolly79@AJOLLYWIRELESS root]$ mkeswap /dev/scsi/host0/bus0/target0/lun0/part1
    -sh: mkeswap: not found
    [jolly79@AJOLLYWIRELESS root]$ swapon /dev/scsi/host0/bus0/target0/lub0/part1
    swapon: cannot stat /dev/scsi/host0/bus0/target0/lub0/part1: No such file or directory
    [jolly79@AJOLLYWIRELESS root]$ $ ls -l /usr/local/
    -sh: $: not found


    This is how it looks in fdisk when i type P:

    Command (m for help): p

    Disk /dev/scsi/host0/bus0/target0/lun0/disc: 81.9 GB, 81964302336 bytes
    255 heads, 63 sectors/track, 9964 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes

    Device Boot Start End Blocks Id System
    /dev/scsi/host0/bus0/target0/lun0/part1 3890 7780 31254457+ 83 Linux
    /dev/scsi/host0/bus0/target0/lun0/part2 1 3889 31238361 5 Extended
    /dev/scsi/host0/bus0/target0/lun0/part5 1 3889 31238329+ 83 Linux

    Partition table entries are not in disk order

    Am i doing somthing wrong, my linux is really bad.... but i want the samba server to work.

  12. #12
    I am very new to linux. I did not get the NFS thing to work. If I enable NFS Demo into the web interface I can see my files but I cannot read or write them.
    Now I did the things above but I cannot access the directory for postboot file. I have an ASUS 500g deluxe. My hdd is partitioned to 116gb FAT32 (one part) and it works for ftp.

    So in someones smb.cfg there is rshare in others fat32 , what is right?

    And how can I delete whole lines with vi?

    Can someone give me a detailed step-by-step description on how to get it done or what could be wrong on my side? (500gx)

    Thanks a lot
    Peter

  13. #13
    vi:

    I don't really know how to use vi but i know the absolute basics:
    press `a` to add text,
    go rightwards to the end of the line using the `right arrow`,
    use backspace to delete

    when finished press escape to stop editing text,
    then use `:` (shift + ;) to issue the command `w` and press return - this saves the file

    to exit use `:` (shift + ;) to issue the command `q` and press return - this quits vi


    another way is to upload the file with ftp

    NOT ALL VERSIONS OF THE FIRMWARE INCLUDE SMB

    Go to update firmware and tell me what version you're running
    Last edited by Antiloop; 20-05-2005 at 08:12. Reason: turned off smilies in this post

  14. #14
    It's 1.9.2.7-5a. And it's a Deluxe.

  15. #15
    can anyone else tell me if that's definiately Oleg firmware?

    read http://wl500g.info/showthread.php?t=1984

    Limited samba support
    Since 1.7.5.6-5 Samba 1.9.17p5 is included but, not enabled by default.
    Important notice: the samba is totally unsupported, use on your own risk!

    Small how-to:

    * Be sure you've specified hostname in the LAN IP Setting (this name will used be by samba)
    * add the following to your /usr/local/sbin/post-boot script):

    /usr/sbin/smbd -D
    /usr/sbin/nmbd -D

    Once you've rebooted your wl500g should appear in workgroup called WORKGROUP and present you a share named "share". This share is read-only view of your usb drive (/tmp/harddisk/). There is also second invisible share called "share$" which is in the fact the read/write view of /tmp/harddisk/. No other access restriction present.

    There are log files available for samba - /var/log/nmb and /var/log/smb, they could be examined if something does not work.
    from http://wl500g.dyndns.org/

Page 1 of 3 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 1.9.2.7-4 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 1.9.2.7-RC3
    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
  •