Page 3 of 4 FirstFirst 1234 LastLast
Results 31 to 45 of 57

Thread: [HowTo] Asus RT-N16 (Oleg) - optware the simple way

  1. #31
    Hello All,

    All I want to do with this router is setup my External HD to serve as a storage drive through this router.

    My external drive is made up of two 2TB drives running in Raid0. So the total storage is 4TB. I know I cannot setup NTFS as a 4TB partition with MBR, so I tried setting up one partition at 1.9TB with NTFS and MBR. Nothing. So I tried a 4TB NTFS partition with GPT. Still nothing. The router will mount and share my 8gb thumb drive, but not this drive.

    So I figured I would try another firmware and I flashed Oleg's firmware (RT-N16- and tried this tutorial. But here's what it says when I enter this code:for i in `cat /proc/mounts | awk '/tmp\/mnt/{print($1)}'`;do umount $i; done
    mkswap /dev/sda1 && swapon /dev/sda1
    mke2fs -j /dev/sda2
    mke2fs -j /dev/sda3

    says something like "can't open ' /dev/sda1': No such file or directory" and "can't stat ' /dev/sda1': No such file or directory"

    I'm at my wits end here. I just want to be able to connect my hard drive to serve as a storage server for my home network. Why the heck is this so difficult?
    Last edited by Choujij; 14-12-2010 at 02:52.

  2. #32
    This tutorial removes all existing partitions from your storage (in the first step) and creates (if the router correctly see your storage):
    1st partition: 256MB, swap
    2nd partition: 1GB, ext3 (/opt)
    3rd partition: the rest, ext3 (/mnt)

    Using of NTFS is not an option, especially for the system. It might work, but I've never tried and I'd not recommend it.

    So what you could do is creating the system using your thumb drive.
    When it has finished, format your storage via a PC to NTFS (if you prefer it over ext3).
    After that plug in your storage (the router has 2 USB ports) and hope that the router automounts it (then it will appear in /tmp/mnt/...) or you can mount it via commands.
    As in this case it's a second device you have to search for /dev/sdbx or /dev/discsc/discb/partx (where x is the partition number).

    But before going all this trouble you should make sure that the firmware sees your storage. This tutorial won't help if already the firmware fails to see your storage.

    As this requires some level of Linux knowledge, look someone who could help you locally if you're not confident with Linux.

    If there is no /dev/sdxy or /dev/discsc/discx/party (where x is device number, y is partition number) it means that the router does not see the device correctly.

    To share your storage with Samba does not require this tutorial. It should work with basic firmware. So if after flashing the firmware it does not see your partitions, there is a chance that it does not correctly recognize your drive. In that case you should ask help in e.g. the "New oleg firmware version" thread.

  3. #33

    First of all, the outcomes of this thread has provided me many months of rutorrent happiness with my RT-N16 router. I thank ecaddict for that.

    To expand on the capability of my RT-N16 I'm attempting to turn it into a server. Now it should be acknowledged that my linux experience is limited to what I've learnt in the last week. I'm running WinXP on all networked PCs and I map to the /mnt folder through network places.

    I've currently have two USB drives plugged in, a 2TB (sda) and a 1 TB (sdb) (the USB drives automatically loads in that configuration although I'd prefer the 1TB to be sda). Optware has been installed on sda as per the instuctions in post one (no problems). What I'm trying to do is mount sdb on a /mnt/media/movies directory. I'm not having much luck with this step.

    These are the steps I've taken within PuTTY and the outcomes:

    fdisk /dev/sdb (created one primary partition of type 83)
    mke2fs -j /dev/sdb1

    The fdisk -l output is:

    [admin@ASUS Router root]$ fdisk -l

    Disk /dev/mtdblock0: 0 MB, 262144 bytes
    255 heads, 63 sectors/track, 0 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes

    Disk /dev/mtdblock0 doesn't contain a valid partition table

    Disk /dev/sda: 2000.3 GB, 2000396746752 bytes
    255 heads, 63 sectors/track, 243201 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes

    Device Boot Start End Blocks Id System
    /dev/sda1 1 32 257008+ 82 Linux swap
    /dev/sda2 33 157 1004062+ 83 Linux
    /dev/sda3 158 243201 1952250930 83 Linux

    Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes
    255 heads, 63 sectors/track, 121601 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes

    Device Boot Start End Blocks Id System
    /dev/sdb1 1 121601 976760001 83 Linux
    mkdir -p /mnt/media/movies (creation of directory confirmed)
    vi /etc/fstab
    insert 'i' (add /dev/sdb1 /mnt/media/movies etx3 rw,noatime 1 1) :x
    mount -a

    The mount output is:

    [admin@ASUS Router root]$ mount
    rootfs on / type rootfs (rw)
    /dev/root on / type squashfs (ro)
    proc on /proc type proc (rw)
    sysfs on /sys type sysfs (rw)
    devfs on /dev type tmpfs (rw,noatime)
    devpts on /dev/pts type devpts (rw)
    tmpfs on /tmp type tmpfs (rw,noatime)
    usbfs on /proc/bus/usb type usbfs (rw)
    /dev/sda3 on /mnt type ext3 (rw,noatime,data=ordered)
    /dev/sda2 on /opt type ext3 (rw,noatime,data=ordered)
    /dev/discs/discb/part1 on /tmp/mnt/discb_1 type ext3 (rw,noatime,data=ordered)
    What am I doing wrong?

    In order of priority what I'd like to do is:

    1. mount sdb1 to /mnt/media/movies
    2. load optware on the 1TB (sdb)
    3. ultimately have sda3 and sdb1 in its own /media drive (e.g. /opt, /mnt and /media)

    Any help that can be provided would be much appreciated.

    Additional output that might be of use:

    [admin@ASUS Router root]$ df
    Filesystem Size Used Avail Use% Mounted on
    rootfs 5.2M 5.2M 0 100% /
    /dev/root 5.2M 5.2M 0 100% /
    devfs 62M 0 62M 0% /dev
    tmpfs 62M 216K 62M 1% /tmp
    /dev/sda3 1.8T 237M 1.7T 1% /mnt
    /dev/sda2 966M 295M 622M 33% /opt
    /dev/discs/discb/part1 244M 4.1M 227M 2% /tmp/mnt/discb_1
    Last edited by Pursuit250; 08-01-2011 at 02:58.

  4. #34
    I would suggest to do an ipkg upgrade after the ipkg update which is done at install as described in posting 1, otherwise one gets errors. For example Midnight commander needs it

  5. #35
    In order to get lighttpd working, I needed to change the following in /opt/etc/lighttpd/lighttpd.conf:

    # server.event-handler = "freebsd-kqueue" # needed on OS X


    server.event-handler = "select"

  6. #36
    Zussaweb is not included in the package one gets using this howto, but the Asus headstarts points to it.

    What I had to do:

    cd /opt/tmp
    cd /opt/share/www
    tar -xzvf /opt/tmp/zussaweb03.tar.gz

    and edit settings.php in /opt/share/www/zussaweb

  7. #37
    Quote Originally Posted by ecaddict View Post
    If you have just changed to Oleg firmware and have no real experience with Linux, this short tutorial may help. It re-uses the excellent Wengi tutorial and Raas image.
    Note: This is for RT-N16 or WL routers with 2.6 kernel.
    The Oleg firmware can be downloaded from here now:

    Later on:

    You'll need either USB stick or USB HDD (at least 2GB, but bigger is better).
    Note: Do not store any data on the disk as when you start the disk has to be re-partitioned and everything will be lost.
    Connect only the disk that will contain the system!

    Do not change user name from admin. Some programs rely on that.

    After connecting USB storage, first reboot the router.
    Wait for 1 min. after rebooting the router to detect the USB storage.

    telnet/PuTTY (you have to enable it in web interface) to your router username:admin, password what you use with web interface (change it from default!)

    copy the following lines as such (creates partition table)
    Note: all of your data in the stick/HDD will be lost
    echo -e "o\nn\np\n1\n\n+256M\nn\np\n2\n\n+1024M\nn\np\n3\n\n\nt\n1\n82\nw" > /tmp/parttbl
    fdisk /dev/sda < /tmp/parttbl
    echo "" > /etc/fstab
    flashfs save && flashfs commit && flashfs enable
    echo "Wait till reboot (terminal disconnect)"
    and paste it to the terminal (right click or what works with you mouse).
    Wait till the router reboots.

    Wait for 1 min. after rebooting the router to detect the USB storage.
    telnet/PuTTY again to the router
    copy the following lines as such and paste to the router (formats stick/HDD):
    for i in `cat /proc/mounts | awk '/tmp\/mnt/{print($1)}'`;do umount $i; done
    mkswap /dev/sda1 && swapon /dev/sda1
    mke2fs -j /dev/sda2
    mke2fs -j /dev/sda3
    You're now ready to install optware.
    Make sure that the router has a working internet connection (as image files are downloaded like Attachment 6579).
    You have to copy the following lines as such and paste to the terminal (telnet/PuTTY) you logged in to the router:

    cd /tmp && wget -O flashf.tar.gz "" && cd / && tar -xvzf /tmp/flashf.tar.gz
    chmod +x /usr/local/sbin/*
    flashfs save && flashfs commit && flashfs enable
    [ "`awk '/SwapTotal/{print($2)}' /proc/meminfo`" -eq 0 ] && mkswap /dev/sda1 && swapon /dev/sda1
    mount -o noatime -t ext3 /dev/sda2 /opt && mount -o noatime -t ext3 /dev/sda3 /mnt
    [ -n "`mount | sed -n '/\/opt/p'`" ] && [ -n "`mount | sed -n '/\/mnt/p'`" ] && cd /mnt && wget && cd / && tar -xvzf /mnt/opt.tar.gz && cd /opt && wget && cd / && tar -xvzf /opt/mnt.tar.gz
    ipkg update
    cd /mnt && wget && tar -xvzf rutorrent-3.0.tar.gz
    ipkg install readline && ln -s /opt/lib/ /opt/lib/
    [ -x /opt/etc/init.d/rc.unslung ] && /opt/etc/init.d/rc.unslung start
    Installation is completed in a few minutes.

    You can navigate to router's web interface, the best starting point is:
    username: admin
    password: asus
    Attachment 6305

    SWAT/Samba (file sharing, web like control)

    ADOS (http/ftp downloader, you may use fewgets as well, it's a bit simpler, N16 variant: Attachment 6570)
    You have to login second time to ADOS as well.
    username: admin
    password: logitech

    Transmission (torrent client)
    Simply put your torrent files in /mnt/protected/Downloaders/Transmission/source and download should start in the background.
    Note: transmission program is started by scheduler that runs in every 30 min so it may take some time before transmission starts.
    You may try also the Transmission remote GUI:

    If you prefer rtorrent over Transmission (like I do) you can install it via telnet/PuTTY:

    ipkg update
    ipkg install rtorrent gnuplot
    mkdir -p /opt/share/torrent/session
    mkdir -p /mnt/protected/Downloaders/rtorrent
    /bin/sed -i -e 's#/opt/bin/bash#/bin/sh#' -e 's#"root"#"admin"#' -e 's#test -x /opt/bin/su.*##' -e 's#su -c \"##' -e 's#\" ${user}##' /opt/etc/init.d/S99rtorrent
    cd /opt/etc && /bin/sed -i 's#/opt/share/torrent/work/#/mnt/protected/Downloaders/rtorrent/#' rtorrent.conf
    [ -z "`/bin/sed -n '/scgi_port =/p' rtorrent.conf`" ] && echo "scgi_port = localhost:5000" >> rtorrent.conf
    echo "schedule = log,180,180,\"execute=/opt/etc/rtorrlog,\$get_down_rate=,\$get_up_rate=\"" >> rtorrent.conf
    cd /opt/etc/lighttpd/ && [ ! -f lighttpd.conf.raas ] && cp lighttpd.conf lighttpd.conf.raas
    [ -z "`/bin/sed -n '/^[^#].*mod_scgi/p' lighttpd.conf`" ] && /bin/sed -i 's/"mod_fastcgi",/"mod_fastcgi",\n\t\t\t\t"mod_scgi",/' lighttpd.conf
    LIN1=`echo -e "\nscgi.server   = (\"/RPC2\" =>\n\t\t ( \"\" =>\n\t\t   (\n\t\t    \"host\" => \"\",\n\t\t    \"port\" => 5000,\n\t\t    \"check-local\" => \"disable\"\n\t\t   )\n\t\t )\n\t\t)"`
    LIN2=`echo -e "SERVER[\"socket\"] == \":443\" {\nssl.engine\t= \"enable\"\nssl.pemfile\t= \"/opt/etc/lighttpd/lighttpd.pem\"\nserver.document-root\t= \"/mnt/\"\n  auth.require = ( \"\" =>\n\t\t (\n\t\t  \"method\"  => \"digest\",\n\t\t  \"realm\"   => \"RT-N16\",\n\t\t  \"require\" => \"user=admin\"\n\t\t )\n\t\t)\n}"`
    [ -z "`/bin/sed -n '/":443"/p' lighttpd.conf`" ] && echo -e "$LIN1\n\n\$$LIN2" >> lighttpd.conf
    cd /mnt && wget -O fewgets.tar.gz "" && cd / && tar -xvzf /mnt/fewgets.tar.gz
    flashfs save && flashfs commit && flashfs enable
    /opt/etc/init.d/S80lighttpd restart
    /opt/etc/init.d/S99rtorrent start
    mkdir -p /mnt/protected/ewget
    /bin/ps | grep lighttpd
    You can use it with nTorrent (, however there is a nice web front end to it, named ruTorrent (
    Do not change lighttpd.conf any further until you're familiar with the system.
    ruTorrent web interface:
    From internet: https://<your public IP|dyndns host name>/rutorrent/


    Don't forget to change the web password in /opt/etc/lighttpd/.lighttpdpassword as the https port is also available from internet!

    Installing MediaTomb (optional):
    cd /opt/share/file && mv magic magic.old
    ipkg install readline mediatomb
    mkdir -p /opt/etc/mediatomb
    mkdir -p /usr/local/root/.mediatomb
    flashfs save && flashfs commit && flashfs enable
    /bin/sed -i 's/MT_USER="root"/MT_USER="admin"/' /opt/etc/mediatomb.conf
    /bin/sed -i 's/MT_ENABLE=false/MT_ENABLE=true/' /opt/etc/default/mediatomb
    cd /opt/share/mediatomb
    cat sqlite3.sql | sqlite3 mediatomb.db
    mv mediatomb.db /opt/etc/mediatomb/
    /opt/etc/init.d/S90mediatomb start
    /bin/ps | grep mediatomb
    MediaTomb web interface:

    You can learn more about MediaTomb:

    Replacing Samba2 with Samba3 (optional):
    killall smbd nmbd
    cd /opt/etc/samba && [ ! -f smb.conf.raas ] && cp smb.conf smb.conf.raas
    ipkg remove samba2 
    ipkg install samba samba3-swat
    sed -i 's/samba_active=0/samba_active=1/' /opt/etc/init.d/S08samba
    cd /mnt && wget -O smb.tar.gz "" && cd / && tar -xvzf /mnt/smb.tar.gz
    /opt/etc/init.d/S08samba start
    /bin/ps | grep smbd
    Attachment 6455

    A few notes:
    - Don't upgrade the packages unless you know what you're doing as it may replace the working .conf files (save /opt/etc before doing so)
    - If you install the latest lighttpd with ipkg install lighttpd you have to change in /opt/etc/lighttpd/lighttpd.conf server.event-handler to this:
    server.event-handler = "poll"
    - You may need to restrict the memory usage of rtorrent in /opt/etc/rtorrent.conf, e.g. to 64 MB:
    max_memory_usage = 67108864
    for other configuration options see

    If it works, enjoy. It worked for me, but there is no guaranty. I shall not be liable of anything if something goes wrong. Use it at your own risk.

    I followed the instructions on the WL520GU and since then my USB flash drive does not work, or if your PC does not see it, does not detect!
    Always something with it, please!
    It mail
    Thank you!
    Moreover, as I do not work ..

  8. #38
    hi where can Ifind setting of transmission deamon? I would like to access web interface of transmision at port 9091 but all I recive is: "403: Forbidden

    Unauthorized IP Address.

    Either disable the IP address whitelist or add your address to it.

    If you're editing settings.json, see the 'rpc-whitelist' and 'rpc-whitelist-enabled' entries.

    If you're still using ACLs, use a whitelist instead. See the transmission-daemon manpage for details."

  9. #39

    Scripts work also for 2.4 kernel routers as well now

    This post is just to announce the happy news that the scripts in the opening post have now been updated so that they work also with 2.4 kernel routers (WL500gPv1/v2, WL500W etc with non rt-n trx file) and installing the image created by Raas is easy for everyone now.

    (I don't know who the change the thread title to reflect this).
    While the basic install certainly works with 32MB routers, if you plan to install the additions (I've also updated recently) like rtorrent, mediatomb, transmission or openVPN 128MB router is highly recommended.
    I've tested the image install and it worked for me but if you have some issue please post it here. Even if I'm not able to help, maybe someone else can.

    Please don't quote the entire tutorial but rather the output of basic commands like:
    blkid (to show USB storage partitions)
    mount or df -h (to see mounted partitions)
    free (to see memory and if swap is used)
    ps or ps afx (to see running programs)
    ls -la /usr/local/sbin/ (ls -la to list the content of some directory)
    cat /usr/local/sbin/post-mount (cat is to show the content of some file)
    tail -n 20 /opt/var/log/syslog.log (to show the last 20 logs from syslog - sometimes messages)
    /opt/etc/init.d/S99rtorrent (to start some service in this case rtorrent)
    iptables-save -c (to see all of your firewall rules)
    dmesg (to see kernel issues)
    ifconfig (to see interfaces)
    nvram show | grep ifname (to see some nvram variable in this case interface names)
    robocfg show (to show switch/VLAN config and active ports)
    brctl show (to show bridge configurations)
    wl radio (to see if WiFi is enabled)

    Be careful with the last 4 commands as they allow changing essential parameters that can make you router unstable.
    Last edited by ecaddict; 22-11-2011 at 16:13. Reason: added iptables-save

  10. #40
    I just installed OLEG firmware from TomatoUSB.

    I was having a hard time setting up the USB HDD NFS and from google I came across this.

    I have a 500GB HDD and wish not to format it. Is there anyway to do your tutorials without formatting the HDD?

    I been using this HDD with TomatoUSB without needed to format.
    Thank you

  11. #41
    If you only need NFS sharing there is no need to format your HDD as the firmware alone can do the sharing there is no need to install any optware to the HDD.

    However you need to put what you'd like to share to /etc/exports
    My tutorial puts this (as it allows NFS sharing for the /opt and /mnt directories):
    # automagically generated from web settings
    As a first step plug in the HDD and check where it mounts with mount, e.g. I have a spare partition on my HDD that is automounted:
    /dev/sda4 on /tmp/mnt/disca_4 type ext4 (rw,noatime,barrier=1,data=writeback)

    So replace e.g. /mnt with what you'd like to share e.g. in my case it could be /tmp/mnt/disca_4

    E.g. put this to /etc/exports (of course you can have a better mountpoint with /etc/fstab):
    The /etc files are not saved to flash (so lost) after restart unless you indicate to the firmware what files to make persistent. This is done in
    So you have to put /etc/exports there.
    You can do it actually if you copy-paste this:
    cat > /usr/local/.files << __EOF__
    Than make everything persistent with
    flashfs save && flashfs commit && flashfs enable

    If you need optware then
    1. either you need a HDD/USB stick that has the following partitions:
    2. or adjust /etc/fstab
    Which by the tutorial (for 2.6 kernels!)
    #device         Mountpoint      FStype  Options         Dump    Pass#
    /dev/sda1       none            swap    sw              0       0
    /dev/sda3       /mnt            ext3    rw,noatime      1       1
    /dev/sda2       /opt            ext3    rw,noatime      1       1
    However you can easily swap e.g. /opt to be /dev/sda3 or as you like.

    Note: web interface may work as well, however I've never used the web interface...
    Last edited by ecaddict; 28-10-2011 at 14:27. Reason: added web interface note

  12. #42
    Thx OP for the fast reply..

    I am completely a Linux noob.

    I tired to run those code using PuTTY

    I get this after I enter this code:
    /mnt,insecure,all_squash,anonuid=0,anongid=0,sync )
    -sh: syntax error: unexpected "("

    btw how do I ctrl+c in PuTTY? After I get this working its seem cool to install optware

  13. #43
    Quote Originally Posted by Endless View Post
    I get this after I enter this code:
    /mnt,insecure,all_squash,anonuid=0,anongid=0,sync )
    -sh: syntax error: unexpected "("

    btw how do I ctrl+c in PuTTY? After I get this working its seem cool to install optware
    That's not a code that you run, but should be put to the file I wrote. Please read it carefully.
    By default also nothing is mounted below /mnt (unless set in /etc/fstab).

    In PuTTY you have to right click to the top of the window status bar and select mark (if I remember correctly), then drag while pushing left button.
    Maybe the best way would be to put some USB stick to the router temporary and install the basic optware (don't connect the HDD with full of data as it will be formatted!).

    But the best would be to learn some basic Linux or stick to the router's web interface for NFS sharing.
    I've created this tutorial in mind that you're willing to sacrifice the content of some HDD or USB stick and put optware. After this done, it's possible to fill the HDD via one of the sharings or connect a second HDD (with data) and e.g. link it to somewhere in the directory structure.
    Anyhow some basic IT knowledge would be needed even in this case or goole search. It's mission impossible to tell everything via posts.

  14. #44
    I try everything to look at what u wrote.
    I put those command in "NFS Server Exports" under the web interface.
    I am running windows xp
    In my network place I see 2 folder "sda1 on Asus RT-N16 (Asus)" and "share on Asus RT-N16 (Asus)" but cannon open them says "You might not have permission to use this network resource......."

  15. #45
    On the router (so via PuTTY) please check the output of the following commands:
    cat /etc/exports

    The cat should show something like this (except /mnt):
    Note: The end of the command is important (and I suspect you cannot configure it in the web interface) as XP cannot handle at all Linux GUD/UIDs.

    On XP please check the output of the following commands (after installing Windows Services for UNIX, free download from MS):
    showmount -e

    You should see something like this:
    showmount -e
    Exports list on
    /mnt All Machines
    You can mount the share with (note \mnt is what you've shared and the showmount shows)
    mount \\\mnt *

    You should see something like this:
    mount \\\mnt *
    K: is now successfully connected to \\\mnt

Page 3 of 4 FirstFirst 1234 LastLast

Similar Threads

  1. [Howto] Install DLNA media servers for Oleg firmware
    By ecaddict in forum WL-500gP Tutorials
    Replies: 18
    Last Post: 06-06-2017, 08:40
  2. Optware Entware Asus RT-N56U
    By Omega in forum Russian Discussion - РУССКИЙ (RU)
    Replies: 220
    Last Post: 06-02-2016, 11:53
  3. Replies: 24
    Last Post: 05-05-2015, 08:42
  4. Replies: 6
    Last Post: 21-09-2012, 18:06
  5. [Howto] Install kernel modules for Oleg firmware
    By ecaddict in forum WL-500gP Tutorials
    Replies: 0
    Last Post: 05-12-2011, 17:18

Tags for this Thread

Posting Permissions

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