[Announce] Jac4 Alternative Firmware for NAS200

Discussion in 'Cisco/Linksys Network Storage Devices' started by jac_goudsmit, Aug 13, 2009.

Thread Status:
Not open for further replies.
  1. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    This thread is closed because it was getting too long. If you have any questions, please start a new thread in the forum. I read all posts and I will help you as much as I can.

    Announcing Jac4!
    Telnet, SSH, Custom startup scripts, ability to update Twonky server, replaceable root filesystem... Oh my!

    IMPORTANT! A number of subtle, but important changes have gone into this version. Please read the complete article even if you already have an earlier version of my firmware installed.

    The Jac4 firmware is based on the Linksys V3.4R79 firmware. It provides all the functionality of the Linksys firmware, but also adds the following extra features:
    • Optional Telnet server
    • Dropbear SSH server and client, with SCP secure file upload/download capability
    • Kernel enhancements e.g. support for additional file systems including NFS and iso9660
    • Ability to automatically run startup scripts for programs you download to your hard disks
    • Ability to run an updated Twonky media server
    • Ability to install an alternate root file system on the hard disks or a USB storage device

    These improvements should give you plenty of possibilities to enhance the functionality of your NAS200 even further, while at the same time providing maximum compatibility with the standard firmware.

    There's no need to break any seals on the NAS200 to install or uninstall this firmware. However, please keep in mind that if something goes wrong with your NAS while this firmware is installed, Cisco/Linksys tech support will not help you, and is likely to void your warranty. I will not accept responsibility for this; if this bothers you, don't install it. Please read the disclaimer at the end.

    No knowledge of Linux is required to install or uninstall this firmware. Some knowledge of the Linux command line is helpful if you want to run an updated Twonky media server. If you want to use any of the other features, Linux knowledge is essential (but without that knowledge, you probably wouldn't know how those features would benefit you anyway). This article will explain the basics, I will follow up with more advanced topics.

    Downloading and installing

    You can download the firmware here.

    Use the Firmware Upgrade page of the NAS200 web GUI to install the firmware. The web GUI page should be self-explanatory -- if not, this firmware is definitely not for you.

    If you want to go back to the official firmware later (or any other firmware for that matter), you can always go to the same web GUI page and download it in the same way. The web GUI in the Jac4 firmware is identical to the one in the Linksys firmware; unfortunately that also means you won't be able to tell from the web pages that you are running Jac4.

    The first time you restart the NAS200 after you first install the Jac4 firmware, the NAS200 will take more than 5 minutes before it comes online. Dropbear has to generate encryption keys, which takes a while. The keys are stored as files on the hard disk, so the next time it starts, it skips the process and the NAS200 will start normally again.

    Setting the root password
    During the first time Jac4 boots (i.e. if it's never been installed before), it resets the root password to "root". You should change this to protect against unauthorized access. You should not leave port 22 open to the Internet unless you change the root password using the following instructions.

    Note to users of previous versions of my firmware: The root password is only changed to "root" when the Dropbear encryption keys are created, so if you've run my firmware before, your root password and home directory will not be changed.

    The easiest way to change your root password is by logging in through an SSH connection (e.g. using PuTTY, if you run Windows on your PC) and entering the following two (2) commands[/B]:
    Don't forget the "cp" command after you use the passwd command. It's essential to copy the password file to the configuration partition, because that's where it is restored from (actually: symlinked from) when you reboot the NAS200. Whenever you change a password, remember to copy the /etc/passwd file to the config partition on the harddisk using the command shown above, so that it survives a reboot. If you don't, the password will revert to what it was before you used the passwd command.

    If you forget the root password, you can use the web GUI to reset the user accounts to the default (use the Restore button at the bottom of the Update Firmware page). This will reset all accounts including root, and the default root password is "root".

    Installing an updated Twonky Media Server
    Note to users of previous versions of my firmware: Updating the Twonky server is now a lot easier and doesn't require you to write a script or change access rights anymore. If you already updated your Twonky, you may just want to follow these instructions to redo it, especially if you have a script to enable the web server.

    Please note, the current version of Twonky Media Server (5.1.x) doesn't work because the Twonky engineers updated their toolchain and the program now depends on libraries that aren't available on the NAS200. The next version of my firmware will probably fix this.

    The Jac4 firmware gives you the option to download a later version of the Twonky media server to the hard disk, and run it instead of version which comes standard with the V3.4R79 Linksys firmware and with Jac4. The following instructions were tested with version 5.0.61.

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

    1. Download the ZIP file to any location.
    2. Create a directory "rc.d" (all lower case) under the "DISK 1" share of your NAS
    3. Create a directory with a name that starts with twonky, e.g. "twonky5" (again, all lower case) under the "rc.d" directory. There should not be any other directories with names that start with "twonky".
    4. Unpack the ZIP file to the "twonky5" directory, retaining the directory structure of the ZIP file (in other words, you should see subdirectories "plugins", "cgi-bin" etc. as a result).
    5. Rename the default .INI file in the "twonky5" directory to "twonkyvision-mediaserver.ini", then use Wordpad or another Unicode-capable editor to change the following settings to these new values:
      • enableweb=2
      • httpport=9000
      • httpremoteport=9000
      Note that instead of renaming the default INI file that came from the ZIP file, you can also use an SSH shell to copy the /etc/twonkyvision-mediaserver.ini fil to your twonky directory /harddisk/volume_<number>/data/rc.d/twonky5 where <number> equals 1 if you use Separate Disk mode, or 3 if you use RAID. That way, the new Twonky server will already know about your media directories.

    You can control the startup and shutdown of the Twonky server via the "enable" option on the Media Server page of the Web GUI. The Twonky server startup script will check for the existence of the "twonkyvision-mediaserver.ini" file in your Twonky directory and will use it as settings file if it exists (which will allow you to directly edit the file). If the file doesn't exist, it will use the same settings file as the internal Twonky server (which is generated from the web GUI settings, but which you cannot edit).

    Please note, the updated Twonky server is incapable of restarting itself. When the web interface tells you it's restarting, it's really just shutting down, and you have to restart it by using the Linksys web GUI to disable, then re-enable it. This is probably because on the NAS200, the server doesn't run with the -D (daemonize) option.

    Thanks to the "enableweb=2" setting, you can change the settings of your server by connecting a web browser to port 9000 of the NAS. You can also control the server from the Twonky Media Manager program, available from the Twonky website. If you decide to buy the program after the trial period, you can enter the license key through the Twonky web interface as well. As far as I know, it's not possible to extract and re-use a license key from the built-in Twonky server (I'm not even sure if there is one). You should not forward port 9000 to the Internet by opening the port on your router (and because of the NAT translation of your router, it probably won't work anyway: the Twonky server's web pages have absolute HTML links on them that don't get translated by most firewalls).

    Secure login and file transfer: Dropbear
    SSH is a secure protocol that allows you to control the NAS200, as well as upload and download files via the SCP protocol. Unlike Telnet and FTP, the SSH and SCP protocols are secure, so they are safe to expose to the Internet.

    Another problem with FTP is that it's impossible or at least very difficult to use the NAS200 as an FTP server if it's behind a NAT router/firewall, even if you use PASV mode on the client. See e.g. here for an explanation. However, with the SCP protocol over an SSH connection, file transfers over the internet are easy to accomplish (both SSH and SCP use only port 22) and are encrypted. The downside is that the encryption and decryption are very CPU-intensive so the maximum transfer speed over SSH/SCP is only about 300 kilobytes per second.

    I use and recommend WinSCP to connect to the NAS over the Internet. Other file transfer clients should work too, as long as they support SCP. Note that the Jac4 firmware does not support SFTP, which is what many client programs use by default.

    Even if you don't plan on using SSH, you should probably log in at least once to change your root password to something other that "root". See the instructions above.

    Optional: Creating extra user ID's
    The only account that can log in through SSH/SCP is root. 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 user, the user won't show up in the web GUI anymore.

    If you wish, you can manually add users that can log in through SSH/SCP. Let's say you have one user "jac" created through the web interface, and you want to create a user "jacssh" for that user so he can log in via SSH. All you need to do is duplicate the line in /etc/passwd for "jac", and modify the copied line to have a valid shell and login directory; if you leave the uid and gid numbers the same, the jacssh user will have the same access rights throughout the system as jac. If you feel comfortable with vi, you can edit the file with that editor through an SSH login, otherwise you can use WinSCP's built-in editor.

    jacssh:ePnAcSrSyWpOtReDd:2000:501:Jac Goudsmit:/harddisk/volume_1/data:/bin/sh
    (in case you're wondering, the encrypted password shown above is simply the words "encrypted" and "password" mangled up, they are not my real password :wink: )

    Remember to copy the /etc/passwd file to /harddisk/volume_1/conf after you edit it, otherwise all your changes will be lost after a reboot.

    Note to users of previous versions of my firmware: The Telnet server is now disabled by default. The old "no_telnetd" file is ignored.

    I recommend leaving the Telnet daemon disabled. It's not secure because it doesn't encrypt traffic and it doesn't ask for a user name and password. Originally, Telnet was the only way to get to a command prompt, and it was the only way to set the root password. Since then, several other ways of changing or resetting the root password have been implemented so I decided to disable Telnet by default from now on.

    If you want to enable the Telnet daemon, you can do so by logging in through SSH and entering the command:
    $ touch /harddisk/volume_1/conf/allow_telnetd
    After the next reboot, Telnet will be enabled.

    Important things to know
    • The correct way to shut down and reboot from the command line is to run the scripts "/etc/rc.d/rc.halt" and "/etc/rc.d/rc.reboot". If you simply type "halt" and "reboot", the disks will not be synced and you may lose data.
    • If you want to edit any configuration files or scripts on the NAS200, you can use the built-in version of vi. If you edit files from Windows, you will need a Unix compatible editor such as Notepad++ which understands Linux style line endings (LF only instead of CR-LF). You can also use the editor that's built into WinSCP which will not only automatically upload and download the file but will also take care of the correct translation of line endings.
    • When you use WinSCP to connect to the NAS200, it will give you a warning that it can't find a list of groups. This is harmless and you can ignore it, or you can eliminate it by doing the following in WinSCP:
      1. Enable Advanced Options
      2. Under the "Environment" item in the options, select "SCP/Shell"
      3. Disable "lookup user groups"
    • Note users of previous versions of my firmware: There is a flaw in the Busybox version that runs on the NAS200, which formats the output of "ls -la" in such a way that for large files (9 digits or more) the user group and the file size don't have a space between them if the group name is 8 characters long or longer. Unfortunately "everyone" is 8 characters and it confuses WinSCP in such a way that it can't display a directory listing. For this reason, the Jac4 firmware renames the "everyone" group to "every1" in the same script as where it generates encryption keys for Dropbear and and where it resets the root password to "root". For that reason, new users won't encounter the problem with long group names but if you've used my firmware before, you will have to manually rename the "everyone" group in /etc/group to something shorter.
    • 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.
    • If you're interested in kernel modules for additional file systems, you can download them here. Note, to use the NAS200 as an NFS server, you will need additional software which I don't provide at this time. You can load the kernel modules with the insmod command (modprobe won't work). If there are other kernel modules you're interested in, let me know.
    • The source code can now be downloaded from a public location. Click here to download it. You don't need the source code unless you want to build your own version from scratch. The source tarball does not include the sources for the boot loader or the crosstool toolchain. I didn't change them and you don't need them to build your own working firmware, and they made the source tarball twice as big. In accordance with GPL, I do have those sources available for download, send me a PM if you're interested.

    Further info about the files
    These are the md5sums and sizes of the files mentioned above. Especially for the bin file, checking the md5sum is highly recommended!

    f448ae48c3e84aba0cfe89167c44f78a NAS200_V34R79jac4.bin 8388608 (the main download)
    fe13acf1f0f1464e0249f61e5af12ec1 extrafsmodules_jac4.tar.bz2 8774317 (extra file systems including NFS; note, NFS tools not included)
    8be30b4f2be47a2525819063bcc16934 nas200_usbcdrom.tgz 1511199 (modules and script for USB CD-ROM support)
    1c376a87208c07a3200ab4122ddcc6f4 nas200_jac4_source.tar.bz2 174144579 (source code, please do not download unless you're seriously interested in building your own firmware)

    More information: see next post
    For advanced information Linux users with some experience, please read the article below this one.

    NO WARRANTY OF ANY KIND! Regardless of the contents of this article or any other statements and posts in this forum or elsewhere (or interpretation thereof), I will not take responsibility for anything that happens to your NAS200 or any other hardware, to your software or to your data as a result of your 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.

    OPEN SOURCE AND FAIR USE CLOSED SOURCE. The open-source parts of the firmware are licensed under the Gnu Public License (GPL) version 2. The closed-source parts of the software (including the Twonky media server) were copied from the Linksys source distribution tarball, and are redistributed under the assumption that this is a tolerated use of these files. I have no intention of infringing on any rights that belong to Cisco, Linksys, Sercomm, PacketVideo or any other company involved in firmware development for the NAS200. I don't expect to gain any money from this project, actually it has cost me money for hosting and bandwidth. If you are the owner of any of the non-GPL works and you have a problem with me redistributing these files (which are freely available from the Linksys FTP site anyway), please contact me and I will take the offending files off-line immediately.

    IF YOU UPDATE THE TWONKY SERVER, YOU MUST BUY A LICENSE. This article provides instructions on how to download and install an updated Twonky server. I do not distribute files for the Twonky server except the redistributed files that are also available as part of the Linksys binary distribution, as well as the Linksys source tarball. I will not take responsibility for any legal problems that you run into with TwonkyVision/PacketVideo because of licensing problems. You are responsible for abiding by the license that accompanies the download. As far as I'm aware of, the Twonky server that you can download from the TwonkyVision/PacketVideo website is not covered by the license agreement that covers the one that was included with your NAS200. In other words, you will have to pay PacketVideo after 30 days (or whenever the trial expires, if applicable) for a full license to the program. I am not aware of, nor have I made any attempts to find, any way to extract and/or reuse any license key or other information that might be stored on-board the Linksys-distributed firmware (neither in the binary distribution nor in the source tarball) to circumvent the need for a license key for the Twonky software that can be downloaded from the Twonky website. I purchased a license key for my own use, and I urge everyone else to do so too.

  2. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    To some, this is where it REALLY gets interesting.

    Additional Features

    Note to users of previous versions of my firmware:
    • Custom startup scripts work the same as in previous versions.
    • The early script also works the same as in previous versions (Jac2 and up)
    • The pre-init "nas200.sh" script introduced in Jac3a also still works the same
    If you've used my firmware before, the new automatic root pivoting feature of Jac4 is probably the only thing you will want to learn more about; you probably already know all the details about everything else.

    Custom startup scripts
    During startup, the Jac4 firmware will search for any custom startup scripts in the rc.d directory under the root directory on any of your shared hard disk partitions. The file names of the scripts have to match rc.* to be started.

    Whenever 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". I recommend using the editor that's built in to WinSCP to edit scripts on the NAS; it will automatically download and upload the files and it will make sure that the line endings are translated correctly.

    Your custom rc.d/rc.* scripts are started right after the hard disks get mounted and the network is started. If you want to automatically start a program at boot time, writing an rc.d/rc.* script is the recommended way to do it. Make sure that your program daemonizes itself or that you start it in the background or the boot sequence won't continue.

    If you want your rc.d/rc.* scripts to modify system startup scripts in /etc/rc.d, you will have to copy them first. Unlike the Linksys/Sercomm firmware, the /etc/rc.d directory does not reside in RAM but is symlinked to ROM so it cannot be modified. If you want to make the system startup scripts writable, put the following script in your rc.d directory on your hard disk:

    # Save this as e.g. rc.d/rc.00rctoram
    # The two zeroes in the file name are to make sure it gets done early
    rm /etc/rc.d
    cp -a /etc.links/rc.d /etc
    The firmware will make sure that the files are owned by root and are executable: it changes the owner of each script file to root and it changes the access rights to 777 before executing. Note that this allows anyone to modify your scripts so you may want to use the web GUI to disable access to the "DISK 1" and/or "DISK 2" to everyone except the people you trust.

    There is a failsafe mechanism to prevent any mistakes in custom scripts from making your NAS unbootable. The firmware writes a file "failskip" in the rc.d directory and deletes it when all scripts in the directory are done. If something goes wrong, the "failskip" file will already exist when the firmware starts processing the directory, and it will skip processing all custom scripts. You can read the "failskip" file to find out which script caused the problem: before starting each of your scripts, its name is added to "failskip"; the last name in the script is the name of the script that never finished. If you wish, you can debug your scripts by echo-ing messages to the failskip file too.

    Early script
    (EDIT) The following is incorrect if you run a RAID configuration. The early.sh script only works as advertised in Separate Disk mode. I will fix this in the next update.

    It's also possible to run a script before the hard disks get mounted and the network is started. This script is called early.sh and must be stored in the configuration partition of any of your hard disks (/harddisk/volume_1/conf and /harddisk/volume_2/conf). At the time that the early.sh script is run, no partitions are mounted except the one where the script is stored. The network is offline and cannot be used during early.sh.

    There is a fail safe mechanism for the early.sh script in case it fails: just like with the rc.d/rc.* scripts, the firmware creates a file that it deletes after running early.sh, and it skips running early.sh if it finds it before creating it. In this case it's called "earlyfail" and it's stored in the same location as early.sh.

    If you need a script to start a program start automatically, you should not use early.sh to do this unless there is no other way. The early.sh script is meant to fix problems and do things that you can only do before the hard disks are mounted and/or before the network is online.

    Alternative Root filesystem
    If you're interested in running a different Linux distribution such as Debian or Gentoo, you will be pleased to learn that Jac4 can automatically pivot the root directory to a different file system. You can run your favorite distro from one of the hard disks or from a USB storage device, and you can either store your filesystem directly onto those devices or you can store your file system in a file that's stored on those devices. It's even possible to automatically pivot the root to a binary file that is produced by the "bind" program in the Linksys/Sercomm source tarball.

    Before the usual /sbin/init is started, Jac4 tries to mount the following devices, in this order, on /mnt:
    1. USB port 1 (located near the edge of the NAS200), using vfat as file system type
    2. USB port 2 (located near the center of the NAS200), using ext2
    3. The configuration partition of disk 1 (normally mounted as /harddisk/volume_1/conf), using XFS
    4. The configuration partiiton of disk 2 (normally mounted as /harddisk/volume_2/conf), using XFS
    (EDIT) If you run your NAS200 in RAID mode, you will not be able to use the config partitions for alternate root file systems at this time. This will be fixed in the next version.

    If the mount succeeds, the firmware will first test if there is a file called "nas200.sh" in the root directory of the mounted device. If so, it is executed using ". /mnt/nas200.sh". This gives you the opportunity to execute commands before any pivot_root happens. Once the script ends, execution will continue by trying all the following pivot-root methods.

    Jac4 tries to find root file systems to pivot to by using the following methods, in this order:
    1. If a file "init" exists in the root directory of the mounted device, and it is executable, the firmware assumes that the device has a working root file system on it.
      • It pivots the root directory to the device where the file was found.
      • Control is transferred to /init in the new root file system.
      • The old root directory can be found at /rom which is created before pivoting if necessary.
      • It should be possible to make /init a symlink to /sbin/init.
    2. If a file exists in the root directory of the mounted device that matches the pattern "NAS200_*.bin", the firmware assumes that this is a binary image file that would normally be flashed to the ROM.
      • It uses losetup with an offset of 1835008 (this is the size of the kernel in the image file), and then mounts the squashfs root filesystem in the image on /dev/loop7. It pivots the root to that device.
      • Control is transferred to /sbin/init in the new root file system.
      • The old root directory can be found at /mnt/tmpmnt.
    3. If a file exists in the root directory of the device that matches the pattern "nas200.*.rootfs" (where * can be squashfs, ext2, ext3 or xfs), the firmware assumes that this file is a loop-mountable file system.
      • It uses losetup to set up the file system on /dev/loop7, and then pivots the root directory to it.
      • Control is transferred to /sbin/init in the new root filesystem.
      • The old root directory can be found at /mnt in the new root file system.

    The reason why the Jac4 firmware starts /sbin/init in loop-mounted file systems that it pivots to, is that this is the normal "standard" initial process. If it would try to start /init, there would be a possibility of ending up in an infinite loop e.g. if you would insert a USB stick with the Jac4 image in a USB port.

    The reason why the firmware starts /init when the file system is not a loop filesystem is that I envisioned that init could be a self-extracting file that unpacks the actual firmware to the root of the device.

    Whenever a pivot_root succeeds, the Jac4 firmware uses exec to give your /init or /sbin/init complete control of the system (it will run as PID 1). The program should never terminate, or the kernel will panic. Your program is expected to either halt the system or reboot it.

    Your root filesystem should have the necessary devices in /dev, especially /dev/console, /dev/null and /dev/ttyS0. If it doesn't, the pivot_root will not succeed and the system will hang (actually a shell will be started but this will be useless to you unless you have a serial port). The pivot_root will also fail if the directory where the old root is to be mounted, does not exist.

    The purpose of this firmware is slowly changing into one of fallback: whatever fantastic things you want to do on the NAS200, Jac4 can be in your flash ROM waiting until you need it, even if you only use it to flash the standard Linksys firmware back. And you can count on it to start you favorite firmware from your favorite location.

    By now, it's pretty clear that this line of firmwares will probably never have a built-in Torrent, nor an NFS server, nor RSync, nor Amazon S3 backup. It also doesn't make the box fly or float. Other developers have made some of that functionality available elsewhere or it can probably easily be implemented with relatively little effort because the NAS200 is basically a headless PC.

    I may release a few root filesystems for Gentoo or Debian or other distros, but my main goal is to port a standard embedded distro such as OpenWRT to the NAS200, so that all those applications that everyone asks for, will be available by just typing a command on a command line.

    For future versions of the Jac firmware, I don't expect many changes anymore. Perhaps a few more ways to automatically pivot-root into a different file system (from CD-ROM perhaps?), or maybe a way to load a different kernel from hard disk or USB (this should make it possible to run other OS'es too e.g. BSD).

    Of course, suggestions are still welcome, so feel free to either reply to this thread or create a new thread.

  3. nick_1964

    nick_1964 Addicted to LI Member

    Did the upgrade, done in 5 minutes or so.
    All the passwords,including the root,are still there.
    No problem what so ever,changing to this new firmware, now I have to find out what Linksys has changed in this new firmware ;) so gonna try to find the release notes on this one.
    Thanks Jac

    P.s. There are two firmwares version V3.4R79 on the Linksys download page.
    One released on 7/10/2009 and one 06/29/2009 can't see the difference but which one have u used for creating your firmware ?
    The 7/10/2009 release note says it's the V3.4R75 version,while the name says V3.4R79 so seems that Linksys make some mistakes..
  4. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    The info is right there on the page you quoted... When you click on "Versie-informatie", the change list pops up (sorry, there is no Dutch version of the change list).

    According to the change list, they updated the Twonky server to fix problems with the Playstation 3 and they fixed a problem where the NAS wouldn't send an email in some situations.

    Under the hood, they did quite a bit of cleanup in the source tree and it is now clear that the firmware is not made by Linksys but by Sercomm (an OEM producer of NAS hardware and software, among other things). Read about it in the R79 announcement thread elsewhere in this forum.

    The Dutch page has two downloads for bin files but they are probably the same file with a different name (one has ",0" inserted). I remember the first time I downloaded the source tarball it also had ",0" in the file name, but they renamed it later. They must have forgotten to remove the file with the wrong name from the Dutch website. No big deal.

    I used the source tarball to build my firmware, and I downloaded it probably about 2 weeks ago.

    I expect that there really only is one file that's correct, and when you install it, it will show V3.4R79 on the status page. Of course, if you already have my firmware, you don't have to worry about it. :biggrin:

  5. DJ Soulfly

    DJ Soulfly Addicted to LI Member

    I will look forward to read the follow up article what this version does more than Jac3a. I'll have something to do tonight :). Installing a new firmware :tongue:
  6. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    I'm working on the follow-up article, and I'll have it done some time this weekend. The short version is this: old-style rc.d/rc.* scripts and early.sh script works the same; nas200.sh pre-init script works the same but you can now put a root file system on a USB device or on one of your config partitions or in a loop filesystem that will automatically get mounted. To figure it out for yourself, log in through SSH and read /init. That's where everything happens that's new since Jac3a and that's not in the top article yet.

    Sorry about the delay!

  7. psychowood

    psychowood Network Guru Member

    Thanks one more time for you effors, Jac.

    Could you please add the MD5 sum for the firmware file? Since it's not zipped (and checksummed), I'd like to be 100% before reflashing :)
  8. gk7856

    gk7856 Addicted to LI Member

    Is it with the jac4c version possible to copy .<folders> and .<files>?

    With the V3.4R79 version not possible?, using a linux system in some directory's i have .<folders> and .<files> which i want to copy to the NAS200.

    For example with mc (GNU Midnight Commander) and login to nas200 with ftp command i can's copy for example the .gnome2 folder or the .cvsrc file from my user directory to the NAS200.
  9. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    Oops, I meant to put all the md5sums in one place in the article (they were kinda scattered in previous versions) but I forgot to paste them in.

    Fixed now. Thanks!

  10. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    Can you elaborate what you're trying to do? Give an example of a command you're trying to execute? :confused:

  11. dINIs

    dINIs LI Guru Member

    Twice downloaded the bin file. Every time I get md5 checksum



    222434c7807d22533d68baf8ab34f7da (as you provided).

    Could you please re-check yours? Thanks.
  12. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    Oops... I automatically generate the md5 sums as part of the build process (a small makefile that wraps up the bzip files etc) but I must have forgotten to copy the results from my latest build from my virtual Linux machine to my Windows machine, so I copied and pasted the wrong results (from a previous build) into the web page.

    Your md5sum is correct and I corrected the original article.


  13. kazikw1

    kazikw1 Guest

    About additional useful tools

    You're made a lot of good work! Your compilation works stable and fast, there was no any problems with upgrade NAS200.

    I'm not "The Linux Man" so I can't made one simple thing; I need to have an option to from outside (LAN) add to download manager not one step-by-step but i.e. 50 completly links. You know; http://login:password@rapidshare.com/ etc....
    It's my only problem with NAS200. I wrote to Cisco, try to push them for solve (not only) my problem - NAS should allow to upload txt file with links i.e. but there is no answer since 2008.

    Another problem - is there an option to chech who is right now logged in and what is he transffering? If You know the way - please divine Your knowledge with me ;)

    Verry best regards and a lot of time for fun!

    Kazimierz / PL
  14. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    You're welcome!

    The download manager is a closed-source application so I can't change that. Of course if you can find another download manager that runs on x86 Linux, you may be able to run that.

    If you simply want to download one file, you can use the wget command (which is used by the download manager too by the way, I think). And it's not to difficult to write a short script that has a number of wget commands in it, and run it from the SSH command line.

    The problems start when you have a link on a website like Rapidshare where you can't simply download a file using wget, you have to open the page in a web browser (they want you to look at the advertisements), wait for a countdown timer and then click a button. Or you have to log in through a browser and store a cookie that it wants to read back to be able download. Or you can only download a file if you pass the correct referrer (i.e. the URL of the page where the download link is) to the website. Unfortunately, probably all sites where you can download large files are like that and you can't simply use wget there.

    As far as I know, there is no way to do that.

  15. gk7856

    gk7856 Addicted to LI Member

    Is it with the jac4c version possible to copy .<folders> and .<files>?

    Is it with the jac4c version possible to copy .<folders> and .<files>?
    With the V3.4R79 version not possible?, using a linux system in some directory's i have .<folders> and .<files> which i want to copy to the NAS200.

    For example with mc (GNU Midnight Commander) and login to nas200 with ftp command i can's copy for example the .gnome2 folder or the .cvsrc file from my user directory to the NAS200.
  16. emi2m76

    emi2m76 Addicted to LI Member

    thx for your work Jac !
    Why I can't log in in ssh (putty) with the root account whith this version ? Each time the machine answer is : invalid password or something like that...
    Can you help me please, because if I can't log in with ssh I can't configure the telnet access...

    Thanks a lot !
  17. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    If you use FTP, you will not be able to see the hidden files and directories (i.e. the files and directories that start with a '.'). But you can still upload and download them.

    Connected to
    220 FTP server at ready.
    User ( admin
    331 Password please.
    230 User logged in.
    ftp> cd "DISK 1"
    250 OK
    ftp> dir
    200 PORT OK
    150 Data connection established.
    drwxrwxrwx   4 jac      evry1          33 Dec 24  2008 Archives
    drwxrwxrwx   3 jac      evry1          24 Dec 14  2008 Backup
    === 8< snip snip snip 8< ===
    226 Directory list has been submitted.
    ftp: 3892 bytes received in 0.11Seconds 35.06Kbytes/sec.
    ftp> ls
    200 PORT OK
    150 Data connection established.
    === 8< snip snip snip 8< ===
    226 Directory list has been submitted.
    ftp: 776 bytes received in 0.05Seconds 15.22Kbytes/sec.
    ftp> put .test
    200 PORT OK
    150 Data connection established.
    226 File transmission successful.
    ftp: 34 bytes sent in 0.00Seconds 11.33Kbytes/sec.
    ftp> get .test
    200 PORT OK
    150 Data connection established.
    226 File transmission successful.
    ftp: 34 bytes received in 0.00Seconds 34000.00Kbytes/sec.
    ftp> quit
    221 See you later...
    If you use SCP over SSH instead of FTP you will see the hidden files. I'm not familiar with Midnight Commander but if it can do SCP, try that.

    The problem is in the FTP server which skips the files during a directory listing. It's not difficult to fix but it's also not a very big problem and the workaround is easy (just use SCP). I'll consider fixing it in the next release, but I'm afraid I don't have time to release a new version just to fix this problem.

  18. jackito

    jackito LI Guru Member

    Hi Jac,

    One question. From Jac3a announcement:

    I´m trying to do this but I couldn´t find the way to mount /dev/mtdblock1.
    It´s always failing. I already tried mount -t squashfs without success.

    root@NAS200 ~# mount -t squashfs /dev/mtdblock1 /harddisk/volume_3/conf/my_root_fs
    mount: Mounting /dev/mtdblock1 on /harddisk/volume_3/conf/my_root_fs failed: No such device or address
    What Am I missing here?
    Thanks in advance!
  19. jackito

    jackito LI Guru Member

    As you probably already know, there is a well known download manager for this web services: JDownloader.
    I already checked, and it´s running on GNU/Linux also. The problem is that it requires an X server to run :eek:. So I automatically discard it since it´s insane to run X on the lame NAS200 hardware.
    I´m searching for alternatives that runs from the command line (like ctorrent for BitTorrent) but I didn´t find anything yet.
    If I found something and I can make it work on the NAS200 for sure I will share it with the community. :)
  20. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    Is this the first version of my firmware that you installed? If so, the root password should be set to "root" (without the quotes). If you were running a previous version of my firmware, the root password is unchanged from what it was before.

    If you don't know your root password and you want to reset it, just write a short script to reset it, and put it in your rc.d directory:

    # Name this "rc.resetroot" and place in the "rc.d" directory in the 
    # root directory of one of your hard disks (DISK 1 or DISK 2 shares)
    egrep "^root:" /etc.default/passwd >/etc/x
    egrep -v "^root:" /etc/passwd >>/etc/x
    mv /etc/x /etc/passwd
    for x in 1 2 3 4 5 6;do cp /etc/passwd /harddisk/volume_$x/conf;done
    rm $0
    Turn the unit off with the power button (you will hear a beep and after a short time the lights will go off). Then turn the power back on.

    This will reset the password to "root" (without quotes). Don't forget to log in through SSH, change the password again and copy /etc/passwd to the config partition as instructed in the article.

  21. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    Oops, I admit I didn't test this part of the article...
    Try this:

    mount -t squashfs -o ro /dev/rom1 /harddisk/volume_3/conf/my_root_fs
  22. jackito

    jackito LI Guru Member

    I already tried that but instead of -o ro I used -r. I though it was the same but it seems not since -o ro is working and -r didn´t work. :)
    Thanks Jac!
  23. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    Of course even if you don't have an X server on the same machine, you can still use the program but you will have to make it connect to an external X server by setting your DISPLAY (e.g. "DISPLAY=myterminal:0.0 jdownloader" or something). Of course if it needs to be connected to an X server to work, you will have to leave your computer running which kinda defeats the purpose of having JDownloader on a NAS. :rolleyes:

    Anyway, I haven't tried JDownloader at all but I expect that it's difficult to get running and probably won't perform very well on the NAS200 because it's written in Java.

    Maybe someone (you?) should start a new project that does the same thing as JDownloader does, but uses a web page as user interface and doesn't need a lot of memory or processing power. I bet that could be a popular program because this is probably something many people would like to do with their routers.

  24. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    Heh I don't know why -o ro came up in my mind instead of -r... If I would have tried -r first and it wouldn't have worked, I would have been just as confused as you :rolleyes:.

  25. jackito

    jackito LI Guru Member

    Hi Jac,

    I´m planning to create a root-fs in a file that can be loop-mounted. This new root-fs will have the latest busybox version, iSCSI, BitTorrent and a few more things already setup, out of the box, that maybe other people can find interesting.
    Before starting with this "project" (I will start a new thread as soon as I have everything in place) I have some questions for you, my master jejeje

    What about the guys like me that have a RAID-1? As you know the conf partition for this setup is normally /harddisk/volume_3/conf.
    And what about the guys like me that use ext2 instead of XFS?
    In summary, is it possible to make jac4 to search also in the configuration partition of a RAID-1 device with ext2?
    And the last question, maybe this one is really stupid, will the "new" root fs, after "pivot_rooting", be writable or it´s going to be read-only?

    As always thank you very much!
  26. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    That shouldn't be a problem. At the time that my pre-init script looks for your root file system blob, nothing is mounted yet. I just mount it on a temporary location to "work my magic" and then I pivot the root. I don't touch the data partitions so that in case of a raid configuration, nothing will get damaged or lost. I forgot that in RAID configs, the config partitions normally get mounted on volume_3 instead of volume_1, you can safely ignore that because it's not applicable at pre-init time.

    As far as I can tell, the configuration partition is always XFS, no matter how your data partitions are configured. If I'm wrong, let me know and I'll correct my scripts as soon as I can.

    I believe so, yes: once again, as far as I know, the config partitions are always formatted in XFS and are never RAIDed. Let me know if I'm wrong.

    If I am wrong, you will just have to use a USB stick until I correct the problem.

    If you use squashfs, it will be read-only (squashfs is always read-only, it's the nature of the file system). Otherwise, your root directory will be writeable.

  27. jackito

    jackito LI Guru Member

    Jac, this is the output of mount in my NAS200:

    root@NAS200 ~# mount
    /dev/rom1 on / type squashfs (ro)
    none on /proc type proc (rw)
    none on /etc type ramfs (rw)
    none on /var type ramfs (rw)
    none on /harddisk type ramfs (rw)
    none on /tmp type ramfs (rw)
    none on /dev type ramfs (rw)
    none on /mnt type ramfs (rw)
    /dev/md0 on /harddisk/volume_3/data type ext2 (rw,usrquota)
    /dev/md1 on /harddisk/volume_3/conf type ext2 (rw)
    As you can see "configuration" partitions are ext2 and in RAID-1 configuration also.
    I will think about using the USB stick then... :tongue:

  28. emi2m76

    emi2m76 Addicted to LI Member


    Why it doesn't want log in ? Can you explain me please ?...
  29. jotabe

    jotabe Guest

    Then 'conf' partition is mounted as ext2, but there is no real ext2 partition. You mount the /dev/md1 RAID volume, build from the real partitions.

    In my box (RAID+xfs):
    $ fdisk -l
    Disk /dev/sda: 255 heads, 63 sectors, 121601 cylinders
    Units = cylinders of 16065 * 512 bytes
       Device Boot    Start       End    Blocks   Id  System
    /dev/sda1             1    121556 976398538+  fd  Linux raid autodetect
    /dev/sda2        121557    121586    240975   fd  Linux raid autodetect
    /dev/sda3        121587    121601    120487+  82  Linux swap
    Disk /dev/sdb: 255 heads, 63 sectors, 121601 cylinders
    Units = cylinders of 16065 * 512 bytes
       Device Boot    Start       End    Blocks   Id  System
    /dev/sdb1             1    121556 976398538+  fd  Linux raid autodetect
    /dev/sdb2        121557    121586    240975   fd  Linux raid autodetect
    /dev/sdb3        121587    121601    120487+  82  Linux swap
    sda2 & sdb2 are raid type partitions. The binary rc.bootbin build the RAID and then mount the result as xfs or ext2.

    You can do the same by hand:
    mdadm -A /dev/md1 /dev/sda2 /dev/sdb2
    mount -t xfs /dev/md /harddisk/volume_3/conf
    In fact the script /init fail to mount sda2 or sdb2 with type xfs. Also fail the script rc.sysinit when try the mount to locate the early.sh script...
  30. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member


    /me goes back to drawing board... :wall:

    You and your &^#@!$ RAID ... :tongue::rolleyes::eek::confused::redface:

  31. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    From your picture I can tell... that you're using the correct IP address and that the SSH server is working, and that you're typing the wrong password... It doesn't say what password you typed and it doesn't give me any information on how you got to this situation, so no I don't know why it doesn't want to log in just from the info that you're giving me.

    If you never used any version of my firmware before you installed Jac4, your root password is "root" (without the quotes).

    If you ever used any version of my firmware before, the root password is what you last set it to. If you never set it (i.e. if you always used Telnet before), the root password is set to the Linksys default (which is unknown) and you will have to reset it using a startup script.

    If you were able to log in before and changed your password but forgot to copy the /etc/passwd file to the config partition, it's set to "root" again.

    And finally if you are using RAID, the script copied the /etc/passwd file to the wrong partition (see my conversation with Jackito above) and the password was reset to the unknown Linksys password.

    If you want to reset your root password to "root", you can use a script that I posted on several earlier occasions (again, if you're using RAID, you'll have to copy the /etc/passwd file to /harddisk/volume_3/conf instead of /harddisk/volume_1/conf), or you can restore the accounts to the defaults through the web interface.

  32. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    Right. But I seem to remember doing a test a long time ago that showed that the config partition was always XFS. And they are, on my system which is in Separate Disks mode with one disk in XFS and the other in ext2.

    Thanks for those commands, I could never get through the mdadm documentation before, it just gets too tedious and as I mentioned before, I don't believe in RAID, I believe in backups.

    I guess I should really take some time and throw rc.bootbin through a disassembler to find out what it's doing exactly. I'm sure everything it does can be emulated with shell commands.

    Yup. At least those don't cause any damage and you can still use USB. But I think the rc.dropbear script will never reset the password if you're in RAID mode and that is a problem :mad:

  33. jackito

    jackito LI Guru Member

    We will see jac4a anytime soon? LOL
    Come on Jac you are inspiring a lot of people, be happy! :biggrin:
  34. jackito

    jackito LI Guru Member

    Sorry Jac but I found another problem:

    In fact the firmware is mounting the devices in the opposite way:

    USB port 1 = vfat
    USB port 2 = ext2

    You should correct the announcement. :)
  35. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    I'm not really as angry as it seems, just a little frustrated... I thought I tested pretty much everything (as far as I could -- I don't have two spare hard disks laying around to test RAID) and now it looks like I made an error that I should have found in Jac2... It's just the embarrassing feeling of the eggs in my face.

    Don't worry, I'm not giving up, I'm still having fun and I'll probably fix the problem this weekend. Maybe I'll run the next update by you first before I release it. I'll even name the new release after you -- Jackito4a? Nah that's too long, I'll abbreviate it to Jac4a :biggrin:

  36. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    The port that gets tested first is /dev/sdc which is the one that's closest to the edge; according to the Linksys manual I just downloaded that's port 2. I'm pretty sure I got that right but after that RAID blunder I'm not sure of anything anymore of course...

  37. jackito

    jackito LI Guru Member

    I just checked in the back of the box.

    USB Port 1 is the one next to the right-edge (SDC)
    USB Port 2 is the one next to the ethernet port (SDD)

    So, watching the box from the back is like this:

    PowerBtn - PowerCnx - Ethernet - USB2 - USB1 - ResetBtn.

  38. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    Crap. You're right, the manual must have been printed from earlier designs and they must have switched the ports somewhere along the line. I'll change the article...

  39. matt276

    matt276 Addicted to LI Member


    I have the same problem than emi2m76. root password root don't work for ssh.
    I have tried to restore with web gui without result.
    You suggest to use a script but i have no access to put the script.
    I will try to use jac2b firm to force pasword.

  40. alejandro_liu

    alejandro_liu Addicted to LI Member

    I though sdc was simply the first USB drive that was connected (regardless of being the left or right).
  41. jackito

    jackito LI Guru Member

    Maybe, when you have only one USB drive connected is working like that.
    When you have two of them connected at the same time, at least in my case, it´s not. :confused:
  42. DJ Soulfly

    DJ Soulfly Addicted to LI Member

    Just a thought is it possible to make/adjust a swap file with jac4? If so how can i do this?
  43. alejandro_liu

    alejandro_liu Addicted to LI Member

    Yea sure, just create a file of the size of the swap that you want then you do from the command line:

    mkswap path-to-file
    swapon path-to-file
  44. baudy2

    baudy2 LI Guru Member

    I use NAS200 in RAID1 configuration with 2x1TB disks. Just installed latest JAC4 firmware and cannot access via SSH using the password "root". Tried to use a reset script (rc.resetroot) and it does not do the job - i still cannot access the box - password invalid. Is it possible to run a telnetdaemon from the startup and then access the box via telnet ? In fact, i need to copy complete content directly from NAS200 to USB drive but the network copying is damn slow for approx. 900Gb content. Can do it only via telnet/SSH.
    Can anybody help ?
  45. emi2m76

    emi2m76 Addicted to LI Member

    We are 3 in the same case, I'm using the Jac's firmwares since the Jac2b and it's the first time with a Jac's firmware I can't use telnet... Help us Jac please !!! :wink::)
  46. jackito

    jackito LI Guru Member

    From Jac´s announcement (RTFM):

    Of course you can´t access the NAS200 through SSH, so create a script that runs this command on startup, reboot the box wait for it to finish rebooting and then reboot the box. After the second reboot, Telnet access should be enabled.

    Script "rc.enabletelnet" example:

    /bin/touch /harddisk/volume_X/conf/allow_telnetd
    Please replace the X in "volume_X" with the correct number depending on your discs configuration (ie: 3 = RAID1).
  47. baudy2

    baudy2 LI Guru Member

    Works perfectly now !

    I was just stupid not to replace "volume_1" to "volume_3" for my RAID1 in your reset SSH root password script.

    Thanx !
  48. baudy2

    baudy2 LI Guru Member

    NOw another question - is it possible to mount external USB drive with MacOS HFS+ filesystem ?
  49. jackito

    jackito LI Guru Member

    As far as you have the kernel module for this kind of FS, it should be possible.
    I´m not sure and I can´t check right now if this FS kernel module is included in Jac´s extrafs tarball for jacX firmware. Maybe you should download the tarball and check it by yourself (check jac4 announcement for the download link). :wink:
  50. baudy2

    baudy2 LI Guru Member

    No, it is not there. Looking forward to have it... :wink:
  51. gigamegawatts

    gigamegawatts Addicted to LI Member

    This is a tremendously useful upgrade to the NAS200, promoting it from a so-so NAS to a Linux headless PC. Thanks for all your hard work, Jac!

    A couple of questions:
    1. Is it possible to use public key authentication with the dropbear SSH server (without modifying the firmware)?
    2. Generally speaking, how would I modify the files in the /etc folder and subfolders? Does that require loading a custom version of the firmware?


  52. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    You're welcome!

    It should be possible to do public key authentication with Dropbear, but I don't know how to do it so I'm afraid I have to refer you to the Dropbear documentation to set it up. FYI: The Dropbear that runs on Jac4 is version 0.49. I think it should be possible with a custom rc.d script.

    The /etc folder is mounted in RAM at system startup. The startup scripts then create symlinks for everything in /etc.links and copy everything in /etc.default. Then, the rc.bootbin (closed source) program writes a number of files to it, such as the passwd file and all the files necessary to start the network. I recommend studying the startup scripts in /etc/rc.d to see how everything works, starting with rc.sysinit and rc.0. The rc.0 script runs the user startup scripts and then runs rc.1, so you can write a user rc.d script to copy and modify the built-in scripts before they get started.

  53. psychowood

    psychowood Network Guru Member

    Hi Jac,
    I've got a problem, probably caused by something stupid I did before upgrading Jac3 to Jac4 :redface:

    When I try to connect via ssh, all I get is a "connection closed" error. I know the password is correct, ssh -vv post login output is:
    debug2: we sent a password packet, wait for reply
    debug1: Authentication succeeded (password).
    debug1: channel 0: new [client-session]
    debug2: channel 0: send open
    debug1: Requesting no-more-sessions@openssh.com
    debug1: Entering interactive session.
    debug2: callback start
    debug2: client_session2_setup: id 0
    debug2: channel 0: request pty-req confirm 1
    debug2: channel 0: request shell confirm 1
    debug2: fd 3 setting TCP_NODELAY
    debug2: callback done
    debug2: channel 0: open confirm rwindow 8000 rmax 8000
    debug2: channel_input_confirm: type 99 id 0
    debug2: PTY allocation request accepted on channel 0
    debug2: channel_input_confirm: type 99 id 0
    debug2: shell request accepted on channel 0
    debug2: channel 0: rcvd eof
    debug2: channel 0: output open -> drain
    debug2: channel 0: obuf empty
    debug2: channel 0: close_write
    debug2: channel 0: output drain -> closed
    debug2: channel 0: rcvd close
    debug2: channel 0: close_read
    debug2: channel 0: input open -> closed
    debug2: channel 0: almost dead
    debug2: channel 0: gc: notify user
    debug2: channel 0: gc: user detached
    debug2: channel 0: send close
    debug2: channel 0: is dead
    debug2: channel 0: garbage collecting
    debug1: channel 0: free: client-session, nchannels 1
    Connection to nas200 closed.
    When I try via SCP, the error is
    Error skipping startup message. Your shell is probably incompatible with the application (BASH is recommended).
    EDIT: It seems that the previous error is a generic WinSCP error :)

    Here is the post login log for WinSCP:

    Started a shell/command
    Using SCP protocol.
    Doing startup conversation with host.
    Skipping host startup message (if any).
    Sent 36 bytes
    There are 0 bytes remaining in the send buffer
    Looking for network events
    Timeout waiting for network events
    Sent 1 bytes
    There are 0 bytes remaining in the send buffer
    Looking for network events
    Timeout waiting for network events
    echo "WinSCP: this is end-of-file:0"
    Waiting for another 1 bytes
    Looking for incoming data
    Looking for network events
    Detected network event
    Enumerating network events for socket 520
    Enumerated 1 network events making 1 cumulative events for socket 520
    Handling network read event on socket 520 with error 0
    Waiting for another 1 bytes
    Looking for incoming data
    Looking for network events
    Detected network event
    Enumerating network events for socket 520
    Enumerated 1 network events making 1 cumulative events for socket 520
    Handling network read event on socket 520 with error 0
    Server sent command exit status 1
    Selecting events 0 for socket 520
    Disconnected: All channels closed
    (ESshFatal) Connection has been unexpectedly closed. Server sent command exit status 1.
  54. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    The most common cause for this is that your root account doesn't have a valid home directory. The shell won't start and the connection will be closed right away.

    You will have to write a script to reset the root entry in the /etc/passwd file. Don't forget to copy the /etc/passwd file to your config partition after you do that (/harddisk/volume_#/conf where # is 1 for Separate Disks mode or 3 for RAID mode).

  55. gigamegawatts

    gigamegawatts Addicted to LI Member

    Public key authentication for dropbear

    I just wanted to confirm that public key authentication works well.

    It appears that dropbear requires that the keys be stored in a folder named .ssh in the user's home directory. Since this would be the root directory, and I wasn't able to create a new directory in the root (got a "read only file system" error), I configured it as follows.

    Caveat: I have only a working knowledge of Linux, so better configurations probably exist. The approach I took was to change the home directory of the root user. If you do this incorrectly you might lock yourself out of SSH (I did). So, I would recommend that you temporarily enable Telnet before doing this, by following the instructions in Jac's notes. If you forget to do this (I did), then you should enable Telnet by creating the login script described in jackito's poast
    http://www.linksysinfo.org/forums/showpost.php?p=351314&postcount=46. I don't recommend that you try to fix the error by restoring your earlier settings using the web interface -- for me, this seemed to change the root password to an unknown value.

    1. Create an "authorized_keys" file with your public keys, and put it in a directory named /harddisk/volume_1/data/.ssh/. Dropbear requires the keys in this file to be in OpenSSH format - each key should be on a separate line, beginning with "ssh-rsa".

    2. Follow the instructions in Jac's notes to make the /etc directory writable by adding a startup script.

    3. Create a new rc.10drop script in /harddisk/volume_1/data/rc.d with the following commands:

    mkdir /etc/root
    mkdir /etc/root/.ssh
    cp -a /harddisk/volume_1/data/.ssh/authorized_keys /etc/root/.ssh

    4. Edit the /etc/passwd file (back up the file first!) to change the home directory for root to /etc/root (and copy the passwd file to /harddisk/volume_1/conf to save the change). The 1st line of the passwd file should look like this:


    After rebooting, you should find that you can login using public authentication rather than a password.

    If you are going to make your box accessible through the Internet, then you might want to also disable password-only logins to SSH to prevent an automated password cracker from getting in. To do that, you need to add a "-s" parm to the dropbear command line:

    1. Copy /etc/rc.dropbear to /harddisk/volume_1/data, and edit the last line to add the "-s" parm:

    echo ssh stream tcp nowait root ${dropbearspath}/dropbear -i -s >>/etc/inetd.conf

    2. Add a new line to the end of /harddisk/volume_1/data/rc.d/rc.10drop:

    cp /harddisk/volume_1/data/rc.dropbear /etc/rc.d

    Don't forget to disable Telnet logins again when you are through!
  56. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    Great info, gigamegawatts! Thanks!

  57. DJ Soulfly

    DJ Soulfly Addicted to LI Member

    Ok I've made a swap file like this on my data folder :

    dd if=/dev/zero of=swap bs=1024 count=1048576
    mkswap swap
    swapon swap
    I checked if the swap file correctly was set up with the command "free" and it was showing correctly the free amount of memory. But after a restart it no longer sets up the swap file I want to use so I created another startup script which allows me to enjoy the large swap if I would reboot the NAS200.

    # rc.swap
    cd /harddisk/volume_3/data/
    swapon swap
    This works for my perfectly now. My NAS200 doesn't crash anymore with amule running which consumed my memory.
  58. Vlad

    Vlad Addicted to LI Member

    Jac, thanks a lot for the release. Works perfect!
    Just a question: is it possible to run a simple DNS on the nas?
  59. jackito

    jackito LI Guru Member

    Hi Jac,

    Quick and simple question:

    Can you post the configure options that you used for dropber (ie: --disable-utmp)?

    Thanks in advance!
  60. jackito

    jackito LI Guru Member

    Of course it´s possible.
    In fact with the new busybox (1.14.3) you can run dnsd.
    Check it out.
  61. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    I built the dropbear a long time ago when I worked on Jac0. The build directory is on another computer that doesn't work anymore.

    I built it using Gentoo Portage, and all I can remember is that I used the USE-flag to enable the single binary and (I think) static linking. I'm sure the Jac0 thread has more information...

    I know, according to GPL I should be redistributing the source code and it would be nice if I had integrated it into the Linksys/Sercomm build system but I just haven't gotten around to it and it's very low priority (after all, Dropbear works). I would also like to add SFTP since that's what most client programs seem to like best, but that is also a long-term wish.

    I'm trying to find some time to fix the RAID problems and to make it easier to change the root password and maybe some other stuff, but I'm traveling this weekend so once again I'm not able to work on the project... Maybe some time this week or next weekend.

  62. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    I already answered this question on page 3, but I just noticed that the reason why you should use /dev/rom1 instead of /dev/mtdblock1 is that the /dev/mtdblock* nodes have the wrong major number: 131 instead of 31. The /dev/rom* nodes have the right numbers.

    Just so you know.

    And in case you're wondering: major 131 is used by the sd driver (try cat /proc/devices)

  63. adrianovrm

    adrianovrm Addicted to LI Member

    change ssh port 22 to 8122

    Good Night,

    L need a simply aid at nas200 with jac4 firmware. how to change ssh listen port from 22 to 8122 for example.

    Thanks in advance...
  64. adrianovrm

    adrianovrm Addicted to LI Member

    other problem : l have enabled telnet with the touch command teached at the begin of this thread. now, how can l disable telnet and how to change the port of telnet :
  65. adrianovrm

    adrianovrm Addicted to LI Member

    l ~d to change the scp port too . 22 to any other. how to Ç
  66. pema

    pema Addicted to LI Member

    Some newby questions

    Hi Jac and Folks,

    Thx 4 your neat efforts to improve NAS200. I wish I can help you all in the future. :)

    I have been following this forum during the last 10 days as an anonymous reader, and learned a lot about the equipment. Right now, I have jac4 fw installed and running ok on my NAS. At least ssh, which I tested well, is running nice. :wink:

    But of course I have some problems, which I will list below:

    1. I followed page 1 of this very thread trying to update twonky media server, but could not access its web page as of now. So I think it was not updated. Folder /harddisk/volume_3/data/rc.d/twonky5/ has been created and unzipped files and structure are already inside it, but I think I am missing something here. Already rebooted NAS some times but nothing different happens. I keep receiving the same "red" message at http://NAS:9000, as follows:

    "Access is restricted to MediaServer configuration!"

    I'd like to understand what triggers the installation of the new version of twonky, as I think this is not triggering fine...

    2. I am trying to customize root and user shells, creating ".profile" files to them. For ssh users this works fine, but not for root, because its home folder "/" is RO. Following ideas from around here, I created "/etc/root" folder and pointed root to this folder at /etc/passwd file. Worked fine until reboot, after reboot the "/etc/root" folder was deleted... My question here is: how can I create a home folder for root which could be permanent even after rebooting NAS?

    I appreciate any help, thank you.
  67. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    If you log in through ssh while Twonky is running, and type the "ps ax" command, you should see a number of processes running from the /harddisk/volume_3/data/rc.d/twonky5 directory. If that is the case, you probably just forgot to change the "enableweb=1" to "enableweb=2" in the ini file. If not, please post the output of "ps ax" and "ls -laR /harddisk/volume_3/data/rc.d/twonky5" and we'll take a look.

    The "magic" that does the automatic run of the updated Twonky is in /etc/rc.d/twonkymedia.sh. To be precise, it's in the for-loop near the beginning of that script. Basically, it checks if it can find a directory under rc.d with a name that starts with twonky, and if so, it checks that there is a file "twonkymediaserver" and (optionally) a file "twonkyvision-mediaserver.ini". If they are found, their locations replace the default location which is in /etc.

    The /etc/root folder gets wiped because /etc is mounted in RAM and is built from scratch each time the system boots. If you are fixed on having /etc/root as your home directory, you will have to create a script that re-creates this location and everything in it at boot time. It might be easier to just change root's home directory to /harddisk/volume_3/data instead...

  68. pema

    pema Addicted to LI Member

    Twonky5 problem

    Thx for the reply. Actually, I confirmed that original version is running, instead of twonky5 :confused:

    Follows the 'ps ax and ls...' output:

    $ ps ax
      PID  Uid     VmSize Stat Command
        1 root        500 S   init       
        2 root            SWN [ksoftirqd/0]
        3 root            SW  [watchdog/0]
        4 root            SW< [events/0]
        5 root            SW< [khelper]
        6 root            SW< [kthread]
       40 root            SW< [kblockd/0]
       41 root            SW< [ata/0]
       42 root            SW< [ata_aux]
       43 root            SW< [ksuspend_usbd]
       46 root            SW< [khubd]
       48 root            SW< [kseriod]
       73 root            SW  [pdflush]
       74 root            SW  [pdflush]
       75 root            SW< [kswapd0]
       76 root            SW< [aio/0]
       77 root            SW< [xfslogd/0]
       78 root            SW< [xfsdatad/0]
      209 root            SW< [scsi_eh_0]
      210 root            SW< [scsi_eh_1]
      229 root            SW  [mtdblockd]
      271 root            SW< [kmmcd]
      277 root            SW< [md1_raid1]
      281 root            SW< [md0_raid1]
      457 root        300 S   lld2d eth0 
      499 root            SW< [xfsbufd]
      500 root            SW< [xfssyncd]
      587 root            SW< [xfsbufd]
      588 root            SW< [xfssyncd]
      703 root        572 S   down_manager 2>/dev/null 
      724 root        816 S   upnpd &>/dev/null 
      731 root        456 S   CheckHDDPower 
      754 root        816 S   upnpd &>/dev/null 
      755 root        816 S   upnpd &>/dev/null 
      757 root        816 S   upnpd &>/dev/null 
      759 root        816 S   upnpd &>/dev/null 
      760 root        816 S   upnpd &>/dev/null 
      761 root        892 S   /usr/sbin/thttpd -C /etc/thttpd.conf 
      778 root        212 S   /usr/sbin/download 
      784 root        416 S   /usr/sbin/inetd 
      789 root        616 S   /usr/sbin/QuickSet 
      791 root        420 R   /usr/sbin/USB_Detect 
      792 root        496 S   /usr/sbin/USB_Detect 
      796 root        308 S   /usr/sbin/ResetButton 
      798 root        352 S   /usr/sbin/PowerButton 
      800 root        492 S < /usr/sbin/backup_button 
      802 root        440 S   /usr/sbin/do_umount 
      804 root        172 S < /usr/sbin/USBButton 
      828 root        524 S   /usr/sbin/crond 
      865 root        348 S   /usr/sbin/init_media 
      871 root        464 S   sh -c /etc/rc.d/twonkymedia.sh start >/dev/null 2>&1 
      872 root        516 S   /bin/sh /etc/rc.d/twonkymedia.sh start 
      883 root       1192 S   /etc/twonkymediaserver -inifile /etc/twonkyvision-med
      893 root       1192 S   /etc/twonkymediaserver -inifile /etc/twonkyvision-med
      894 root       1192 S   /etc/twonkymediaserver -inifile /etc/twonkyvision-med
      895 root       1192 S   /etc/twonkymediaserver -inifile /etc/twonkyvision-med
      898 root       1192 S   /etc/twonkymediaserver -inifile /etc/twonkyvision-med
      899 root       1192 S   /etc/twonkymediaserver -inifile /etc/twonkyvision-med
      900 root       1192 S   /etc/twonkymediaserver -inifile /etc/twonkyvision-med
      902 root       1192 S   /etc/twonkymediaserver -inifile /etc/twonkyvision-med
      909 root        384 S   /usr/sbin/CheckHDDDrive 
      912 root       1192 S   /etc/twonkymediaserver -inifile /etc/twonkyvision-med
      922 root       2632 S   /usr/sbin/smbd -D 
      924 root       2100 S   /usr/sbin/smbd -D 
      926 root       2188 S   /usr/sbin/nmbd -D 
      928 root        252 S   init       
      929 root       1060 S   /usr/sbin/dropbear -i 
      930 root        672 S   -sh 
      931 root        628 R   ps ax 
    $ pwd
    $ ll /
    drwxr-xr-x    2 root     root          534 Jul 22 02:24 bin
    drwxr-xr-x    3 root     root            0 Aug  7 01:02 dev
    drwxr-xr-x    7 root     root            0 Oct 13 11:18 etc
    drwxr-xr-x    6 root     root          413 Jul 22 01:24 etc.default
    drwxr-xr-x    4 root     root          171 Jul 22 02:28 etc.links
    drwxr-xr-x    8 root     root            0 Aug  7 01:02 harddisk
    drwxr-xr-x    3 root     root           22 Dec  3  2004 home
    -rwxr-xr-x    1 root     root         2511 Aug  7 01:00 init
    drwxr-xr-x    2 root     root         2999 Aug  9 20:23 lib
    drwxr-xr-x    5 root     root            0 Aug  7 01:02 mnt
    dr-xr-xr-x   81 root     root            0 Aug  7 01:02 proc
    -rwxr-xr-x    1 root     root          215 Jul 28 01:48 rc
    drwxr-xr-x    2 root     root          355 Aug  9 20:23 sbin
    drwxr-xr-x    2 root     root            3 Oct 20  2006 share
    drwxrwxrwx    2 root     root            0 Oct 13 11:18 tmp
    drwxr-xr-x    2 root     root            3 Dec 26  2004 upload
    drwxr-xr-x    8 root     root           77 May 30  2007 usr
    drwxr-xr-x    6 root     root            0 Aug  7 01:02 var
    $ ls -laR /harddisk/volume_3/data/rc.d/twonky5
    drwxrwxrwx    5 root     root         4096 Oct 11 15:10 .
    drwxrwxrwx    3 root     root           20 Oct 13 11:17 ..
    -rw-rw-r--    1 root     root         2649 Oct 11 13:03 Linux-HowTo.txt
    -rw-rw-r--    1 root     root          138 Oct 11 13:03 ORI-twonkymedia-server-default.ini.ORI
    -rw-rw-r--    1 root     root        37378 Oct 11 13:03 RevisionHistory
    drwxrwxrwx    2 root     root         4096 Oct 11 13:03 cgi-bin
    -rw-rw-r--    1 root     root          134 Oct 11 13:03 initial_keystore.dat
    -rw-rw-r--    1 root     root          219 Oct 11 13:03 mediafusion_keystore.dat
    drwxrwxrwx    2 root     root          127 Oct 11 13:03 plugins
    -rw-rw-r--    1 root     root          421 Oct 11 13:03 radio.m3u
    drwxrwxrwx    3 root     root         4096 Oct 11 13:03 resources
    -rwxrwxr-x    1 root     root         4852 Oct 11 13:03 twonkymedia
    -rwxrwxr-x    1 root     root         3775 Oct 11 13:03 twonkymedia.sh
    -rwxrwxr-x    1 root     root       689012 Oct 11 13:03 twonkymediaserver
    -rw-rw-r--    1 root     root         6428 Oct 11 13:31 twonkyvision-mediaserver.ini
    drwxrwxrwx    2 root     root         4096 Oct 11 13:03 .
    drwxrwxrwx    5 root     root         4096 Oct 11 15:10 ..
    -rwxrwxr-x    1 root     root          190 Oct 11 13:03 any-mp3.desc
    -rwxrwxr-x    1 root     root          195 Oct 11 13:03 audtranscode-mp3.desc
    -rwxrwxr-x    1 root     root           41 Oct 11 13:03 audtranscode.location
    -rwxrwxr-x    1 root     root      3375892 Oct 11 13:03 convert
    -rwxrwxr-x    1 root     root          180 Oct 11 13:03 convert-jpeg.desc
    -rwxrwxr-x    1 root     root        25644 Oct 11 13:03 convert-readme.txt
    -rwxrwxr-x    1 root     root           28 Oct 11 13:03 convert.location
    -rwxrwxr-x    1 root     root          158 Oct 11 13:03 dsat-wav-mp3.desc
    -rwxrwxr-x    1 root     root          161 Oct 11 13:03 dsat-wma-mp3.desc
    -rwxrwxr-x    1 root     root          144 Oct 11 13:03 dstflv-mp4-flv.desc
    -rwxrwxr-x    1 root     root          145 Oct 11 13:03 dstflv-mpg-flv.desc
    -rwxrwxr-x    1 root     root          150 Oct 11 13:03 dstflv-msvideo-flv.desc
    -rwxrwxr-x    1 root     root          149 Oct 11 13:03 dstflv-wmv-flv.desc
    -rwxrwxr-x    1 root     root          158 Oct 11 13:03 dsvt-mpg-mp4.desc
    -rwxrwxr-x    1 root     root          161 Oct 11 13:03 dsvt-wmv-mp4.desc
    -rwxrwxr-x    1 root     root          215 Oct 11 13:03 ffmpeg-asf-flv.desc
    -rwxrwxr-x    1 root     root          210 Oct 11 13:03 ffmpeg-avi-flv.desc
    -rwxrwxr-x    1 root     root          188 Oct 11 13:03 ffmpeg-flv-mpg.desc
    -rwxrwxr-x    1 root     root          216 Oct 11 13:03 ffmpeg-mov-flv.desc
    -rwxrwxr-x    1 root     root          210 Oct 11 13:03 ffmpeg-mp4-flv.desc
    -rwxrwxr-x    1 root     root          211 Oct 11 13:03 ffmpeg-mpg-flv.desc
    -rwxrwxr-x    1 root     root          212 Oct 11 13:03 ffmpeg-mpg-wmv.desc
    -rwxrwxr-x    1 root     root          216 Oct 11 13:03 ffmpeg-msvideo-flv.desc
    -rwxrwxr-x    1 root     root          215 Oct 11 13:03 ffmpeg-wmv-flv.desc
    -rwxrwxr-x    1 root     root            9 Oct 11 13:03 ffmpeg.location
    -rwxrwxr-x    1 root     root          167 Oct 11 13:03 flac-wav.desc
    -rwxrwxr-x    1 root     root          653 Oct 11 13:03 jpeg-scale.desc
    -rwxrwxr-x    1 root     root          175 Oct 11 13:03 lame-mp3-wav.desc
    -rwxrwxr-x    1 root     root          340 Oct 11 13:03 mencoder-mpg-divx.desc
    -rwxrwxr-x    1 root     root          711 Oct 11 13:03 mencoder-mpg-xvid.desc
    -rwxrwxr-x    1 root     root          411 Oct 11 13:03 mencoder-wmv-pal.desc
    -rwxrwxr-x    1 root     root           25 Oct 11 13:03 mencoder.location
    -rwxrwxr-x    1 root     root          184 Oct 11 13:03 mplayer-ogg-wav.desc
    -rwxrwxr-x    1 root     root           25 Oct 11 13:03 mplayer.location
    -rwxrwxr-x    1 root     root        19026 Oct 11 13:03 overview.gif
    -rwxrwxr-x    1 root     root          148 Oct 11 13:03 pvtranscoder-wmv-avi.desc
    -rwxrwxr-x    1 root     root         9187 Oct 11 13:03 transcoding.html
    -rwxrwxr-x    1 root     root          283 Oct 11 13:03 vlc-flv-mp4.desc
    -rwxrwxr-x    1 root     root          279 Oct 11 13:03 vlc-flv-mpeg2.desc
    -rwxrwxr-x    1 root     root          266 Oct 11 13:03 vlc-flv-wmv.desc
    -rwxrwxr-x    1 root     root          285 Oct 11 13:03 vlc-mov-mpeg2.desc
    -rwxrwxr-x    1 root     root          256 Oct 11 13:03 vlc-wma-mp3.desc
    -rwxrwxr-x    1 root     root           29 Oct 11 13:03 vlc.location
    -rwxrwxr-x    1 root     root          326 Oct 11 13:03 whs-ffmpeg-mov-mov.desc
    -rwxrwxr-x    1 root     root          324 Oct 11 13:03 whs-ffmpeg-mov-wmv.desc
    -rwxrwxr-x    1 root     root          327 Oct 11 13:03 whs-ffmpeg-mpg-mov.desc
    -rwxrwxr-x    1 root     root          325 Oct 11 13:03 whs-ffmpeg-mpg-wmv.desc
    -rwxrwxr-x    1 root     root          331 Oct 11 13:03 whs-ffmpeg-wmv-mov.desc
    -rwxrwxr-x    1 root     root          329 Oct 11 13:03 whs-ffmpeg-wmv-wmv.desc
    drwxrwxrwx    2 root     root          127 Oct 11 13:03 .
    drwxrwxrwx    5 root     root         4096 Oct 11 15:10 ..
    -rwxrwxr-x    1 root     root        82492 Oct 11 13:03 itunes-import
    -rwxrwxr-x    1 root     root          180 Oct 11 13:03 itunes-import.plugin
    -rwxrwxr-x    1 root     root       157396 Oct 11 13:03 mediafusion-integration-plugin
    -rwxrwxr-x    1 root     root          233 Oct 11 13:03 mediafusion-integration.plugin
    drwxrwxrwx    3 root     root         4096 Oct 11 13:03 .
    drwxrwxrwx    5 root     root         4096 Oct 11 15:10 ..
    -rw-rw-r--    1 root     root         2506 Oct 11 13:03 TwonkyMediaConfig.css
    -rw-rw-r--    1 root     root        30586 Oct 11 13:03 TwonkyMediaConfig.js
    -rw-rw-r--    1 root     root         1213 Oct 11 13:03 TwonkyMediaConfig_grouping.js
    -rw-rw-r--    1 root     root        11800 Oct 11 13:03 TwonkyMediaServer_logo.jpg
    -rw-rw-r--    1 root     root          529 Oct 11 13:03 arrow-left.gif
    -rw-rw-r--    1 root     root          530 Oct 11 13:03 arrow-right.gif
    -rw-rw-r--    1 root     root          119 Oct 11 13:03 arrow_test_small.gif
    -rw-rw-r--    1 root     root         1043 Oct 11 13:03 attention-small.gif
    -rw-rw-r--    1 root     root          563 Oct 11 13:03 cart.gif
    -rw-rw-r--    1 root     root        10248 Oct 11 13:03 cds-noupdate.xml
    -rw-rw-r--    1 root     root        15672 Oct 11 13:03 cds.xml
    -rw-rw-r--    1 root     root        15205 Oct 11 13:03 clients.db
    -rw-rw-r--    1 root     root         4852 Oct 11 13:03 cms.xml
    -rw-rw-r--    1 root     root         1281 Oct 11 13:03 comingsoon.gif
    -rw-rw-r--    1 root     root        27484 Oct 11 13:03 config-content.html
    -rw-rw-r--    1 root     root          920 Oct 11 13:03 config-head.html
    -rw-rw-r--    1 root     root         2984 Oct 11 13:03 config-menu.html
    -rw-rw-r--    1 root     root         1160 Oct 11 13:03 config.gif
    -rw-rw-r--    1 root     root         1776 Oct 11 13:03 config.html
    -rw-rw-r--    1 root     root          215 Oct 11 13:03 description.txt
    -rw-rw-r--    1 root     root          807 Oct 11 13:03 empty.gif
    -rw-rw-r--    1 root     root         4286 Oct 11 13:03 favicon.ico
    -rw-rw-r--    1 root     root          950 Oct 11 13:03 folder.gif
    -rw-rw-r--    1 root     root        19056 Oct 11 13:03 head-background.jpg
    -rw-rw-r--    1 root     root          831 Oct 11 13:03 home.gif
    -rw-rw-r--    1 root     root         2316 Oct 11 13:03 index.html
    -rw-rw-r--    1 root     root          358 Oct 11 13:03 left.gif
    -rw-rw-r--    1 root     root          569 Oct 11 13:03 mb-config.gif
    -rw-rw-r--    1 root     root         2928 Oct 11 13:03 mb-header-logo.gif
    -rw-rw-r--    1 root     root          501 Oct 11 13:03 mb-headerBG-kachel.gif
    -rw-rw-r--    1 root     root          481 Oct 11 13:03 mb-music-sel.gif
    -rw-rw-r--    1 root     root          481 Oct 11 13:03 mb-music.gif
    -rw-rw-r--    1 root     root          558 Oct 11 13:03 mb-photo-sel.gif
    -rw-rw-r--    1 root     root          561 Oct 11 13:03 mb-photo.gif
    -rw-rw-r--    1 root     root          542 Oct 11 13:03 mb-radio-sel.gif
    -rw-rw-r--    1 root     root          547 Oct 11 13:03 mb-radio.gif
    -rw-rw-r--    1 root     root          537 Oct 11 13:03 mb-video-sel.gif
    -rw-rw-r--    1 root     root          533 Oct 11 13:03 mb-video.gif
    -rw-rw-r--    1 root     root          443 Oct 11 13:03 mediabrowser-sel.gif
    -rw-rw-r--    1 root     root          618 Oct 11 13:03 mediabrowser.gif
    -rw-rw-r--    1 root     root         4069 Oct 11 13:03 menu-background.jpg
    -rw-rw-r--    1 root     root         2486 Oct 11 13:03 msreg.xml
    -rw-rw-r--    1 root     root          392 Oct 11 13:03 music-sel.gif
    -rw-rw-r--    1 root     root          616 Oct 11 13:03 music.gif
    -rw-rw-r--    1 root     root         1963 Oct 11 13:03 nocover_audio.jpg
    -rw-rw-r--    1 root     root         2000 Oct 11 13:03 nocover_photo.jpg
    -rw-rw-r--    1 root     root         2073 Oct 11 13:03 nocover_video.jpg
    -rw-rw-r--    1 root     root          382 Oct 11 13:03 photo-sel.gif
    -rw-rw-r--    1 root     root          578 Oct 11 13:03 photo.gif
    -rw-rw-r--    1 root     root         2897 Oct 11 13:03 platform-specific-menu-grouping.js
    -rw-rw-r--    1 root     root          422 Oct 11 13:03 radio-sel.gif
    -rw-rw-r--    1 root     root          620 Oct 11 13:03 radio.gif
    -rw-rw-r--    1 root     root          536 Oct 11 13:03 record.gif
    -rw-rw-r--    1 root     root          355 Oct 11 13:03 right.gif
    -rw-rw-r--    1 root     root         1352 Oct 11 13:03 rss.gif
    -rw-rw-r--    1 root     root          369 Oct 11 13:03 status-sel.gif
    -rw-rw-r--    1 root     root          568 Oct 11 13:03 status.gif
    -rw-rw-r--    1 root     root          189 Oct 11 13:03 stop.gif
    -rw-rw-r--    1 root     root        15776 Oct 11 13:03 strings-chs.txt
    -rw-rw-r--    1 root     root        16088 Oct 11 13:03 strings-cht.txt
    -rw-rw-r--    1 root     root        22260 Oct 11 13:03 strings-de.txt
    -rw-rw-r--    1 root     root        20444 Oct 11 13:03 strings-en.txt
    -rw-rw-r--    1 root     root        22720 Oct 11 13:03 strings-es.txt
    -rw-rw-r--    1 root     root        25766 Oct 11 13:03 strings-fi.txt
    -rw-rw-r--    1 root     root        23474 Oct 11 13:03 strings-fr.txt
    -rw-rw-r--    1 root     root        21716 Oct 11 13:03 strings-it.txt
    -rw-rw-r--    1 root     root        23938 Oct 11 13:03 strings-jp.txt
    -rw-rw-r--    1 root     root        15436 Oct 11 13:03 strings-ko.txt
    -rw-rw-r--    1 root     root        20378 Oct 11 13:03 strings-nl.txt
    -rw-rw-r--    1 root     root        22800 Oct 11 13:03 strings-ru.txt
    -rw-rw-r--    1 root     root         1754 Oct 11 13:03 transcoding.db
    -rw-rw-r--    1 root     root          101 Oct 11 13:03 tri-blau.gif
    -rw-rw-r--    1 root     root         9449 Oct 11 13:03 twonkyicon-120x120.jpg
    -rw-rw-r--    1 root     root         5709 Oct 11 13:03 twonkyicon-120x120.png
    -rw-rw-r--    1 root     root         3014 Oct 11 13:03 twonkyicon-48x48.jpg
    -rw-rw-r--    1 root     root         2149 Oct 11 13:03 twonkyicon-48x48.png
    -rw-rw-r--    1 root     root         5443 Oct 11 13:03 twonkyicon-80x80.jpg
    -rw-rw-r--    1 root     root         1716 Oct 11 13:03 twonkymedia.gif
    -rw-rw-r--    1 root     root          381 Oct 11 13:03 video-sel.gif
    -rw-rw-r--    1 root     root          608 Oct 11 13:03 video.gif
    drwxrwxrwx    2 root     root           29 Oct 11 13:03 views
    -rw-rw-r--    1 root     root         2209 Oct 11 13:03 wait.gif
    -rw-rw-r--    1 root     root         1428 Oct 11 13:03 wait.htm
    -rw-rw-r--    1 root     root         1262 Oct 11 13:03 webbrowse-back.gif
    -rw-rw-r--    1 root     root         1138 Oct 11 13:03 webbrowse-e61-back.gif
    -rw-rw-r--    1 root     root         1215 Oct 11 13:03 webbrowse-e61-home.gif
    -rw-rw-r--    1 root     root         1147 Oct 11 13:03 webbrowse-e61-logo.gif
    -rw-rw-r--    1 root     root         1144 Oct 11 13:03 webbrowse-e61-next.gif
    -rw-rw-r--    1 root     root          871 Oct 11 13:03 webbrowse-e61-play.gif
    -rw-rw-r--    1 root     root         1149 Oct 11 13:03 webbrowse-e61-prev.gif
    -rw-rw-r--    1 root     root         1012 Oct 11 13:03 webbrowse-e61-upload.gif
    -rw-rw-r--    1 root     root         3258 Oct 11 13:03 webbrowse-e61.css
    -rw-rw-r--    1 root     root          831 Oct 11 13:03 webbrowse-home.gif
    -rw-rw-r--    1 root     root         1207 Oct 11 13:03 webbrowse-logo.gif
    -rw-rw-r--    1 root     root         1359 Oct 11 13:03 webbrowse-mobile.gif
    -rw-rw-r--    1 root     root         1113 Oct 11 13:03 webbrowse-n95-back.gif
    -rw-rw-r--    1 root     root         1191 Oct 11 13:03 webbrowse-n95-home.gif
    -rw-rw-r--    1 root     root         1117 Oct 11 13:03 webbrowse-n95-next.gif
    -rw-rw-r--    1 root     root          871 Oct 11 13:03 webbrowse-n95-play.gif
    -rw-rw-r--    1 root     root         1119 Oct 11 13:03 webbrowse-n95-prev.gif
    -rw-rw-r--    1 root     root         1012 Oct 11 13:03 webbrowse-n95-upload.gif
    -rw-rw-r--    1 root     root         3091 Oct 11 13:03 webbrowse-n95.css
    -rw-rw-r--    1 root     root          530 Oct 11 13:03 webbrowse-next.gif
    -rw-rw-r--    1 root     root         1475 Oct 11 13:03 webbrowse-pc.gif
    -rw-rw-r--    1 root     root          871 Oct 11 13:03 webbrowse-play.gif
    -rw-rw-r--    1 root     root          529 Oct 11 13:03 webbrowse-prev.gif
    -rw-rw-r--    1 root     root         1138 Oct 11 13:03 webbrowse-psp-back.gif
    -rw-rw-r--    1 root     root         1215 Oct 11 13:03 webbrowse-psp-home.gif
    -rw-rw-r--    1 root     root         1147 Oct 11 13:03 webbrowse-psp-logo.gif
    -rw-rw-r--    1 root     root         1144 Oct 11 13:03 webbrowse-psp-next.gif
    -rw-rw-r--    1 root     root          871 Oct 11 13:03 webbrowse-psp-play.gif
    -rw-rw-r--    1 root     root            0 Oct 11 13:03 webbrowse-psp-prev.gif
    -rw-rw-r--    1 root     root          807 Oct 11 13:03 webbrowse-psp-settings.gif
    -rw-rw-r--    1 root     root         1009 Oct 11 13:03 webbrowse-psp-upload.gif
    -rw-rw-r--    1 root     root         3539 Oct 11 13:03 webbrowse-psp.css
    -rw-rw-r--    1 root     root         1374 Oct 11 13:03 webbrowse-settings.gif
    -rw-rw-r--    1 root     root         1354 Oct 11 13:03 webbrowse-upload.gif
    -rw-rw-r--    1 root     root         3279 Oct 11 13:03 webbrowse.css
    -rw-rw-r--    1 root     root        10390 Oct 11 13:03 website-bg.gif
    drwxrwxrwx    2 root     root           29 Oct 11 13:03 .
    drwxrwxrwx    3 root     root         4096 Oct 11 13:03 ..
    -rw-rw-r--    1 root     root        20656 Oct 11 13:03 default.view.xml
    Ok, understood. I tried to manually "chown" everything inside twonky5 to root:root and to "chmod" +x twonkym*, as the script does, but yet no success after reboot.

    Ok, home folder changed and running ok, thx.

    Please help, let me know if you need more info about this issue.:confused:
  69. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    Hmmmm I think this has something to do with the problem that I thought that the config partitions are always XFS and never RAID (wrong: they are whatever you format the data partitions to).

    Can you paste the contents of /etc/scriptdirs.txt ?

    Also, try this
    1. Stop the media server from the web GUI
    2. Enter
      echo /harddisk/volume_3/data/rc.d >/etc/scriptdirs.txt
      at a command line
    3. Run
      /etc/rc.d/twonkymedia.sh start &
    4. Tell us what you see.

  70. splfactor

    splfactor Guest

    NAS200 as HTTP Server & modify index.htm

    Jac, appreciate the great work you've done.

    I only have basic linux skills and was looking to use the NAS200 as a HTTP Server. Whether it be changing the main index.htm to include more links or using an additional listen port pointing to a different directory.
    Are there any existing procedures of how to do this via SSH?
    I've tried backing up index.htm using command cp index.htm index.htm.bak but get the following error: cp: unable to open `index.htm.bak': Read-only file system.
    Is there some way to make a backup copy of this file?
    I've also tried to modify index.htm with vi, but the changes wont save. Thanks!
  71. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    The files that are stored internally are in a read-only squashfs file system. It cannot be written to and it cannot be remounted read-write. Squashfs is designed not to be written to, just like the ISO-9660 file system on CD-ROMs: it simply doesn't provide free space and because of the compression, you can't really replace files either. The only way to change it is to rebuild it from scratch. This makes it difficult to change files stored in the flash, but that's exactly what we want for an embedded device like the NAS200: Every time you start the unit, it will have the exact same files, it would be extremely difficult for hackers with bad intentions to change your box and make it unusable, or for you to do the same by making a mistake.

    Embedded devices still need writable file systems of course, so during initialization they mount a few places such as /etc, /var and /tmp on a RAM disk. The NAS200 also mounts /harddisk on RAM disk and eventually mounts your hard disks somewhere underneath after it creates a few subdirectories.

    The bottom line is, you can't simply change the existing index.htm and save it in-place; you will have to follow a different tactic. Since you want to use the existing web pages and therefore the existing web server (which is heavily patched), you will probably want to do the following (replace '#' in all commands with the appropriate number for your system):

    1. Create a directory on your hard disk and copy the ENTIRE directory tree using a command prompt.
      mkdir -p /harddisk/volume_#/data/www
      cp -a /home/httpd/html/. /harddisk/volume_#/data/www
    2. Now create a startup script that modifies the web server configuration file on-the-fly and changes the root directory of the web server:
      # Name this file rc.myweb and write it into a directory rc.d under the
      # root directory of the first hard disk. Note, use a Unix compatible editor
      # so the line endings are Line Feeds, not Carriage Return + Line Feeds.
      # You can also use WinSCP's built-in editor to write the file to
      # /harddisk/volume_#/data/rc.d/rc.myweb. WinSCP's editor will create the
      # line endings correctly.
      sed -i 's,^dir=.*,dir=/harddisk/volume_#/data/www,g' /etc/thttpd.conf
    3. After this, whenever you reboot, the script will modify your web server's configuration file to serve web pages from your directory instead of the one in the read-only file system. You can change the pages to your heart's content because they are on your hard disk.

    Note, another way is to set up another web server (either running the same patched thttpd that's on-board twice, or running a different webserver in addition to the one that's running for the web GUI) on a different port. There is a thread on this board somewhere that tells you how to do that, but I think this will pretty much give you the info you need to get going.

    Note that the web server has a number of patches in it, for example the default page name is index.cgi, not index.html. You may run into some strange behavior but if you know how to write web pages, you will probably be able to find a way around anything you encounter.

  72. pema

    pema Addicted to LI Member

    Follows original content of /etc/scriptdirs.txt, before your suggested procedure:

    I did what you suggested and twonky5 started ok.

    See output of "ps ax" now:

    $ ps ax
      PID  Uid     VmSize Stat Command
        1 root        500 S   init       
        2 root            SWN [ksoftirqd/0]
        3 root            SW  [watchdog/0]
        4 root            SW< [events/0]
        5 root            SW< [khelper]
        6 root            SW< [kthread]
       40 root            SW< [kblockd/0]
       41 root            SW< [ata/0]
       42 root            SW< [ata_aux]
       43 root            SW< [ksuspend_usbd]
       46 root            SW< [khubd]
       48 root            SW< [kseriod]
       73 root            SW  [pdflush]
       74 root            SW  [pdflush]
       75 root            SW< [kswapd0]
       76 root            SW< [aio/0]
       77 root            SW< [xfslogd/0]
       78 root            SW< [xfsdatad/0]
      209 root            SW< [scsi_eh_0]
      210 root            SW< [scsi_eh_1]
      229 root            SW  [mtdblockd]
      271 root            SW< [kmmcd]
      277 root            SW< [md1_raid1]
      281 root            SW< [md0_raid1]
      458 root        296 S   lld2d eth0 
      499 root            SW< [xfsbufd]
      500 root            SW< [xfssyncd]
      588 root            SW< [xfsbufd]
      589 root            SW< [xfssyncd]
      725 root        848 S   upnpd &>/dev/null 
      733 root        512 S   CheckHDDPower 
      755 root        848 S   upnpd &>/dev/null 
      756 root        848 S   upnpd &>/dev/null 
      758 root        848 S   upnpd &>/dev/null 
      759 root        848 S   upnpd &>/dev/null 
      760 root        848 S   upnpd &>/dev/null 
      762 root       1192 S   /usr/sbin/thttpd -C /etc/thttpd.conf 
      779 root        208 S   /usr/sbin/download 
      785 root        416 S   /usr/sbin/inetd 
      790 root        616 S   /usr/sbin/QuickSet 
      792 root        420 R   /usr/sbin/USB_Detect 
      793 root        496 S   /usr/sbin/USB_Detect 
      797 root        308 S   /usr/sbin/ResetButton 
      799 root        344 S   /usr/sbin/PowerButton 
      801 root        492 S < /usr/sbin/backup_button 
      803 root        440 S   /usr/sbin/do_umount 
      805 root        172 S < /usr/sbin/USBButton 
      910 root        384 S   /usr/sbin/CheckHDDDrive 
      923 root       2668 S   /usr/sbin/smbd -D 
      925 root       2096 S   /usr/sbin/smbd -D 
      927 root       2228 S   /usr/sbin/nmbd -D 
      929 root        252 S   init       
     1081 root        532 S   /bin/sh /etc/rc.d/twonkymedia.sh start 
     1092 root       2220 S   /harddisk/volume_3/data/rc.d//twonky5/twonkymediaserv
     1093 root       2220 S   /harddisk/volume_3/data/rc.d//twonky5/twonkymediaserv
     1096 root       2220 S   /harddisk/volume_3/data/rc.d//twonky5/twonkymediaserv
     1097 root       2220 S   /harddisk/volume_3/data/rc.d//twonky5/twonkymediaserv
     1098 root       2220 S   /harddisk/volume_3/data/rc.d//twonky5/twonkymediaserv
     1099 root       2220 S   /harddisk/volume_3/data/rc.d//twonky5/twonkymediaserv
     1100 root       2220 S   /harddisk/volume_3/data/rc.d//twonky5/twonkymediaserv
     1101 root       2220 S   /harddisk/volume_3/data/rc.d//twonky5/twonkymediaserv
     1102 root       2220 S   /harddisk/volume_3/data/rc.d//twonky5/twonkymediaserv
     1103 root       2220 S   /harddisk/volume_3/data/rc.d//twonky5/twonkymediaserv
     1104 root       2220 S   /harddisk/volume_3/data/rc.d//twonky5/twonkymediaserv
     1105 root       2220 S   /harddisk/volume_3/data/rc.d//twonky5/twonkymediaserv
     1108 root       2220 S   /harddisk/volume_3/data/rc.d//twonky5/twonkymediaserv
     1114 root       2220 R   /harddisk/volume_3/data/rc.d//twonky5/twonkymediaserv
     1413 root        540 S < /usr/sbin/crond 
     1506 root            Z   [mediafusion-int]
     3906 root       1056 S   /usr/sbin/dropbear -i 
     3907 root        768 S   -sh 
     3921 root        624 R   ps ax 
    YES! :biggrin: It's running now! Many THX.

    Now I suppose I have to rebuild this scriptdirs.txt file to make it point only to "volume_3", even after reboot. How can I do that? Where do this file and the entire /etc folder are created in the first place, at boot time?
  73. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    Hmmm... I have to say I'm stumped as to why it won't work... I will try to do some better testing on the next release.

    For now, you can simply create a script under rc.d on your hard disk that writes the file.
    echo /harddisk/volume_3/data/rc.d >/etc/scriptdirs.txt
  74. emersonvier

    emersonvier LI Guru Member

    I upgrade for you version, after I check and see this information

    System Status

    Server Name: NAS_VIER
    Firmware Version: V3.4R79
    Hardware Address: 00:22:6B:EC:CA:F8
    IP Address:
    Date: 2009/10/31
    Time: 11:39 am
    Current Status: Ready

    Its ok?

  75. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    Yes. The web pages in my firmware are unchanged from the original.

  76. hitchy

    hitchy Guest

    Awesome Stuff.
    Can you advise, is it possible to disable the HDD standby feature?
  77. sammarce

    sammarce Guest

    Download problem of firmware NAS200_V34R79jac4

    I have found problems when i try to download this FW version, the link is very slow ad the donwload stop when the file reach the size of 1,8Mb

    Can any people send a link for alternative download ?

  78. phoenixcryos

    phoenixcryos Guest

    comments and feature requests

    First off I have to say you are doing an AWESOME job so far on this firmware; I have just loaded it onto my NAS200 last night and already love it. Keep up the the great work!

    I am just now starting to get into the whole modding thing so I don't know too much; but I had a couple of requests on upgrades or features *if possible* that I think would be great to have on this device.

    First off is the ability to use the USB ports as print server ports *this is the one main feature I believe this device lacks*

    Next would have to be the ability to plug in a USB wifi adapter into the device and use it wirelessly

    Another feature that might be useful would be the ability to clone a drive or copy a drives contents from USB onto the internal drives without the need to use a PC. maybe make the backup button on the front of the device programmable for downloads; device clone ; or drive copy etc?

    I am sure these features have been asked about in the past but I have to confess I didn't read all the way through this forum; I merely glanced at it.

    I am not sure if anyone out there with this device has thought of modding the board to include gigabit Ethernet maybe more memory and a better processor. But from what I have seen with the DDWRT stuff is that after good firmware comes out with features people like the the hardware modders and more programmers start to jump on board. This really is a perfect device as far as the size and the overall concept it just needs some good programmers like you working on it to start to unlock its potential.

    Again Awesome Job!!!
  79. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    You can do this by writing a startup script as follows:

    # rc.d/rc.keepdisksrunning
    hdparm -S 0 /dev/sda
    hdparm -S 0 /dev/sdb
    Check here for a manpage of the hdparm program. The -S parameter is especially peculiar!

    Note, unless you are using "green" hard disks that don't generate a lot of heat or you did some Dremeling on your case, the unit will probably get too hot with two hard disks running 24/7 because the tiny little fan is grossly underdimensioned by Linksys. Don't blame me if your hard disk fails!

  80. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    You're welcome!

    This has been asked quite a few times; however Linux printing services just don't work as well with multifunction printers and that's what most people have. I think it would be more useful to have a USB over IP server running on the NAS200, that way users can not only use USB printers and scanners but also webcams and other devices over the network.

    Unfortunately it's hard to find a free solution to this (I would think) common problem. Google is flooded with links to two companies that provide a commercial solution: Fabulatech and Eltima, and I think their websites look so similar that I wouldn't be surprised if it's really the same company(*). I did however find one partially open-source solution called USB Redirector. They provide the server source code for free, but you have to buy the clients. I was able to compile the source for the NAS200 but I had some trouble getting it to work because it's written in C++ and the NAS200 doesn't have the c++ run time library on board. I gave up on it because my client trial expired and I didn't need it anyway, plus this was in the Jac0 days and I've learned a lot since then. Maybe I'll get back to it again some day.

    Although this might seem useful, I don't think this makes much sense. I expect most people to have a little corner in their house where the cable modem or DSL modem is, and also their wireless router. This is probably also where most people think the NAS belongs. Besides, if the NAS would be on the same wireless network as its clients, it would only mean that access to the files is even slower because it will take twice as many slow wireless packets to get to the files (one packet between NAS and router, one packet between router and client, and vice versa).

    This is simply a matter of running a cp command in a shell (or better, run rsync).

    I think a more interesting solution for backups is a program like JungleDisk Server which lets you copy data to the cloud. The Server version of JungleDisk is currently in Beta but it works well on the NAS200, the only problems are that it's not free (you pay for storage on Amazon S3 or on Rackspace, which is JungleDisk's parent company), and so far I've only been able to get it to work in my Gentoo chroot.

    This is actually not very hard to do in a script: you'd have to stop the stock backup button application (I forgot its name) or prevent it from starting up, and then just write a program or script that listens to the correct device. As long as the button is not pushed, reading from the device just gives EOF. When you push the button it reads a string (I forgot what it is). You can check for that and start a program.

    That's okay; you have to start somewhere... I know I should write a FAQ posting but I don't have the time. Sorry...

    Gigabit won't help, the system is simply too slow. If you want to make it faster you can probably install a Pico or Nano size motherboard and run FreeNAS or Windows Home Server... Be careful, some of those small footprint motherboards are really high. I checked one of the Via Pico motherboards (which would have been useless anyway because it only had one SATA port) and because it had a heatsink on the top side and a memory module on the bottom side, it was too high to fit...

    I would still like to get it to run OpenWRT which would make it a lot easier to run common Linux applications that people ask for and that I can't provide because of incompatibilities with the ancient libraries and kernel on the NAS200. Again, if I would have some more time...


    (*) By the way, this is totally off-topic but if you want a fully legal free version of the Eltima serial-over-IP software, go to HW-group. HW-Group sells hardware to do serial-to-IP conversion and that's what they make their money on, but they apparently also have an OEM license on the Eltima driver and they are giving it away in slightly modified form.
  81. emersonvier

    emersonvier LI Guru Member

    But this informations its ok?
    Firmware Version:V3.4R79
  82. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    Yes. As I mentioned in the initial post, my firmware is based on the most recent Linksys firmware which is V3.4R79.

  83. freakinhippie

    freakinhippie Addicted to LI Member


    Have you made any progress on fixing the RAID password issue? I really want to flash this ROM, but I'm running RAID 1. I saw earlier in the thread you mentioned that a script could be written to fix the issue (and I think you even posted one) but I'm not clear on how to get that script onto the system if there is no ssh access. If you have some time, could you clarify that for me. I'm pretty familiar with Linux so you shouldn't have to dumb it down too much. :)

  84. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    I'm not sure what problem it is you're referring to, but I think most problems related to RAID can be solved by writing a script as follows:

    # rc.d/rc.fixscriptdirs
    echo /harddisk/volume_3/data/rc.d >/etc/scriptdirs.txt
    Obviously, I have no way of testing this...

  85. freakinhippie

    freakinhippie Addicted to LI Member


    I'm referring to the issue when the password is updated by your scripts, it is copied to the /harddisk/volume_1 (which apparently is for non-raided disk). Then when the system is rebooted, the "unknown" Linksys password is set and ssh access isn't possible. If that is no longer the case, or if I was just totally misunderstanding the situation and I can safely load this ROM on a RAID 1 box, please let me know.

  86. freakinhippie

    freakinhippie Addicted to LI Member

    Well, it seems that I must have misunderstood the previous posts that caused my concerns. I've flashed this ROM and it seems to be working well.

    Thanks Jac.
  87. Treah

    Treah Addicted to LI Member

    Does the NAS200 Actually have a BIOS raid controller or does it implement RAID via software?
  88. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    The RAID is implemented in software (by using the mdadm command). This is one of the reasons why I recommend against using any kind of RAID on the NAS200. Allow me to re-iterate:
    • Using a RAID0 or RAID1 configuration will not make your NAS any faster because it's implemented in software. If anything, it will make the NAS slower because it has more to do.
    • RAID1 will not protect you against user error (e.g. deleting the wrong file) which is much more likely to happen than drive failure (which it DOES protect against).
    • RAID1 will not protect you against failure of both drives; this may seem like an unlikely event, but it's not as unlikely on the NAS200: there have been several reports of heat-related failures with the stock fan.
    • Neither RAID0 nor RAID1 will not protect you against failure of the electronics. And with RAID0 and RAID1, restoring your data on a different machine will be difficult because not only will you have to find a computer that understands the file system, you will also have to know how to access the RAID volumes.
    • Because of all these reasons, you should still make backups of your NAS (backup to the cloud is now possible using Jungle Disk Server Edition Beta)
    • Using a RAID1 configuration will give you a false sense of data security, at the cost of half your disk space; using RAID0 will give you the same amount of space as Separate Disks, at the cost of increasing the chance that all your data might be inaccessible if one disk goes bad. Neither RAID0 nor RAID1 will give you any significant speed improvement.

    Bottom line, don't use the RAID, and make backups!


    PS By the way, there's no BIOS on-board the NAS200. :eek:
  89. jackito

    jackito LI Guru Member

    Just software RAID through the linux kernel. What did you expect? :rolleyes:
  90. jackito

    jackito LI Guru Member

    Hi Jac,

    this time I must say that I don´t agree with you.
    I´m a RAID-1 user. Of course it´s not perfect but IMHO it´s not generating a false sense of security IF YOU KNOW WHAT RAID ARRAYS (and types) ARE ABOUT.
    I´m working with RAID arrays for more than ten years now and the chance of loosing two discs from a RAID-1 array at the same time (without taking into account things like the device beeing stolen, or exploding, going under water, fire and things like that) is very, very small.
    Also the idea behind a RAID-1 it´s more oriented to "high availability of the data". In the sense of: "if there is one disc failure while you are working, don´t worry, finish your work and just change the drive ASAP and you are done. Your data will be there, available, a lot faster than searching and restoring from a backup and of course up to date, not from a week ago (depending on your backup schedule -and everybody knows that almost nobody is making backups every night, even every week- :frown: )".

    On the other hand I want to say: It´s NOT A REPLACE FOR BACKUPS UNDER ANY CONCEPT. As you said if you delete a file it doesn´t matter if it was stored in a RAID-1 or not, it will be gone and you will need to search for that life saver backup once again.

    About RAID-0, it´s worth using it only in VERY special cases, where performance and big volumes (separate discs configuration is not solving this) are needed -at the expense of data security-. As you said if a disc is gone in a RAID-0 all the data is gone. About performance, again as you said, in the case of this LAME NAS, you will not gain anything. So finally RAID-0 doesn´t worth it at all with this hardware.

    Just my two cents.


    PS: just for the record I´m running an automatic scheduled full backup EVERY Sunday morning and an incremental backup EVERY night. Just in case. :biggrin:
  91. Treah

    Treah Addicted to LI Member

    lol so its only software huh. That is good to know I have experience with mdadm. Its actually very simple for a seasoned Linux user but I would have to agree trying to mount this on another system with little to no Linux knowledge or even mdadm knowledge would be difficult. There have been some success with using Raid 1 with a network device but its certainly something I would never try with the NAS200. Its just to bloody slow.

    I would also have to recommend not using raid0 as it wont give any sort of increase in speed and that's the whole point of using raid0. Raid 1 however may not be a bad idea esp for me which has almost 800gigs of data on my nas and I don't trust backing up to the internet as an option. The data on my nas is mostly entertainment and nothing really important
  92. jackito

    jackito LI Guru Member

    Sorry, I don´t agree. Based on my own benchmarks, the overhead introduced by a software RAID-1, even in the NAS200, is unnoticeable.

    Again, I don´t agree. :smile:
    It´s not the whole point. You may also use a RAID-0 configuration if you need a large continouos space volume.
    Two separate discs of 500GB gives you 1TB of storage BUT that´s in TWO VOLUMES. It´s not a continous space.
    A RAID-0 of two discs of 500GB gives you 1TB of storage too BUT IN ONLY ONE VOLUME of continous space.
    In a scenario where you need to store for instance one big file of 850GB with two separate discs of 500GB you will not be able to do it as you will with a RAID-0 configuration.

    I do agree with you on this. I don´t trust backing up to the internet either. :smile:
  93. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    I think we all agree that RAID0 doesn't make sense because there's no significant speed gain and a significant increased risk of loss of data. For RAID1, everyone will have to decide for themselves whether the benefits outweigh the risks.

    I can think of several use-cases where losing data due to user error is less likely, or less severe than losing data due to disk failure than in other situations. And sure there is the benefit of no down-time if a disk fails in a RAID1 configuration.

    For my particular use (a large archive of 20+ years of documents, programs and media), the data is so important that I need to make a backup either way, but on the other hand if the data gets lost it's not a big deal if it takes a few days to restore it from JungleDisk.

    As an added benefit, without a RAID setup, my disks aren't locked together; I can still use a few simple commands to synchronize the data from one disk to the other disk. I can decide to do this for all directories or for some (in fact, I do it for some). And if I ever change my mind and decide that I need more capacity at the price of less redundancy, I can erase one of the redundant copies to make space, without the need to reformat the disks.

    If someone asks me whether they should use a RAID, my recommendation will likely be "no", if only because they have to ask. Your answer may be different because your priorities are different.

    That's okay :smile:. Everyone will have to decide for themselves.

  94. Treah

    Treah Addicted to LI Member

    What I was referring to here is using a network block device as part of your raid 1 setup not just the act of using raid1 on the NAS200. This is because of the poor transfer rates on the network connection it would slow down any sort of raid setup with network and local disk devices.

    mdadm also includes something called linear instead of raid 0 that will make 2 disks show up as one whole disk (kinda of like spanned volumes) I am not sure how it is implemented and it may just be some fancy talk for non raid partitions, I haven't really looked into it much other then quickly gleaming enough info to get my usbthumbdrive raid0 working :p
  95. BigTW

    BigTW Guest

    Twonky w/RAID

    Hey Jac - another great release. Just wanted to mention that I use RAID and I've been having similar problems to those previously discussed.

    In upgrading from JAC2b to JAC4, I also lost my root access to WinSCP. I couldn't get the "restore user accounts" to work, but was able to work around that by flashing back to stock R75 firmware, then reflashing to JAC2b. I followed the instructions to reset the root password, and when I flashed up to JAC4, it stuck.

    I also was trying to get Twonky 5 to work, and have been following these forums closely. I was able to replicate everything that pema encountered. However, I can't seem to get the script to execute properly on launch, yet it worked directly via TELNET:

    Bottom line, I got everything working, but can't seem to get "volume_3" to be the master after a restart. I'm looking forward to your next release to help us all out that use RAID!
    Finally, I thought some might be interested to know that Twonky is running a 50% off sale through the end of the year. Just go to www.twonkymedia.com and use coupon code TWONKYMEDIA-2XX9-A when you check out. It's a really great deal!

    Thanks for all your work!!!
  96. johnd2

    johnd2 Addicted to LI Member

    Recover from Deleting a Share

    I removed a share in the Web application thinking I was just removing the share and not deleting the Directory. I have Jac4 running and can telnet to my NAS drive. Anyone know a way to get the Directory back that was deleted from removing the share.
  97. Treah

    Treah Addicted to LI Member

    The directory should not have been deleted but just removed from the samba list of shares. Unless the nas200 does something exotic with them. If its been removed from the file system you SOL there are some utils for recovering data but I have never used any of them.
  98. column

    column Addicted to LI Member

    mount external usb hdd with ext3 file system


    I need to mount external usb hdd that previously was nas200 internal (file system ext3). What is the way of doing this?

    Thank you
  99. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    Hard disks on the USB ports are recognized as /dev/sdc and /dev/sdd (depending on the USB port, note that this is different from many Linux distros that don't care about which USB port you plug it into). Being ext3 it won't be mounted automatically but you can do so from the command line using e.g. mount -t ext3 /dev/sdc1 /harddisk/volume_6/data

    If you want, you can mount it on a directory that's on one of the internal hard disks so it's automatically shared by Samba (e.g. create /harddisk/volume_1/data/old_disk and mount it there).

    If your USB hard disk was previously in a RAID configuration, you will have to use mdadm to assemble the RAID partitions.

    If you want to access the config partition instead of the data partition, change /dev/sdc1 to /dev/sdc2. The /dev/sdc3 partition is a swap partition.

    I rarely use the USB ports myself, if any of the above is wrong, let me know :wink:

  100. column

    column Addicted to LI Member

    I decide to use NTFS file system in my storage (for one or both HDD's). Mount command works correctly from ssh, but how to make mount ntfs automaticaly when system starts? How to make NTFS HDD visible on network (samba and FTP)?
Thread Status:
Not open for further replies.
  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