[Announce] Jac2b Alternate Firmware for NAS200

Discussion in 'Cisco/Linksys Network Storage Devices' started by jac_goudsmit, Feb 1, 2009.

  1. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    This version is now obsolete.

    Please click here for the latest version


    Announcing Jac2b!
    Telnet, SSH Dropbear, Custom startup scripts, ability to update Twonky server.

    (Note, the text of this posting is mostly identical to the Jac2a posting, the difference is that custom scripts and power-off now work as advertised)

    Regardless of any text in this article or any other posts in this forum (or interpretation thereof), I will not take responsability for anything that happens with your NAS200 or any other hardware as a result of the use (or inability to use) this firmware. By initiating a download of any part of my firmware in any form, you acknowledge that you understand that this firmware was developed for my own use, that any support is based on "best effort" (which may vary depending on how busy I am in real life) and that there is no warranty of any kind, not even the warranty that your NAS200 or any other system on your network will keep working or can be restored to working order. If you disagree with this, or if it's illegal to limit my responsibility this way in your area, then you are hereby forbidden to download or use any of the files that I make available.

    The firmware is redistributed under the GPL License v2. Source code is available for free (gratis) download upon request (just send me an email to jac at goudsm dot it).

    I know I said I wasn't going to do this, but I decided that because NASi200 is progressing so slowly, I should spend some time on an update to the Jac0 firmware to add RAID support which is one of the most requested features. Actually I got some updated scripts from Lumpy_Skumbry for RAID support that started all this, so you should really thank him for this update.

    Lumpy_Skumbry kindly permitted me to release his changes as Jac1 which would have been Jac0 plus RAID support. But once Jac1 was almost finished, I realized it wouldn't take much work to port the changes to the R75 firmware and to improve support for updating the Twonky media server.

    So I decided to drop Jac1 and move on to Jac2 based on R75, but made a number of mistakes in the boot scripts that have been fixed in Jac2b.

    Features and changes
    The Jac2b firmware for NAS200 has the following features which are further explained below:
    • Telnet server (ported from Jac0)
    • Dropbear (ported from Jac0)
    • Kernel enhancements (ported from Jac0 and Linksys R75)
    • Based on Linksys firmware V3.4 R75, i.e. many bugfixes and full web GUI support for non-journaled (ext2) file system
    • Support for startup scripts in a way that's mostly backwards compatible with Jac0, however RAID configurations are now supported
    • Support for easy installation of updated Twonky media server (all you need to do is unpack it in the right location and reboot)
    • Fixes the bug that prevented Jac2 from booting in Separate Disk mode when 2 disks were present
    • Uses almost 100KB less memory than Jac2, R75, Jac0 and R62
    • Fixes the bug that prevented custom scripts from running in Jac2a
    • Fixes the problem that the unit was unable to turn off its own power in Jac2a

    This makes the Jac0, Jac2 and Jac2a firmware obsolete, but you can still refer to the Jac0 thread if you want to know what I did to build it. I attempted to make the Jac2b instructions a little more user-friendly than Jac0 although this is still not intended for those who have no Linux knowledge at all.

    Downloading and installing

    You can download the firmware here.

    File size is 8388608 bytes, MD5SUM is 413765e6ebc885e258b87dde15107157. If you want a copy of the source code, send me a PM.

    Use the Firmware Update page of the NAS200 web GUI to install it; you can always go back to R62, R75 or Jac0 by downloading and installing them the same way (but remember, once you format your disks in non-journaled mode there's no way back to R62 or Jac0!)

    If you previously installed Jac2 and ran into the bug that prevents it from starting with two disks in Separate Disk mode, simply remove the second hard disk while the unit is off, and start it up with just one disk for the duration of the update. With only one disk, the system will start up correctly and you can download Jac2b through the web interface without loss of data or configuration settings. After installing Jac2b, you can reinstall the second drive (again, while the power is off).

    SECURITY ALERT! After you install Jac2b, the telnet network port is enabled; anyone on your network who knows how to connect via Telnet will have full access to your NAS and your files. Unless you trust all the people who might ever be on your network, you should disable Telnet; see the next section for more information.

    The first time you restart the NAS200 after you first install Jac2b, the NAS200 will take more than 5 minutes before it comes online (unless your NAS200 previously had Jac2, Jac2a or Jac0 installed on it). This is because Dropbear has to generate encryption keys which takes a while. It stores the keys on the hard disk, so the next time it skips the process and the NAS200 will start normally again.

    If you are interested in additional filesystem modules, you can download them here. File size is 9848124, md5sum is c831b008b7fb220981c2b5e8ff63ed36. Note, these are just the kernel modules for extra filesystems (such as cifs, iso9660 and NFS), you can load them using the insmod command (modprobe won't work) but you will probably need more software to actually use these.

    The Telnet daemon is enabled by default, and no password is required to connect through telnet. This backdoor is necessary because you will need to set the root password before you can log in through SSH.
    The Admin password is not the same as the root password, and only Linksys knows the root password that gets set by the original firmware.

    The Telnet daemon uses the /dev/pts/* device nodes to get a terminal. The recommended method to disable Telnet is to log in through an SSH shell and move the /dev/pts directory (e.g. mv /dev/pts /dev/pts_offline). Then all you need to do to re-enable telnet is to re-create (or move back) the device nodes. You won't even have to restart the box to disable or enable Telnet this way. Of course you can also write a custom script to disable telnet automatically, see below for more information about custom scripts.

    A more permanent way to disable Telnet is to create a file no_telnetd in one of the config partitions on your system (e.g. you can enter the command touch /harddisk/volume_1/conf/no_telnetd from a Telnet or SSH prompt). Be careful, if you lose the root password (or you forgot to set it in the first place), you won't be able to log in through SSH to erase the file again; you'll have to use a custom script to do it or you'll have to use the web interface or the reset button to reset the user accounts...

    Dropbear SSH server (and client)
    SSH is a secure protocol that is (relatively) safe to expose to the Internet, unlike Telnet which you should never expose to the Internet. I used Gentoo to build Dropbear 0.49 in "multi" mode (the binary file is a copy of the dropbearmulti file in Jac0). It not only supports incoming SSH connections (on port 22) but it will also let you make outgoing SSH connections once you're logged in to the NAS200.

    Your NAS supports FTP for downloading and uploading files from and to the NAS200 (and an HTML interface for downloading only). However, due to limitations in the FTP protocol and in the implementations of most NAT routers, it is usually impossible or at least very difficult to get an FTP server such as the one on the NAS200 to work behind a NAT router/firewall; see e.g. here for an explanation. Furthermore, all data transfers including user ID and password are unencrypted with FTP and can easily be intercepted.

    Dropbear allows you to use the SCP protocol to securely download and upload files from and to the NAS200 over the Internet through an encrypted connection that uses just one port: port 22, the same as the one used for SSH login. All you have to do is configure your router to forward that port to your NAS200 and use a program such as WinSCP on the client side. In WinSCP (or any other file transfer program that supports SCP) you enter the address of your NAS200 (or if it's behind a NAT router, the Internet address of the router), use root as user ID and your root password (see next section) as password. Make sure you select the SCP protocol; other protocols such as SFTP are not supported.

    As mentioned before, Dropbear will generate the private encryption keys at startup and will store them on the configuration partition of the first hard disk, if they're not already there. This takes a few minutes and slows down the first boot after the install, but it only needs to be done once. It may be necessary to regenerate the keys if you change the host name, but I'm not sure about that.

    Changing the root password
    [Edit]In order to log in through SSH, you have to know the root password. Unfortunately, the root password that Linksys initialized your NAS with, is unknown to anyone outside Linksys. And when you upgrade to this firmware, the Linksys upgrade software will keep all the accounts including the root account. So, we need to set it in another way.

    [Edit]The telnet daemon is configured so that it doesn't require a user ID or password, so that we can get into the system without knowing the root password. Normally you would do this with the "passwd" command but this unfortunately is not enough: In the Linksys configuration, root's home directory is set to /root but this directory does not exist.

    [Edit]The Linksys software has a fallback passwd file which is used whenever for some reason all account information is lost, or when you reset all user accounts from the Web GUI. I changed the default passwd file so that it contains a valid home directory and shell for root; also I changed the default root password to "root" (without the quotes). That means the easiest way to change the root password to something that's known is to use the Web GUI. However this also resets all other accounts in the system.

    [Edit]To reset the root password to "root" without changing any other accounts, connect via Telnet and paste the following commands:

    # Enter following commands in Telnet to reset the root password to "root"
    egrep "^root:" /etc.default/passwd >/etc/x
    egrep -v "^root:" /etc/passwd >>/etc/x
    mv /etc/x /etc/passwd
    for x in /harddisk/volume_*/conf;do cp /etc/passwd $x;done
    # Don't forget to use the passwd command to change the password after this!
    # After you do that, remember to copy /etc/passwd to all conf partitions
    #   using the "for" command shown above, or your password won't survive reboot.
    [Edit]After this, you can use the passwd command in the telnet session to change the password to something else, but you have to remember to copy the /etc/passwd directory to all configuration partitions using the "for" command from the code block above. The /etc/passwd file is normally a symlink to the file on one of the configuration partitions, but the "passwd" command changes the /etc/passwd file to a regular file and doesn't update the backup copy, from where it is restored at the next system startup. In other words, if you don't copy /etc/passwd to your configuration partitions using the "for" command, your new password won't survive a reboot.

    Optional: Creating extra shell user ID's
    [Edit]You will not be able to log in under any other user ID except root. Not even "ourtelnetrescueuser" (which is one of the users in the /etc/passwd file) will work, because the home directory for that user doesn't exist. If you added any other users via the Web GUI, you won't be able to log in as any of them either: the web GUI deliberately puts an illegal shell string "/dev/null0" (for users without admin access) or "/dev/null1" (for users with admin access) in the /etc/passwd file. If you change the shell of an existing line, the user won't show up in the web GUI anymore.

    [Edit]If you want, you can add shell users manually: let's say you have one user "jac" and you want to create a shell login "jacssh" for that user so he can log in via SSH, you can use an editor to copy (duplicate) the "jac" line in /etc/passwd so that both users have the same password and user/group ID, but different home directories and shells.

    jacssh:ePnAcSrSyWpOtReDd:2000:501:Jac Goudsmit:/harddisk/volume_1/data:/bin/sh
    Again, remember to copy the /etc/passwd file to all conf partitions or your changes may not survive a reboot. (note, the encrypted password shown above is simply the words "encrypted" and "password" mangled up, they are not my real password in case you're wondering :) )

    Custom startup scripts
    During startup, the Jac2b firmware will search for any custom startup scripts in the rc.d directory on any of your harddisks. The filenames of the scripts have to match rc.* to be started. If you create a script file, make sure you use an editor that supports Unix style line endings (LF only) and start the scripts with "#!/bin/sh". The firmware will make the files executable (it will change the owner of all files to root and will change the access rights to 777) and will simply try to run all scripts in alphabetical order. Note that the 777 access rights allows anyone to modify the files so you may want to disable access to the "DISK 1" and/or "DISK 2" shares for people you don't trust. Alternatively you can change the locations where scripts are searched; more about this in a minute.

    If something goes wrong with any of your custom scripts, the startup shell will quit with an error message which you can't see unless you have a serial port console. When this happens, your NAS200 won't finish booting so you won't have access to it, not even to correct the problem. That would be bad. So there is a fail safe mechanism: before the Jac2b firmware starts running your startup scripts, it creates a file "failskip" in the rc.d directory, and after it runs your scripts it deletes this file again. If the file is found on the next startup, the firmware will skip all custom scripts under the assumption that something must have gone wrong that prevented the system from finishing the startup procedure. So if something goes wrong during execution of your scripts and the box doesn't come up after a while, simply unplug it, re-plug it and power up again to make it boot without executing your scripts. Note, it may take longer to boot because the file system may need to be checked (power and disk lights blink alternately).

    Besides these scripts that get started after the harddisks are mounted and the network is online, you can also create a script that gets run before the harddisks would normally get mounted. This script is called early.sh and can be stored in the configuration partition of any of your harddisks (this is different from Jac0 where the early.sh was also on the data partition -- this change was necessary to prevent data loss on RAID configurations). There is a fail safe mechanism for the early.sh script too; in that case the fail safe file is called earlyfail and is stored on the same partition as your early.sh. Because early.sh is on a configuration partition, you will have to copy or move it there by using shell commands via Telnet, SSH or the serial port. Make sure you know what you're doing! Normally you should not need early.sh.

    By default, all harddisks are searched for script directories (rc.d), but you can override this by editing the file scriptdirs.txt on the first configuration partition that can be found. If the Jac2a firmware can't find any file /harddisk/volume_*/conf/scriptdirs.txt file, it will create one and will fill it with the list of all directories "/harddisk/volume_*/data/rc.d" including the ones that aren't normally in use on your system. You can edit the scriptdirs.txt file to limit, expand or completely change the locations where scripts are searched. You can even make it empty to completely disable custom scripts. If you delete the scriptdirs.txt file, a new one will get generated on the next startup.

    The default of searching all harddisks means that, theoretically, startup scripts and updated Twonky servers can also be stored on USB devices that are plugged in at boot time (I didn't test this). If you don't want this, you may want to remove the /harddisk/volume_5/data and /harddisk/volume_6/data lines from the scriptdirs.txt file using vi.

    Installing an updated Twonky Media Server
    The Twonky Media Server in the standard Linksys firmware is not the latest version and is known to have problems e.g. with the XBox and PS/3. The Jac2b firmware allows you to download an updated server from the Twonky website and run it with the INI file that gets generated by the Linksys web GUI, or with your own INI file if it suits you.

    NOTE: any Twonky servers that you download from the TwonkyVision/PacketVideo website are covered by the license that is published on that website, not by the license that covers the Twonky that is included in the firmware. You are responsible for meeting the license requirements, which means that after 30 days you should pay TwonkyVision for a license, even though technically you already have one. As far as I know, the built-in Twonky is a special embedded-platform version that was built to run without license key so there is no license key in the on-board INI file or elsewhere and any updated Twonky servers that you download from the Internet won't find a legal license key unless you buy one.

    You can download the latest TwonkyVision server from this location. You need the X86 Linux version for manual installation.

    The Jac2b firmware will search for the first file that matches /harddisk/volume_*/data/rc.d/twonky*/twonkymediaserver as seen from a Telnet or SSH session, or DISK ?/rc.d/twonky*/twonkymediaserver as seen from a Samba or FTP session (by default -- any changes to the scriptdirs.txt file will also have an effect on the search for a Twonky update). This means you should create an rc.d directory in the root of your first hard disk, then create a subdirectory from there called anything that starts with "twonky" (e.g. "twonky50"), and unpack all files in the ZIP there. Make sure you retain the directory structure of the files in the zip file. This has been tested with Twonky 5.0 which is the latest version at the time of this writing.

    You can then use the Linksys web GUI to configure and control the Twonky server; the media server gets started when you enable it and click "Save". You will have to either modify the access rights via a shell, or reboot the NAS200 before you start the updated Twonky for the first time, otherwise the script won't find an executable and the built-in Twonky will get used instead of the one you installed. You can use "ps ax" in a shell to verify that twonkymediaserver is started from your directory, instead of /etc.

    By default, the web interface to the Twonky server on port 9000 is disabled. If you want to enable it, simply create a subdirectory and move all files from the zip file there, then create a script named twonkymediaserver that adds any required parameters. Note, because the killall command is used to stop the Twonky server, you have to move it without renaming it, and because the Twonky server expects all files to be in the directory from where it starts, you have to move all files. Use a Unix-compatible editor such as Notepad++ to create the script. Example:
    # Save this file as e.g. "\\NAS200\DISK 1\rc.d\twonky\twonkymediaserver"
    # after moving all files from the twonky zip file to a new subdirectoy "actual".
    # Make sure you use a Unix compatible editor such as Notepad++ to save
    # linefeed-only line endings.
    $(dirname "$0")/actual/twonkymediaserver $* -enableweb 2
    You can use the same method to override anything else that's in the INI file in /etc (which gets generated by the Linksys software every time it starts the Twonky server); you can even use the script to tell the server to use a different INI file from the one that gets passed to it by the Jac2b script.

    The TwonkyMedia server reduces the speed of the NAS200 significantly especially while it's scanning folders. You will be happy to know that Jac2b frees up about 100KB of memory compared to earlier releases, by symlinking instead of copying many files in the /etc directory.

    Tips, missing features, known issues and workarounds
    Regrettably, there still is no Torrent client, no NFS or RSync and no other features built in to this firmware (some of them are available elsewhere). I decided to go for a minimalist approach to keep changes to a minimum so that I could release this quickly and get back to the NASi200 project. I'm also considering porting the OpenWRT project to the NAS200.

    The previous version of the software didn't power off when it got shut down. This has now been fixed. The cause for this problem is difficult to pin down but was probably related to the sloppy way in which Linksys released the V34R75 source code: some closed-source modules were missing so that a build would appear to be successful but a download of such a build would brick your NAS, and I have a funny feeling that some of the open-source stuff that was included, doesn't match the sources they used.

    In the Linksys sources, the code that turns the power off is in the closed-source Set_Led program; however in the rc.halt script, that program doesn't get called until after /sbin/halt which is part of Busybox and calls the kernel, which never returns. I made a change to the reboot.c code in the kernel so that it properly resets and powers off the unit, and removed the reset code from Busybox (it's not needed there). Now the /etc/rc.d/rc.halt command, the shutdown button in the GUI and the power button work correctly to power off the NAS.

    I use WinSCP to upload and download files to and from the NAS200 via a secure connection. There are two problems with this: first of all, you will get a warning when it tries to get a list of groups; this is not supported on the NAS200. To eliminate the warning, enable Advanced Options, then select the Environment->SCP/Shell option and disable "lookup user groups".

    Secondly, when you navigate to a directory with large files with WinSCP, it will get confused because when the Busybox shell shows a directory listing on a hard disk that has one or more large files, it doesn't separate the group name from the file size (e.g. it shows "everyone12345678901") and WinSCP gets confused about that. You can work around this by using the vi editor on the NAS200 to edit the /etc/group file: simply rename the "everyone" group (501) to e.g. "all". I did this myself and encountered no problems.

    A nice feature of WinSCP is the built-in editor, which will let you edit scripts remotely without the need to download them -- it automatically downloads and uploads the file and properly translates to and from the Linux text format.

    [Edit]If WinSCP gives you a vague error about "skipping the login message" and recommends using Bash as shell, it means your login shell and/or home directory may not be set correctly in the /etc/passwd file. Use the instructions from the "Changing the root password" section above to change them.

    Although the Jac2b firmware may still not be what some people desire from a device such as the NAS200, it should be a great improvement for all users. The NASi200 project will eventually fill the gaps but that may take a while.

    Thanks again to Lumpy_Skumbry for your scripts and suggestions, and thanks again to everyone who contributed to the Jac0 firmware! And of course thanks to those who encountered the bugs in Jac2 and Jac2a and were patient for this fix.

  2. nick_1964

    nick_1964 Addicted to LI Member

    Thanks mate ( bedankt)

    Jac, onwijs bedankt man !
    (Thanks man ! )
    My new password for scp is still there and no telnet support (disabled it with the 2a firmware) so, it looks okay.
    And after pressing the power on/off for 5 seconds the unit start to switch off,take about 30 seconds ( think it has to kills some things) and restart nicely when pressed again.
    Works like a charm.
  3. nefiilim

    nefiilim Addicted to LI Member

    after firmware upgrade i see version R75 (not R75jac2b or other). it's a nice upgrade??
  4. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    I made no changes to the web pages so they work exactly as before and won't tell you that you're running Jac2b. I can't figure out how the web pages determine the version number and how I could change it, so the only way to tell is to Telnet to the box and run something like "uname -a". The date that the kernel was compiled will correspond to the date that the firmware was released.

  5. nick_1964

    nick_1964 Addicted to LI Member

    For me it was simple,before it won't shut off, after it did, so that tells me everything.
  6. rodrigocatarino

    rodrigocatarino Addicted to LI Member


    I am really in to this great firmware.
    My question is, i already have my nas200 working with the original linksys firmware R75, with also a lot of files stored.
    If i update to this new firmware will i loose any files, user accounts or settings?


  7. nick_1964

    nick_1964 Addicted to LI Member

    Everything stays the way it is ! I had the same,but no reformat,all the user accounts are there,back online in 5 minutes and working.
  8. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    What he said :wink:

    The update should go very smoothly, no changes are made to your configuration. And if you decide you want to go back to plain R75, you can, without losing any files and without configuration changes.

    Of course I do recommend backing up all your files and downloading your configuration via the web GUI, in case something DOES go wrong. Murphy's law and stuff...

  9. rodrigocatarino

    rodrigocatarino Addicted to LI Member


    I have done the update, have changed the ssh root password and disabled the telnet access.
    Have installed Winscp and configured it to access files on the NAS200, it asks me the root password and when i type in i get this message:

    "Error skipping startup message. Your shell is probably incompatible with the application (BASH is recommended)."

    What am i doing wrong?


  10. nick_1964

    nick_1964 Addicted to LI Member

    You login with username root and your pass ?
    Have you rebooted your device ?
    Do you have set the winscp to SCP and not SFTP ?
  11. rodrigocatarino

    rodrigocatarino Addicted to LI Member

    Yes, i do try to login with my root user and pass.
    no, i havent rebooted the device...:eek:
    and yes, i have configured the winscp to use scp...
  12. rodrigocatarino

    rodrigocatarino Addicted to LI Member


    I have rebooted my device, but now it is very very slow...
    The web GUI is also very slow, the telnet sesssion logs in but is not reponding...
    When i ping the NAS it responds...

    Is this normal?


  13. nick_1964

    nick_1964 Addicted to LI Member

    If you rebooted with the reboot command it must be up fast, if it's the first time then bearshare has to build some keys and that can take a while, it is all described in the start post.
    If you simply put the reset button then it takes some time,twonkey must rebuild the index and if you just pull the plug it does a scandisc.
    Carefully read the startpost again and look if you take all the steps, I don't think so because the reboot is also part of the process.
    If telnet responds then you did make some mistakes,please read the startpost carefully again.
  14. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    Nothing. The only shell available on NAS200 is "ash" (part of busybox), not bash. You may be able to get rid of the error message by changing an advanced setting but either way, it's safe to ignore.

  15. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    Nick_1964 already kinda answered this. Basically, if you enabled the media server it has to rebuild the index which takes time and slows the system down considerably. A disk scan will also slow it down but during a disk scan you won't even be able to access the box over the network.

    If telnet opens the connection but doesn't answer, be patient; I've seen it take over a minute to answer when I had Twonky 5 reindex the database. If you want, you can type ahead, try "ps ax" to find out what's running...

    Remember this is basically a 486 PC at 100MHz. I had a computer that was faster than that 10 years ago...


    PS I assume here that you waited for the double-beep at the end of the startup. Before the single-beep, nothing runs; after the single-beep and before the double-beep, lots of housekeeping takes place and not all services may be online yet. Also, as Nick pointed out, the first time you restart your NAS, it takes a looooong time to boot because dropbear has to generate encryption keys (between the single-beep and double-beep) which takes a few minutes extra.
  16. adama

    adama Addicted to LI Member

    Upgraded from Jac2a without a hitch!

    All users and configurations remain intact. Rsyncd, which I had running from early.sh is now running from data/rc.d/rc.rsyncd (I deleted early.sh). Ssh configuration is all good including rsa host key, root password and dsa authentication. Telnetd remains disabled (via no_telnetd). Awesome!

    Thanks again Jac for this excellent firmware!
  17. rodrigocatarino

    rodrigocatarino Addicted to LI Member

    Hi all,

    Thanks in advance for all the help and info.

    Yesterday night, i went near my nas200, after a reboot via telnet (when things started very slowly), and the only light that were lit was the "network" all other status lights were off. This was quite strange for me.
    I tryed then access to it via web and telnet and no response.
    I have unplug the power cord, removed the drive, and power back on with no drive. Have waited for the bip and double bip, and the access via web and telnet was perfect.
    Then i thought, will upload the linksys original firmware and hope that it works again.
    Uploaded the firmware, rebooted, have shutdown the box via push button, have installed again the drive, and left it doing a disk scan...

    Today, more than 12 hours have passed and now the NAS does not respond to ping and i cannot access it via web gui... no telnet offcourse because it has the original firmware...

    Do i have to send it back to linksys? How can i access my files without the NAS? Can i put the drive on my pc and get the files?


  18. alejandro_liu

    alejandro_liu Addicted to LI Member

    Don't know if you have to send it back to Linksys, but you can still access your files if you have Linux PC (Or get a Live Linux CD). Just insert the HD into your PC and boot into Linux.

    If you are downloading a Live Linux CD, make sure you get one that supports xfs filesystems.
  19. nick_1964

    nick_1964 Addicted to LI Member

    Let it on, and don't touch it.
    With the new firmware it does not power off the right way.
    So when it powers of,when powered back again it performs a forced scandisk and during scandisk the system does not respond to anything.
    That can take up to 35 hours :mad: and longer with two disks.
    The only way to access files on the disk is to take it out and start your computer with linux like Alejandro says or with a convertion tool like partition magic. (but once converted you can't put it back in to the linksys,the drive has to be reformatted.)
    If you put it back untouched, the scandisk starts again from zero.
    For me, I hope there will be a way to overclock the processor like the old slug, since this is the slowest nas I have ever seen.
    I have another now, a D-link that is up to 20 times faster with gigabit.
  20. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    If the hard disk lights stay off, it means that for some reason the hard disk wasn't recognized during startup. Maybe the disks got too hot inside the case? Poor heat management is a known problem of the NAS200, I recommend using drives that are known to run cool. I use a Western Digital Caviar Green 1TB which runs at lower RPM and stays a lot cooler than my Seagate 500GB. In my experience, Maxtors always seem to run the hottest, and Seagate are in a close second (worst) place. Western Digital seems to always run a little quieter and cooler even with 7200RPM drives, and the Caviar Green runs even quieter and cooler because the disk spins slower. By the way, I did some Dremeling on my case a while ago and put a larger fan in, see http://www.goudsm.it/nas200/fanmod2.jpg.

    Make sure that, whenever you reboot the NAS200 from the command line (Telnet as well as SSH), you always use the /etc/rc.d/rc.reboot and /etc/rc.d/rc.halt scripts; don't just type "reboot" or "halt". The reason for this is that the NAS200 doesn't run a full version of the Init program which normally takes care of running scripts at shutdown time. If you type "reboot" or "halt", the file systems won't get synchronized and you will have to run a disk check; you may even lose data.

    Without drives, the box will boot up just fine but functionality is limited of course.

    How large is your disk? Disk scans can take really, really long on the NAS200 if your disks are large. I just did a scan this weekend and my 1TB drive took many hours (I didn't wait for it so I'm not sure how long). While the scan is going on, the disk lights and power light should blink and of course you have no access to the disk via the network. The web interface will work really, really slow because the disk scan is using all the memory.

    I'm not sure yet if it's broken; if it's still under warranty and is showing flaky behaviour e.g. it spontaneously stops responding or it doesn't recognize the disks, you should definitely talk to Linksys customer support to find out if you can return it (make sure the original R75 firmware is installed when you do that - they will probably blame my firmware for any problems as much as they can).

  21. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    The Jac2b firmware fixes the problem in Jac2a and earlier where the unit wouldn't shut down if it was told to by pushing the power button, using the web GUI or using the correct script. Of course, if you don't run the right script to shut down or reboot (see previous post), you're asking for trouble.

    You can disable automatic disk checking from the web interface. If automatic scanning is off and the disks weren't properly unmounted when the unit starts, it will simply try to mount them anyway. Of course if it fails to mount the disks because the file system is bad, you have a problem. The automatic disk check enable/disable option appeared in firmware version 75 but I don't remember if it's enabled or disabled by default.

    What he said. :grin:

    However, if you had your disks in JBOD or RAID configuration, recovery will require a serious amount of Linux knowledge. I recommend using Separate Disks mode for that reason and a few other reasons. http://www.smallnetbuilder.com/content/view/30060/230/

    If you formatted your disks in non-journalled mode, you may also be able to recover the data from Windows by installing the Ext2IFS software.

    Right. While you have it connected to a PC, you should run the disk check there and unmount it cleanly to prevent the NAS200 from doing the scan at the next startup.

    The NAS200 supposedly runs at 133MHz but there are indications that it may be underclocked: the Bogomips reading is too low for a 133MHz 80486 (it kinda looks like it's running at 100MHz) but of course this is really a RISC processor emulating a 486. There is documentation from RDC that shows how to configure it to run it at 150MHz but I haven't looked at the hardware closely enough (yet) to verify what the actual configuration is, or if it's possible to change it. The problem is that the clock speed is configured by setting a few pins "high" or "low" while the reset input gets activated; during normal operation these pins are used for different purposes so it's not as easy as soldering a jumper or something.

    I hear good things about the D-Links and I might have bought it if I would have known when I picked up the NAS200. Too bad the sales of the NAS200 mostly seem to be the result of the NSLU2's good reputation. I might have returned my NAS200 if it wouldn't have been for the easy hackability...

  22. nick_1964

    nick_1964 Addicted to LI Member

    I keep the linksys nas, witch for some strange reason go's from 144 euro to 159 euro, I have no problems with your firmware but I think a lot of people skip some parts of your explaination like the reboot command.
    Or the copy passwords part,or don't shut it down correctly.
    You can put the scandisk off, but it will force scandisk when improper shutdown.
    You can't simply just pull out the plug, plug it in back and aspect that it starts running without loosing a file.
    I have 2, 1 TB samsung disks inside, and a scandisk ( power fail in the whole street) tooks me more then 35 hours each disk !!! so I really hope it will be possible to overclock it, also the 4 mbits datatransfer is awful.
    For me it's simple, I keep it for streaming video, there is 2 terrabyte with series on it, all the seasons of csi,csi new york,House,Heroes,you name it... but I don't use it for frequent filetransfers, I don't know why Linksys, such a good company with solid good working routers,has brought this machine on the market with so much limitations.
    Your firmware makes it a bit faster and you have done such good work,but Linksys hast lost my respect for this nas,better call it a snas, snale or slow nas :rolleyes:
    Hope there will be a hardware hack soon (if possible).
    Ever put a USB drive to it's external ports and remove it again, 3 weeks later the NAS still thinks it's there !
  23. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    I know, I've been thinking I should do something to allow people to just glance at the posting, download it, install it and go. Add some pictures perhaps. Add a web page to the firmware to change the root password and disable telnet.

    You're supposed to push the button and wait for the beeps first...

  24. rodrigocatarino

    rodrigocatarino Addicted to LI Member


    Thanks again for all the help.

    I have a 1TB drive, i am not sure but i think it is Maxtor.

    Yesterday night (more than 24hrs have passed) i have checked my NAS and now it has both disk lights on (fixed). It doesnt seem to be doing anything...
    I will wait til tomorow and have another try, otherwise i will install a new drive, format it and check if everything goes well.
    Will also try to access my files, installing the current NAS drive on my pc.

    Is there any other diags that i can perform to know it my NAS is working well?


  25. nick_1964

    nick_1964 Addicted to LI Member

    Do you still have menu access ?
    Is the IP maybe changed somehow ?
    If not, try to install a small harddisk as the first one and see if everything comes up and then insert the "old disk" as a second one ?
  26. rodrigocatarino

    rodrigocatarino Addicted to LI Member


    The IP is the same, i can ping the NAS and it responds.
    I cannot access WEB GUI...
    Thats what i will try to do, will try with a smaller sata drive.

  27. nick_1964

    nick_1964 Addicted to LI Member

    It is important to find out, is the NAS defective or the Disk.
    I think,my humble opinion,there is something wrong with the disk.
    Did the upgrade to the old firmware went wrong.. try to telnet to it,maybe if it answers there is the old firmware still in the background ( sorry for my bad english,I'm Dutch have never had english lessons) also I don't know if the nas uses the disk as a part of the startup procedure.
    If it's starts on a small disk,maybe you can access the other disk.
    There are some utils that can access files and disk that are formatted by linux under windows.
    If you know which format it uses it maybe can also backup the files.
    If you can access the disk you can always buy a cheap housing to use it as a usb backup disk.

    What I would do:
    Take out every drive.
    What does the nas do,if it's responding and the web gui is there, I would retry loading the old original firmware,maybe something went wrong.
    And I would disable the mediaserver and scandisk options, not needed to test and it would slow down the whole procedure.
    Then I would use a small empty harddisk (always handy to use it in a usb casing).
    Does that work,then I would add the second one (the original harddisk) .
    If it works then maybe you can access your files and backup them.

    Some strange behaviour I had:
    I have it twice that the second disk is not recognized.
    It says it was unformatted,while there are some files on it.
    (so the unformatted message from the nas was not true)
    There was not so much on it, so I pressed the format button but then the system responded after several minutes: "format fails."
    (oh no.. what now...:mad:)
    But when I restarted the nas, the second disk was back,with all the files on it !!
    What it was doing the several minutes that it says it was formatting the disk, I don't know,but it was not really formatting,if it was, then the data would be destroyed but it was all there again !

    For other people, would a usb hub work so I can put more harddisks on it ?
  28. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    There are no Maxtor drives that are 1TB as far as I know. Seagate (who owns the Maxtor brand) only releases their large size disks under the Seagate brand. Other possible brands for a 1TB 3.5" drive are Hitachi, Samsung or Western Digital.

    If it's a Seagate, it's possible that you caught one of those Seagate drives that's reported to have trouble. Check out this page to see if your hard disk is affected by this problem (which I'm sure is costing Seagate a lot of customers right now). If so, you will have to connect it to a PC and update the firmware on the disk drive, updating the disk drive firmware cannot be done while it's in the NAS.

    If all lights are on (not blinking) it means the disk scan has finished and the unit should work normally. On the disk utility(?) page there is a button that shows the log, there you can see if the scan was successful. Of course if you can't get to the web interface, you won't be able to see it...

    If for some reason the web server died, you can turn the unit off by using the power button on the back (it will beep and the power light starts blinking, and after a few seconds it will turn itself off). Then turn it back on again, wait for the double beep and try the web page again.

    If you still can't get to the web interface after restarting the unit, you can try to push and hold the reset button with a paperclip, toothpick or whatever. After you hold it for a few seconds, the NAS beeps and the configuration gets reset (at least partially). This should also turn the Web GUI back to the default port 80.

  29. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    The configuration partition is used to store part of the configuration e.g. shared directories. However even if the disk is broken the web interface should still be accessible, after all it still has to be possible to insert a disk with garbage and still get to the web interface to format it. Even without a disk, the unit will still start, but some functionality will simply not work. The web interface will work fine.

    So, if you take all drives out of the NAS and start it up, you should be able to get to the web interface. If not, then something is wrong with the computer that you're browsing from.

    The NAS200 uses XFS in journaled mode and ext2 in non-journaled mode. The ext2ifs program lets you access ext2 partitions from Windows but there's no such thing for the xfs file system as far as I know.

    I don't think so, but I admit I haven't tried it. I think the kernel simply doesn't support USB hubs. This shouldn't be hard to fix, though...

  30. Johannes Grimmerink

    Johannes Grimmerink Addicted to LI Member

    Hi Jac,

    Your jac2b firmware is perfect. Everything works.
    It looks like it runs a little bit faster also.
    Thanks a lot!
  31. matilus

    matilus Guest

    Good job

    Hi Jac,
    Thanks for this good job.

    I have a question : How can i compile a other program to be executable by this firmware ? It's easy or not ?

    i want to run wizd server to replace twonky. how can i compile the server program ?

    Best regards.

  32. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    To all who have thanked me: You are welcome. (I don't usuallly reply to simple thank-you notes but seeing your reactions keeps me motivated on making further improvements!)

    This is probably the most difficult question for me to answer.

    In theory, it's not that difficult to get a program compiled for the NAS200: after all, the NAS200's motherboard is no more than a 486 PC. If you have a gcc compiler that generates i386 code (and many Linux distros have one of those), you can compile programs.

    However, that's not the entire story.

    For most open-source software, the instructions probably tell you to start by running the ./configure script. That will work, but it will configure the build system to compile and link the source so it can run on your computer, not for the NAS200.

    Linksys provides a complete cross-compilation toolchain which includes a GCC that compiles the sources for the NAS200. In theory I think it's possible to use a long list of parameters to the ./configure script to generate build scripts that will use the Linksys-provided compiler. I have to say I never had the energy or the time to figure this out, and the Linksys engineers must have had the same problem: the configure script generates Makefile files but all of the Makefiles in the Linksys source tree have been modified to simply include a file that overrides the compiler (CC) and other options. This is a quick and dirty way to make a program compile and install correctly.(*)

    Another problem is that most programs depend on other programs or libraries to be present. So you have to read the program's documentation carefully and find out what else you need to install.

    And finally there are some practical problems of course: you can't write to the read-only file system so your program has to live on the hard disk (there's not that much space in the flash ROM anyway so maybe your program wouldn't even fit). The libraries your program needs may also not be on the box so you may have to write a script to run the program with an LD_LIBRARY_PATH override.

    I use Gentoo on my Linux PC's and virtual PC's. The way I got some programs to compile correctly was to use the TinyGentoo page to build a chroot directory in which I could compile programs for the 386. In theory, it should be possible to follow the instructions when your Linux machine runs a different distro e.g. Ubuntu or Redhat, because you're basically installing a Gentoo inside whatever you're running.

    You don't have to follow all the TinyGentoo instructions because you only need the first chroot (which would normally be used for building the second chroot which you don't need). Once you have the first chroot populated, you can go into it and do e.g. ROOT=/target emerge mynewtool. Emerge will build not only the program but also all of the dependencies, and will put them in the /target directory, even when that directory is empty.

    You can then copy the binaries and configuration files from the /target directory to the NAS and use them there, but success is not 100% guaranteed: sometimes even if the program builds correctly, it won't run by itself, and that's when the troubleshooting starts. I was able to compile Dropbear 0.49 this way (and made it part of Jac0, now upgraded to Jac2b) but for some reason I couldn't get Dropbear 0.50 to work. Also, I still had to make some changes to the NAS200 filesystem because it doesn't use udev or pts. Furthermore I had to carefully set my USE flags to make Dropbear compile with classic Linux terminal support to make it work.

    So, in conclusion, there are at least three ways to compile a program for the NAS200:
    • Use the correct parameters when running ./configure, to let the Makefiles use the Linksys toolchain
    • Unpack the source code in the Linksys source tree and modify the Makefiles manually (by including the correct .mk files, using other Linksys-modified Makefiles as example)
    • Using TinyGentoo or a similar method

    I'm currently also looking into more-or-less automated cross-compiling environments such as Buildroot, OpenWRT and OpenEmbedded. The advantage of using one of those is that the NAS200 would be supported by an existing community that has already done a lot of work towards stabilizing kernels, root file systems and generally getting people together who have a lot of experience in embedded software. The disadvantage is that each of those options will break compatibility with the Linksys code, i.e. once you'd install one of them, you could not easily go back to the Linksys standard firmware without losing data and there would not be a Linksys web interface. And this I think is one of the strong attractions of my Jac2b firmware...


    (*) Unfortunately the way the Linksys engineers modified the Makefiles is also the biggest show stopper for my NASi200 project: Some Makefiles were written in such a way that they re-run the configure script to rewrite themselves, when Make detects that the Makefile is older than the configure script. This is fine while all sources reside on one computer or when they are packed up in a tar.gz with correct timestamps; however when stored in a source control system like SVN (which is in use by NASi200), there is no guarantee about timestamps because the files are all timestamped to the check-out time, so in some cases which are difficult to detect, the source gets compiled in a different way (or not compiled at all!) and you'll never notice it.
  33. fhguarni

    fhguarni Addicted to LI Member

    RSA keys


    I want to use rsa keys..but I don't know how. Can you help me please?

    I don't want to use samba, how can I disable it?

    Thanks :smile:
  34. MrBreaker

    MrBreaker Addicted to LI Member

    Help on connecting via SSH


    I have installed the "Jac2b" firmware.

    But when I follow the procedure about connecting to the NAS200 via ssh I'm in trouble.

    When I connect via putty, putty just closes after a successful login.

    And via WinSCP I have this message "Fout tijdens het overslaan van het opstartbericht. Uw shell is mogelijk niet compatibel met de toepassing (BASH wordt aangeraden).".

    I noticed that the procedure has changed if you look at the installing procedure of the "Jac0" firmware. But when I follow that instructions I also can't get it to work.

    Can anyone provide help??
  35. Poulpi06

    Poulpi06 Addicted to LI Member

    i flash my Nas200 with your firm since the Jac0

    it's great firmware for my product

    i'm ready for NasI200, good job, continue in this way,

    thanks Jac :thumbup:
  36. nick_1964

    nick_1964 Addicted to LI Member

    Has nothing to do with jac's firmware but I added on one of the usb ports of it a 750 gig disk.
    We are now 24 hours later and still the nas isn't ready with it.
    Why does Linksys build a rolce royce on the chassis with a motor of a Trabant ? (old east-german car ).
    Terrible.. I like the firmware but I get rid of that nas as soon as possible :(
  37. MrBreaker

    MrBreaker Addicted to LI Member


    After dinner "viel het kwartje" you still have to perform the the copy operation stated in the instructions of the "Jac0" firmware "Copy the modified /etc/passwd to /harddisk/volume_1/conf . Then reboot with the command: /etc/rc.d/rc.reboot. Don't use "reboot", you may destroy data! It's necessary to copy the file to the configuration partition of harddisk 1 because the /etc directory is a RAM filesystem. The file will be copied back from the harddisk to /etc as part of the boot process."

    My problem was that the "conf" was on "volume_3". So after "cp /etc/passwd /harddisk/volume_3/conf/" and a reboot it worked like a charm!
  38. roel_10

    roel_10 Guest

    Hi Jac,

    Good discussion for the three ways to compile a program for the NAS200. I am learning them now. Perhaps an idea to post somewhere a tutorial for people learning this.

    Now to the point, I am testing the TinyGentoo method, can you post your make.conf? To see which flags you have set. At the moment I did a test to compile a new tool. It results in so much directories in "/target" that I cannot believe my make.conf is correct.

    And second, what are the correct parameters for ./configure to let the Makefiles use the linksys toolchain? In the linksys source I also don't see a configure file.
  39. rodrigocatarino

    rodrigocatarino Addicted to LI Member

    Hi all,

    I have installed a 120GB drive on my nas and it is working as it should be.
    My current firmware is the R75 from linksys.
    I have then installed my "old" 1TB drive as second drive and i have access to my files again!
    I will put my 1TB drive back as first drive and check if i still have access to my files...

    I will let you know how it went!

    Jac: on my newbie opinion you could do a "Manual/how-to for dummies" (like me :) ) to explain how to use and setup your firmware!
    I know that your first post has a lot of info...

    Best regards,

  40. MrBreaker

    MrBreaker Addicted to LI Member


    Can you rename "halt, reboot & shutdown" so it won't be possible to destroy your data by typing in these commands?

    This because I know that one will use these commands as a habit when they are not sane at that moment (e.g. 03:00 a clock) ;-)
  41. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    I'm not sure if I understand your question. Dropbear already uses RSA private keys...

    The easiest way to disable Samba sharing is to give no access to any directories to anyone...

    The next easiest way is to run a script from rc.d that does a killall smbd, followed by a killall nmbd. Of course that only stops Samba after it's already started for a little while.

    To prevent Samba from starting altogether you could write an early.sh script that deletes the /etc/rc.d symlink, then copies the /etc.links directory to RAM disk (like the original firmware does), then replaces the rc.samba script with something else. Something like the following (not tested):
    # /harddisk/volume_1/conf/early.sh
    # The following line copies removes the rc.d link and copies the directory
    # like the original firmware does. This uses about 100k of RAM but makes it
    # easier to modify existing scripts...
    rm /etc/rc.d && cp -a /etc.links/rc.d /etc
    # Disable samba by replacing the script
    echo "#!/bin/sh" >etc/rc.d/rc.samba && chmod +x /etc/rc.d/rc.samba
  42. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    Sorry, no idea on how to fix these.

    I don't know why WinSCP gives you the "error skipping startup message" error, but there is no Bash on the NAS200, only /bin/sh and /bin/ash (Busybox contains the ash shell).

    I use WinSCP 4.1.8 build 415 and I dont get the error...

  43. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    Hmmm... on my box (with two drives in separate-disk mode), /etc/passwd is a symlink to /harddisk/volume_1/conf/passwd, so I thought it wouldn't be necessary to do the copy. When I wrote the Jac2b instructions, I didn't need to change my root password anymore because I had already done it a long time ago and an update to Jac2b doesn't change the password.

    However when I tried changing the password a minute ago I noticed that the passwd command breaks the symlink and the /etc/passwd file is rewritten. The /harddisk/volume_1/conf/passwd file is not modified by the passwd command. Thanks for pointing this out, I will change the instructions.

  44. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    I'm in the fortunate position of having a busy steady job which takes away almost all my time. The few hours of spare time I have left, I'm currently spending on looking into distros such as BuildRoot, OpenWRT or OpenEmbedded. I'm considering restarting the NASi200 project based on one of those three. Basing the NASi200 project on the Linksys firmware is turning out to be a problem because the Linksys engineers modified the build system of the individual projects in such a way that they don't reliably rebuild from scratch unless the timestamps are correct.

    My TinyGentoo setup is on another machine that I don't have in use anymore. I don't remember what I put in my make.conf but I'm sure it's not much. I remember that when I built the few projects that I compiled for the NAS200 I simply did an ROOT=/myproject emerge -av project to see what was going to be built. If too much stuff was being pulled in as dependencies, I would use a command line like ROOT=/myproject USE="-thispackage +otherpackage" emerge -av project until I adjusted the build just the way I wanted it. You'll just have to do some tweaking but even if you can get it to build, it's not certain that it will run on the NAS200 because the libraries are not necessarily the same as what goes into TinyGentoo.

    If I knew that, I would tell you :)

    Unfortunately most of my work is Windows programming and although I've done some Unix, Solaris, BeOS and Linux programming, and I know how to read and write a Makefile and put a Linux system together (embedded or not) by building its components (like Linux From Scratch), unfortunately I don't have much experience with the Autoconfig tools so I can't help you with this one. As a matter of fact, if anyone knows the answer to this question, it would really help with the work on the NASi200 project...

    The configure files are in the main directories for each project.

  45. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    I'm sorry... Some Linux knowledge is required to use this firmware -- after all, the main object is to add a shell and shell scripts. If you don't know how to use a shell, this firmware is not going to give you any benefits and if you do, you don't need a guide...

    Sorry if it sounds blunt... By the way I don't think you're that much of a dummy :)

  46. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    I've been thinking of how to fix the problem. It's not difficult really, just replace the symlinks that point to busybox to point to the appropriate scripts and putting "busybox shutdown" instead of "shutdown" etc. in the appropriate scripts. That will be one for next time. Meanwhile, you'll just have to remember. Or put up with the disk checks...

  47. nick_1964

    nick_1964 Addicted to LI Member

    I use the same version,never seen this error.
    I give up to use the external usb ports to put a 750 gig external drive on it,it makes it so slow that streaming video is like tetris for adults.
    So I fill the internal harddisks ( 1,5 TB is now filled, 500 GB to go) and then leave the linksys where it is.
    I hope that when I buy a second d-link nas (sold out temporaly), also based on linux, it can read the drives.
    If so,I dump the linksys in the garbage bag or stripe it to use the components.. don't think I can use much of them ;)
    Jac, you do a great job, but I think the Linksys isn't worth it, it's just to slow!
  48. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    I'm thinking of switching to the D-link as well and keeping the NAS200 for hacking. Even though I have so little time for it, it's still fun to do.

    Maybe when I get tired of it, I'll give it a brain transplant e.g. put a Via Pico motherboard in it, running FreeNAS or something. I'm definitely not going to trash it!

  49. nick_1964

    nick_1964 Addicted to LI Member

    Even the Lacie online storage with 1 TB drive in it is faster (gigabit connection), at the front there is a USB host,there is now a USB hub on it with 3, 1 TB removable harddisks on it. (sata samsungs with sweex casings)
    I can acces each usb drive and the internal one at 6 mb where linksys stops at 4 MB and can't even work with one removable disk at the usb connection.
    I wish I had read about the linksys before I went to the shop..it seems that the processor is driven by a 30 year old hampster in a tredmill :biggrin:
    Your firmware makes the internal drives and performance faster,but the usb port's on the back can best be used to connect a nice bulb to it,or a coffee cup warmer,but no external HD !
    Maybe you can find out why, or is it just the hampster that can't run 2 disks ?
  50. MrBreaker

    MrBreaker Addicted to LI Member

    This error is given when you connect via SSH to the NAS the first time after the firmware update (coming from original linksys firmware) and you just changed the password for root, but you haven't done the copy of the "passwd" to the conf folder. (instructions weren't there in the Jac2b install description) This is as clear as I can state it. I'm sorry if you don't understand, but English isn't my native language.
  51. MrBreaker

    MrBreaker Addicted to LI Member

    I don't get the usb-ports on the NAS200 at all! If you connect a drive to make a backup it will probably be ready when you're a grandfather. This I get, because I can imagine that a backup will take some time via SMB. But via FTP I thought it could be handled by the NAS-controller only and therefore will be a lot faster. When you want to do that, that operation can't be performed because of a "451 Error: Invalid cross-device link." error.

    Does anybody know where you CAN use the usb-ports for?
  52. nick_1964

    nick_1964 Addicted to LI Member

    To connect external drives so they can be used in the network.
    In theory, because they are so slow that it's not useable.
  53. MrBreaker

    MrBreaker Addicted to LI Member


    If linksys had provided a usbhost port on the NAS200 it would also have been a big pro.
  54. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    OK guys, enough complaining already...

    I know the NAS200 is far from perfect when it comes to performance and it would have been nice to have some more features but what do you expect for this kind of money?

    I bet when Linksys started designing the NAS200 they were thinking it should be a worthy successor of the NSLU2. They made it so it had internal drives instead of external ones, and because they were seeing how much of a community was developing around the NSLU2, they decided to make the NAS200 even easier to hack than before. I reckon they just underestimated how the performance would turn out, and there may be a hardware bug that causes it to be underclocked.

    Their firmware is not perfect and neither is mine. But my firmware should give you all the flexibility you need, combined with all the features that Linksys provided.

    Let's quit the kicking-in open doors and have some constructive criticism? Or at least focus on the subject on the thread: the Jac2b firmware.

  55. MrBreaker

    MrBreaker Addicted to LI Member

    Thats fine with me because I'm more or less stuck to it anyway. I don't want to buy another one because it would be a same of the NAS200 and I can life with the (slow) performance.


    Jac, thanx for your great work, keep it up.
  56. nick_1964

    nick_1964 Addicted to LI Member

    But Jac, why didn't they have tested it,the conceptronic nas is the same price but with gigabit and transfers of 20 mbits.
    If you was a linksys engineer then you must know that this gives problems !
    I don't know if you live in the netherlands but they now dump them for 199 euro including a one terrabyte disk !
    I hope soms people can try to find if there is a possibility to overclock it.
    The conceptronic ( internal the same as the d-link) doesn't have to be hacked, it runs on linux and installing some funplugs and youre ready,it can do torrents,webserver,and so on for 149 euro's.
    Why is that stupid thing sold out ( i have one,but want to have a second) and why do they sell the linksys including a one terrabyte disk for 199 ?
    The guy in the shop told me he sold 4,and get back 3.
    I mean your firmware is perfect, I am sorry that I don't have the technical knowledge but I think number one has to be to get this little bugger runs faster.
    You can give a monkey a golden ring, it stays an ugly thing ( hope translated good)
    If no one buys the linksys,then a lot of your work is done for almost nothing ( only for the people like me that uses it,but no one would buy it.
    When I disconnect the external harddrive the whole USB chassis part was on the plug, it broke of !
    Soldered and glued back with an extension cord on it,but... I really hope that there is a hardware bug inside and it can be fixed,and then your firmware can be further developed.
    For now, I cut of the power and leave it disconnected, I have a 100 mbits fiber to the home so I download complete dvd's but I have it much faster downloaded then transferred to the linksys,this isn't funny anymore !
    Please let there be a bug... I would even believe in santa if that helps ;)
    And why your "my firmware isn't perfect" while it is ?
    Ok I miss the download function to install a new cpu :biggrin: but thats all.
    Your firmware is really the only thing that keeps me from hacking the hardware in the linksys... with a axe ( or is it hatchet or cleaver, sorry for my english)
  57. MrBreaker

    MrBreaker Addicted to LI Member

    It's really simple, it's just a matter of time, that is when the product was developed.

    I don't know if the D-link was developed the same period, and/or the goals where the same. I guess you just have to deal with it.

    I don't know if you know but by buying the NAS200 you payed for this http://www.linksysbycisco.com/US/en/products/NetworkStorage development (at least I feel this way). So my point is that linksys has a NAS with gigabit and speed (they state "up to 3 streams of HD-quality").

    When you're a early adopter you almost always pay a high price (and this time this price seems to be HIGH).
  58. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    I don't know. I was just speculating about what the Linksys engineers thought and did. By the way I'm not even sure if there was more than one software engineer that worked on the NAS200 because the only name that keeps showing up is Shearer Wu (or was it Shearer Lu).

    Someone put the board support package online that RDC provides with their evaluation board, and it has some test results included that indicate that they never got it to transfer 4 Megabytes per second either. Maybe Linksys though that they could improve performance somewhat, and they have: using ext2 the transfer rate is closer to 6MB/sec. Either way, the NAS200 is clearly intended for the lower end of the market and I still think it's got a pretty nifty set of features.

    I emigrated from the Netherlands (Eindhoven) in 2000... I've never heard of Conceptronics but I bet it's one of those cheap no-brands that are popular there because branded hardware is a lot more expensive. The NAS200 is about $120 here at the time of this writing (no disks included of course), and a Terabyte Western Digital Caviar Green is about $100. I'm not sure what the current exchange rate is but I think that adds up to about 200 euros.

    I hope to figure that out some day but I've been very busy... It should be as easy as connecting a resistor to a pin of the CPU however the pins are 0.1mm apart so this is not an easy project -- I'll have to trace the signal to another place where it's hopefully easier to connect a resistor or a wire; I don't have the capability of soldering SMD resistors...

    If I can find some time, I'll see if I can port OpenWRT to the NAS200, that would make it possible to run pretty much anything -- really slowly of course...

    Linux is a complex operating system which is already very optimized. I'm not even going to bother trying to make it faster, because I'm sure it's already as fast as it can be. The speed problem is a hardware problem. You can't turn a rowboat into a speedboat by using bigger paddles.

    Like I said, you can probably get a small PC motherboard that will fit into it and just run FreeNAS or even (gasp!) Windows Home Server... Would be a nice hobby project I guess...

  59. nick_1964

    nick_1964 Addicted to LI Member

    Thank you for the exellent reply on everything.. conceptronic is some kind of what we call a sticker brand, you can find the same model with the name sweex,they are internal all the same but like the Philips and Aristona story you will pay more for the Philips then the internally same Aristona, the freecom mediaplayer m-35 is the same as the mediagate M-35.

    For the conceptronic, if you still can read dutch:
    Maybe it is somewhere usefull ?
  60. MrBreaker

    MrBreaker Addicted to LI Member

    Yeah, I guess it would, but at what price? I know for sure it's going to work because there all PC components. So one could take as easily a PC that you're not using anymore, put in a sata controller and you're there. This will be a lot cheaper and will work the same.

    At the moment I'm quite happy with my NAS200 and a
    will only be done by me if the via pico is 50 euro max.

    If you do a thing like that, the NAS200 has then become a quite expensive housing/case.
  61. dINIs

    dINIs LI Guru Member

    Hello Jac,
    good work, thanks! I have a question: where is the Jac2b firmware writes system log file on NAS200? Thanks.
  62. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    Good question!

    There's no system log as-such. There is a file /sbin/syslogd (actually a symlink to busybox which implements a syslogd) and there is a script /etc/rc.d/rc.syslogd but the line in /etc/rc.d/rc.sysinit that should start it, is commented out. This was how it was in the Linksys software and I didn't change it and never even bothered to test if it would work. They probably disabled it because it will eventually fill up the RAM (/var is mounted as ramfs and the script doesn't give any rotation options). Or maybe they thought there's not much use of a syslog if you can't read it. Either way, it should be fairly simple to re-enable if you need it. You could simply run /etc/rc.d/rc.syslogd from your early.sh or (even better) you can start /sbin/syslogd directly with the options you like. Type /sbin/syslogd --help in a terminal screen to find out what the options are.

    That being said, there is something resembling a log in /harddisk/volume_1/data/conf/log/server.log which is updated by various programs (mostly Linksys stuff) but not by everything. Some lines (like output from the SMART scanner) are formatted in a special way so they can be filtered. The View Log button on the Status page and the Disk Log button on the Disk Utility page both show this file on a web page, but each button filters the file slightly differently.

    Hope this helps!

  63. tanerius

    tanerius LI Guru Member

    Hi all, here is my current NAS200 config:

    2 x 320 WD disks set up in RAID 1 (Journaled)
    Data mounted on: /harddisk/volume_3/data

    i have created a new folder /harddisk/volume_3/data/rc.d with 777 permissions
    Then i have created /harddisk/volume_3/data/rc.d/twonky50 and in there put all the files from the newest twonky server (twonkymedia-i386-5.0.zip) then i chmod -r 777 to twonky50

    So under /harddisk/volume_3/data/rc.d/twonky50 i have the new twonky server files, but after a reboot of the NAS200 and ps ax i see that twonky is again running from /etc

    Is there any reason why ? I have also tried to disable and reenable the media server from the gui at no avail. Did i miss anything ?
  64. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    Strange... It sounds like you did everything right.

    If you stop it from the web interface first (then wait until it goes away from ps ax output), then start it from a command line (telnet or SSH) by running /etc/rc.d/twonkymedia.sh start what output do you get?

  65. tanerius

    tanerius LI Guru Member

    $ /etc/rc.d/twonkymedia.sh start
    cat: /harddisk/volume_*/conf/scriptdirs.txt: No such file or directory
    Starting /etc/twonkymediaserver ... TwonkyMedia Version

    ... Hmm iim guessing that the scriptdirs.txt was not automatically created in /harddisk/volume_3/conf

    Hence I created a scriptdirs.txt file and put my rc.d path there. It is now functioning correctly. Cheers mate didnt think it could be the problem since you said that the sciptdirs.txt file should always be automatically created. Well, in my case it wasn't :)

    thanx anyways
  66. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    Strange... it should be created by rc.sysinit if memory serves me.

    Oh well...

  67. tanerius

    tanerius LI Guru Member

    aaaaa... here is the problem of rc.sysinit :

    for x in /harddisk/volume_*
    echo "$x/data/rc.d" >>/etc/scriptdirs.txt
    for disk in /dev/sd?2
    echo -n "... ${disk} "
    mount -t xfs ${disk} /harddisk/volume_1/conf && (
    echo -n "mounted... "

    # If there is a list of script directories here,
    # use it instead of the default. If there is none,
    # copy the default list to this config partition
    if [ -f /harddisk/volume_1/conf/scriptdirs.txt ]
    echo "Using scriptdirs.txt from ${disk}... "
    cp /harddisk/volume_1/conf/scriptdirs.txt /etc
    echo "Initializing scriptdirs.txt on ${disk}... "
    cp /etc/scriptdirs.txt /harddisk/volume_1/conf


    all operatons are on volume_1 which in my case is not mounted
  68. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    What you say is correct, however it doesn't apply in this case. The for-loop in rc.sysinit mounts the second partition of each hard disk on volume_1/conf and unmounts it after processing.

    for disk in /dev/sd?2
      echo -n "... ${disk} "
      mount -t xfs ${disk} /harddisk/volume_1/conf && (
    On your system, the conf partition is mounted on volume_3 during rc.0 by the /sbin/rc.bootbin program.

    What baffles me is that the second part of the if-statement doesn't get executed i.e. the default config doesn't get copied to the hard disk. There must be a thinking error in how the script breaks out of the loop or something.

        if [ -f /harddisk/volume_1/conf/scriptdirs.txt ]
          echo "Initializing scriptdirs.txt on ${disk}... "
          cp /etc/scriptdirs.txt /harddisk/volume_1/conf
    But the real bug is that /etc/rc.d/twonkymedia.sh tries to find the file on all the partitions again; what it really should do is read /etc/scriptdirs.txt...

    I will fix it in the next release; for now - as you said - there's an easy workaround: simply copy the file to your conf partition manually.

  69. nas_200

    nas_200 Addicted to LI Member

    Hiya folks / Jac,

    Ok the firmware is installed and whee! we're having fun now. Or not. Man, this turkey is so slow, speeding it up is priority #1. It's been mentioned by you and others here that it's all software load; I've killed nearly every process I can, but it seems to have no impact on the overhead. ~3.5M is about tops? Blah. Any tips besides what I can glean from what's already here?

    Is there any hope of being able to run anything useful on this, say along the lines of sniffer/IDS/tripwire? I'll try, but w/o having access to the stack...

    Q: Jac - when you compiled ash, did you have the config for prompt expansion set? My directory trees are getting messy with 2Tb of crap, and I'd love to know where I'm at and what's been push'd/pop'd' but it's not doing variable expansion. I know it's considered a security risk, but since we can only log in as root, as well as any attacker, what's the harm?

    Oh, and not for nothing - there's a new busybox release, from last night.
    1.13.3 is a bug fix release. It has fixes for awk, depmod, init, killall, mdev, modprobe, printf, syslogd, tar, top, unzip, wget.

    You know we love you, so, do you feel like compiling up a quick Jac2c for us? :p
  70. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    Speak for yourself :wink:

    I disagree. I would say making this thing more useful is priority #1. I'll tell you why in a second.

    This thing is basically a 486 PC at 100MHz (Should be 133MHz but from the 49 Bogomips value it looks like it's underclocked). I had one of those as my main PC in 1993... So no wonder it's slower than the NSLU2 even though it has SATA.

    So if you're serious about NAS functionality, this one's not for you. If you didn't crack the case yet, return it. Check out smallnetbuilder.com for more suggestions.

    So, the challenge with the NAS200 is not to get it faster (I think that's pretty much impossible) but to make it more useful. Make it you OpenVPN server, or Torrent station, or whatever. So that's what I'm attempting to do.

    I'm currently attempting to get OpenWRT running on it which opens a lot of possibilities when it comes to software that can be downloaded and installed.

    I made only a few modifications to the Busybox configuration. The ones you mention aren't among them because I don't think they're that important. If you want to browse your messy 2TB directory trees, you probably shouldn't be doing it from the command line anyway. Too easy to lose track.

    I'm aware that the busybox in the Linksys firmware is way old and probably has more than a few bugs. I didn't update any of the programs that Linksys provides because I intended to do that in the NASi200 project which is starting to smell very stale now (I only use it as a reference to see what changes were made to the kernel etc. by Linksys).

    If I can get OpenWRT to work (and I have high hopes!), it basically means that everyone will have access to a very stable Linux distro that's in wide use in many embedded devices, which will be beneficial to everyone who wants to run alternate firmware on their NAS200.

    [/QUOTE]You know we love you, so, do you feel like compiling up a quick Jac2c for us? :p[/QUOTE]

    I don't know if there will be a Jac2c. I work 10-12 hour days and that doesn't really leave much room for hobbies. I'm considering fixing the script bugs mentioned earlier this week and making some more improvements to the possibility of installing an updated Twonky but I'm probably going to get OpenWRT running first.

    But if you want to compile your own firmware, I'll be happy to help...

  71. alejandro_liu

    alejandro_liu Addicted to LI Member

    One downside of moving to OpenWRT is that probably Twonky would stop working...
  72. nas_200

    nas_200 Addicted to LI Member

    Twonky works?! Trying to stream a ~1M/sec FLAC, and then accessing the directory tree listing via the web GUI, on the same machine or another, causes stuttering. Even at my measly cap of ~3M/sec on smb (cifs?) transfers, it should still be able to handle that. But it doesn't. If yours does, we have different units!

    Considering it's speed, I'm trying to think of a use for it, besides a super duper interwebs nntp porn fetcher, or a syslog host for the routers...

    Also this isn't the thread for it, apologies, but alejandro: you mentioned in your thread "I will either post the missing dependancy or a new patch." - hey, you got internet again! :biggrin: I'm using your build now, as part of my learning curve on my new toy.

    re: Jac's reply, my reply is long and boring to anyone but you, so I will PM it. If you were serious about the assistance, outstanding, I will take that offer and thanks in advance!
  73. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    <shrug> there are probably other UPnP media players available as Open Source if it's really impossible to get Twonky to work. And I think that if I install the proper libraries I can make Twonky work under OpenWRT just as well as under Linksys R75 or Jac2b.

    By the way I'm talking about Twonky 5 from the Twonkymedia website of course, not about the old Twonky that came included with the NAS200 but there were a lot of problems with that anyway. I paid for an official Twonky 5 license and if you ask me, it's worth the money.

  74. jackito

    jackito LI Guru Member

    Hi Nas_200,

    maybe we can join forces. I also would like to update the busybox version running on the NAS200 to the latest one as part of a small list of add-ons that include FreeRADIUS and VPN Server (¿SSL?). I´m planning to do all this on top of Jac´s great firmware Jac2b.
    If you are interested let me know... :wink:
  75. nas_200

    nas_200 Addicted to LI Member

    Sure, PM away. Be aware that even though 2.6.19 or whatever the box has, has IPSec built-in if we enable it and all, but the overhead is going to crush the little thing. Jac suggests the scp/ssh tops around 300k/sec (I haven't done any tests, nor compared clients / hosts.) And this is just slightly more processor intensive... but hey, we won't know till someone tries, so... it's worth a shot! :p
  76. jackito

    jackito LI Guru Member

    I was thinking of VPN for remote access to the network, not only the NAS. For the NAS I can use SCP for sure. But what if I need to access another computer on the network?

    About FreeRADIUS, it came up because I was a little bit worried about my WiFi network security. Currently I´m using WPA2-PSK with a 32 char shared key compound of upper and lower case chars, numbers and special characters. But I still don´t feel safe enough so if I find something weird related to WiFi security in my router I would like to move to WPA2 "Enterprise" that is, using RADIUS for authentication and authorization. The only 24x7 hardware that I have currently running is the router, the NAS and a "dumb" USB harddisk for NAS backup so any new service that I would like to implement in my network I should do it on the NAS, of course, as long as I can.

    Anyway I´m almost sure that get those services running on this toy is going to be a challenge, at least for me.
  77. CycyX

    CycyX Addicted to LI Member

    Locked out

    Imagine a world where everybody reads READMEs till the end...
    Nice thought, hey?

    Well it's not an ideal world down here, and here I am, dumb as a stone.
    I carefully read the post several times before upgrading the firmware, but when it came to actually put it in place, this is a whole other story.

    Here's my mistake: I've touch-ed the no_telnetd file, changed the root passwd, copy it on the harddisk/volume_x, rebooted (with 'reboot', but whitout losing anything apparently) and BAM! Locked out.

    Did you see it? I forgot to change root's home directory.

    So now, telnetd is down, and I can't connect to the box using SSH because I'm disconnected just after entering the (correct) passwd.
    Non interactive commands won't work either (so I can't ssh root@nas rm ...).

    Is there a way out of this situation?

    By the way, I'm using this NAS with RAID 1 conf (2x1TB), UPnP Media server.
    It took me about a whole day to upload 300GB of data, but now my Archos can read streamed videos without a glitch (except fast forward maybe), and as my Internet connetion is "only" 1.7MB/s (18Mb), I can download my files from internet on a mounted partition.

    P.S. : english is not my native language so pardon me...
  78. nas_200

    nas_200 Addicted to LI Member

    Hit and hold the reset button with a pin / toothpick / anything you can fit in there, until you hear a double-beep... Volia! back in business. ( via the http GUI, it's reset to U:admin P:admin)

    Kind of off-topic but hey: Why not enable MAC filtering on your router? Only allow devices whose MAC is in the lookup table to connect. While people can spoof MACs for sure, still, between MAC security -and- WPA2\AES, unless you live in Manhattan or something where there's 250+ APs in sight of your machine, you're safer than most wired connections. Between that, and disabling SSID broadcasting, even someone wardriving past your place might not even pick up your AP if it's not in use at that second.

    On topic, I'm guessing FreeRADIUS might be just a tad insane to add to the box, especially when you want it to be the server not a client, so we'd have to really concentrate on it's security to have any useful meaning; as it stands only root can connect and do anything, and your first connection is cleartext, so not only do you have to lock the NAS down, but the steps become important. (like re-changing the root pw after your first ssh connect).

    But again, let's try and see. :tongue: You might want to switch to alejandro_liu's build, it just bootstraps from Flash and chainloads from the HDD... running not just install scripts but all the software you've cross-compiled from your uClibc/buildroot install. And since it's not wasting write cycles on the Flash, you can do it 100 times daily without worry. (And there's much less change of brick'ing your NAS200.)
  79. CycyX

    CycyX Addicted to LI Member

    Well... In fact, no this doesn't fix anything.
    I don't need a password reset, I need a way to restart the telnet daemon, or edit the /etc/passwd file.

    I'm not locked out because I don't know the root password, I'm locked out because the root user doesn't have a proper home directory, so dropbear sshd disconnect me just after authentication.

    So is there a way to erase any new file (like no_telnetd) from the NAS200 drives, without logging on the hardware.

    Hard reset maybe?
  80. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    Sure. Create a directory rc.d on the root directory of you file system (i.e. in "DISK 1", not "PUBLIC DISK 1"), and use a program such as Notepad++ to create a file called "rc.unpaint" (the name has to start with "rc.", the rest of the name can be anything. The file has to have Unix style line endings so regular Notepad won't work) with the following text:

    #  rc.d/rc.unpaint
    rm /harddisk/volume_1/conf/no_telnetd
    After that, restart the box by turning it off and on with the power button. At the first reboot, this script will remove the no_telnetd file again. You can remove the rc.unpaint file again. I don't have the startup sequence in my head; it may be necessary to reboot once again for the change to take effect.

    Someone already mentioned pushing and holding the reset button, I believe that may also work although I'm not sure if it replaces the passwd line for the root user (I think it may only replace the line for the admin user but I'm not sure).

  81. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    Maybe you can run an alternate firmware on you WAP that supports FreeRadius? If so, it would probably save you a lot of time compared to getting it to run on the NAS200...

  82. CycyX

    CycyX Addicted to LI Member

    Worked like a charm, thank you! :D (and my editor of choice is Vim, under Linux, so I didn't got troubles for line endings... :p)

    Next question: I want to disable "use sendfile" in smb.conf, so I edited:

    and changed the line for "use sendfile = no".

    After a reboot, the /etc/samba.smb.conf file is back to "use sendfile = yes".
    How can I make my change permanent? Remounting / with rw and editing /etc;default/samba/smb.conf?
  83. nas_200

    nas_200 Addicted to LI Member

    ahh, my bad, I figured Jac stuck in a trigger for the reset code, since it's got that nifty .rc killer... apologies.

    Don't forget that they pop out really easy. I frequently pop them out and hook it up to an eSATA dongle, sure beats waiting a week to transfer a terabyte off a drive. Makes it trivial to edit passwd as well.

    re: files, while it'll take -o remount,rw, it will not work. It's burnt into Flash, probably in the squashfs. Those files have to originate from somewhere when you put in blank HDDs. I'm guessing you cannot make it permanent without making the modifications and flashing the unit. But I could be wrong. as before... :redface:
  84. jackito

    jackito LI Guru Member

    Hey, you can do it just exactly as you did it to re-enable telnetd.
    Use a startup script. :biggrin:
    I´m using startup scripts for a 6 - 8 different things that I like to be different from the default. For example to be able to mount a USB hdd with an ext2 fs for backups, changing the default crontab with my custom one, using a different telnet safety net (im currently disabling it also), etc.
    All you need to do is to:

    1) create a rc.whatever file as you did before, in /harddisk/volume_X/data/rc.d where X depends on the type of configuration of your disk(s). For example for RAID-1 configuration X=3.
    2) Edit the new file and put something like:
    /harddisk/volume_X/conf/mycustomstuff.sh &
    3) create a file mycustomstuff.sh in /harddisk/volume_X/conf
    4) Edit the file and put something like (note the sleep command, is just for give time to the NAS to finish the startup normally and dont replace your new smb.conf):
    sleep 120
    cp /harddisk/volume_X/conf/mysmb.conf /etc/smb.conf
    5) create a file mysmb.conf in /harddisk/volume_X/conf and put in all your configuration or just copy the original smb.conf file a change any parameter you need.
    6) Optionally you can do: /etc/rc.d/rc.reboot or execute this if you dont want to reboot:
    cp /harddisk/volume_X/conf/mysmb.conf /etc/smb.conf
    7) Enjoy!

    PS: of course you can use the same aproach as I said before for change whatever you want automatically on reboot.:cool:
  85. jackito

    jackito LI Guru Member

    I know that compiling software for the NAS200 is not the best thing that can happen to anyone jejeje but hey I like challenges! :tongue:

    Anyway for now I will just concentrate on VPN and probably a new busybox. FreeRADIUS is not a priority, only an idea for now.
  86. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    Apparently, /etc/samba/smb.conf gets copied from /usr/local/smb.conf at boot time, probably by /usr/sbin/rc.bootbin. I'm not sure why it's also on the configuration partition with two different file names.

    Remounting the root directory read-write is not an option, SquashFS is a read-only file system.

    As was already pointed out, the easiest way to fix this is to write a script. I would keep it really simple:
    # rc.d/rc.sendfileoff
    sed -i -e '/use sendfile/ s/yes/no/' /etc/samba/smb.conf
    The rc.d scripts get executed after rc.bootbin runs and before samba starts, so that should work just fine.

  87. CycyX

    CycyX Addicted to LI Member

    Thanks, I thought of using a script, but didn't search much to understand the starting order (done now... :p).

    Last question (but everything works fine now, so it's not an urgent matter):
    the smb.conf in /usr/local refers to "workgroup" workgroup, but I set something else in the web interface (as do the smb.conf.ttt in /harddisk/volume_3/conf or /etc.default/samba/smb.conf).
    When (and which program/script) is this file modified?

    I didn't saw anything in the startup scripts, so I guess it made in rc.bootbin...

    Well, thank you for your firmware Jac! :D
  88. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    There are many, many small changes in the source code for the Samba that's running on the NAS200. I did a quick search but I couldn't find where the workgroup name is retrieved and used, but I think probably it gets the workgroup from the linksys settings in some other way, and ignores the smb.conf workgroup setting completely.

    The FTP server also uses some closed-source Linksys library (thereby violating the GPL) to figure out which directories it should share. Possibly Samba uses the same library.

    Anyway, it's nothing to worry about.

  89. Mercman

    Mercman Guest

    Twoky Media Server Help

    I installed the Jac2b firmware for the purpose of running Twonky Media Server on my NAS200. I am not a Linux expert, in fact I only know enough to be dangerous.

    I can't get Twonky to autostart and when I manually start it I get the error:
    /harddisk/volume_1/data/rc.d/twonky/twonky4.4.11/twonkymedia: 1:ELF: not found

    I'm wondering if somebody who has twonky running on a NAS200 could post the step by step procedure on they used to get it running, or if it already exists please point me in the right direction!
  90. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    This smells like a dynamic linker error; "ELF: Not Found" means that some runtime library is unavailable, if I recall correctly.

    While I have little experience troubleshooting this kind of problem, I suggest you use Twonky version 5.0 instead of 4.4.11.

    "works for me"...

    (sorry I know I'm not much help)

  91. leijona

    leijona Addicted to LI Member

    i recently upgraded from the original to jac2b firmware. First of all thanks to Jac0 for his efforts. I am trying to connect via SSH and after giving the correct credentials the session is terminated. I did see the previous comments and followed the instructions but the problem remains. I have 2 HDDs in RAID 1 so maybe i thought at first to only copy the /etc/passwd file to config_3 ..... nothing, same problem.
    Then I copied the file to all configs using the "for x ...... done" line in the first post. Still the same problem. It shouldn't be that difficult I know, and the solution might be in front of me , but I dont see it. Could any of you guys help me. My linux skills are limited anyhow ...as it appears
  92. oferta.cerere

    oferta.cerere Addicted to LI Member

    Before copy the /etc/passwd file edit this and modify the line:


    with new path:


    because there is no root directory in the system.
  93. leijona

    leijona Addicted to LI Member

    Worked like a charm.. Cheers!
  94. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    Main article edited

    I've been getting a lot of posts about not being able to log in after changing the password, and I realized the main article wasn't entirely clear about this.

    So I edited the article's section about changing the root password, hopefully this will help clarify things.

  95. julianowens

    julianowens Guest

    not sure what went wrong.


    Got the firmware from this site. Loading it went find, even used it as is for about 24 hrs without any changes. I was rsyncing some files from a usb attached drive overnight to a local drive on my machine on my network. Everything was running smooth let it run overnight cause the transfer rates are slow. Work up this morning and noticed an error about the NAS no longer being on the network. I tried to ping it,, nothing came back. Tried powering it off and back on and I get a power light but no network connectivity at all. I even tried scanning to see if it recieved a new ip ip address and nothing.

    I know the firmware install went fine because for awhile I was able to reach the nas200 via telnet without the password. Can't understand how it could have bricked itself of just 24 hrs of use. No access could have been obtained as the network is closed from outside.

    Not sure what to do at this point. Why would it suddenly just brick itself after 24hrs?

    I appreciate any help as its a bit dead now.

  96. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    I've seen my NAS200 go offline after a while with intensive disk transfers, I don't know why. When I transferred 250+ GB to the unit it took me 3 days and I had to restart it about 3 times. But every time I started it, it would start okay.

    When you power it up, does it still beep once (almost immediately) and then twice (after a minute or two)? Did you wait for the double-beep before you tried pinging it? Which LED's are on, which are off and which are flashing?

    Did you try removing the hard disk(s) (while it's powered off!) and booting it without hard disks installed? I believe it stores the network configuration in Flash so it should come up the same way without disks. If it boots fine without disks but not with disks, maybe the problem is in your disks.

    Maybe your disks are getting too hot? Inadequate cooling is a known problem with the NAS200; if your hard disk runs so hot that it hurts to touch it, chances are that it's not responding to requests from the disk controller. Let it cool down to room temperature and try again. I did some Dremeling and installed a 50mm fan inside the unit to replace the tiny fan that was there originally.

    It may be a hardware problem on the motherboard, which I'm not going to be able to help you with... I hope you have backups of all your data.

  97. alejandro_liu

    alejandro_liu Addicted to LI Member

    Did you try putting the NAS200 in upgrade mode?

    Essentially, for the first few seconds after the system is ON, it would answer pings and telnets to port 9000 send to address (you must change your PC's IP address to the same subnet).

    If that works that means that at the very least you should be able to reflash your system with a new image.
  98. mjv_racing

    mjv_racing Addicted to LI Member

    hey guys,

    I'm pretty new to this idea of customising firmware.

    I've got the jac2b firmware installed, and twonky 5 (fully registered) located on /harddisk/volume_3/data/rc.d/twonky/

    I can run this manually and all works well.....for a while

    I've been in the process of moving all my data to my new setup (2 x 1tb mirrored (RAID1 i think?)). As I have started to do this I have found that the nas200 has got progressively slower, to a point where the twonky server cannot be found on my ps3, and my vista machine says it cannot access the drive. The power button doesnt work so I have to switch off from the mains. I have disabled the twonky 5 server for the last transfer and things have proved a little more reliable.

    Does having the server on the hdd limit the speed at which the network can function for file transfers? Is it worth trying to copy twonky 5 to the /etc/rc.d flash folder and running it from flash? can this be done? and also how do you set up a scriptdirs.txt file to autorun twonky 5 from the hdd?

    cheers guys
  99. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    If you have a huge media library, the Twonky server will use more memory. Also, while Twonky is building its indexes, it slows everything down (a lot!). Eventually I expect the NAS to run out of RAM and start swapping to the hard disks. The Linksys software (and thus the Jac2b firmware) sets aside 128MB of disk space on each disk for swapping and I bet once this is in use, it really slows everything down especially if you have a RAID configuration where both disks are in constant use. And of course when all swap space is in use, anytime that applications want to allocate more memory, they will fail and (in many cases) will simply stop working.

    If you want to keep track of how much swap space is in use, log in via telnet or SSH and use cat /proc/swaps.

    It wouldn't do much good to copy the server software to the RAM disk. The files in the Twonky 5 tarball probably only rarely get read, and probably never even written, and they would take up valuable memory space in RAM that could be used for other purposes including for the internal tables that Twonky uses to track stuff.

    Copying it to the flash while the system is working is not possible because SquashFS is a read-only file system. The flash file system is built as part of the firmware and is then flashed all at once, after which there is no space to add files or move things around. OpenWRT uses a different file system where it would be possible in theory to do such a thing but OpenWRT is not supported for the NAS200 yet (hopefully I'll have some time to work on it again next weekend). Besides, we'd still have the problem that it's not the program files that slow everything down, it's the data that the programs keep in memory.

    If you followed the instructions and put the Twonky server in rc.d/twonky as you stated, you should be able to start the twonky server automatically by enabling it from the web interface.

  100. mjv_racing

    mjv_racing Addicted to LI Member

    cheer Jac, I will look into how much memory is being used - I bet thats what it is!

    I do have a massive media library I am trying to share (hence the 1tb storage space). Videos are the main concern at the moment so maybe I'll start with them and see how the server goes.

    Thanks again
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice