1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

[Announce] Jac0: Alternate firmware for NAS200 with ext2, dropbear, telnet, more

Discussion in 'Cisco/Linksys Network Storage Devices' started by jac_goudsmit, Mar 10, 2008.

  1. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    This version is now obsolete.

    Please click here for the latest version

    ===Jac









    Announcing release of my NAS200 firmware mods

    Please read the entire posting before you begin!

    I'm pleased to see that there appears to be a significant audience for the telnetd mod in this thread. I have been working on a more generic solution of running customized firmware on the NAS200; I'm still in the process of getting that set up and I'll make an announcement here when it's ready (Real Soon Now (tm)). This is not the announcement that I've announced :biggrin:, but it should make you equally happy.

    While I'm still working on the generic solution, I decided to make available the firmware that I'm currently running on my own NAS and is not so generic. Unfortunately I don't have the bandwidth to also share the source code (contact me if you're interested), but this is only a temporary release until the more generic solution is ready. The generic solution will also have an official name that I don't want to reveal just yet. Let's just call this non-generic firmware "Jac's firmware mods, release 0". Or in short: "Jac0" (to be pronounced as Shock Zero :rolleyes:).

    This firmware is based on the V3.4R62 firmware from Linksys. I have to point out here that Linksys now has a newer firmware (V3.4R75) online with a number of important bugs fixed and important features added.

    These are the changes to the Jac0 firmware compared to the Linksys V3.4R62 release:
    • All available busybox applets now have softlinks.
    • Telnetd is installed (so you can set your root password), but can be disabled.
    • Dropbear (secure shell client/server) is installed.
    • The kernel has ext2 and loopback filesystem support, and busybox has losetup enabled.
    • It's now possible to run your own startup scripts (e.g. for running a Twonky server off the harddisk).
    The Linksys web interface is unchanged (including the version number; you won't see that you're running my firmware). Installing this firmware will not change your configuration, and it's easy to revert to the original firmware if you want.

    WARNING! DO NOT INSTALL THIS FIRMWARE UNLESS YOU ARE USING YOUR DISKS IN "SEPARATE DISKS" MODE. If you are using mirror, stripe or JBOD mode, this firmware may destroy your data!. Regardless of whether you're using your harddisks in the same mode as me or not, you are doing this at your own risk. I will not be responsible if your data disappears, if you brick your box or if you let the Magic Blue Smoke escape. I recommend making a backup before you start. If you run into trouble. let me know and I'll try to help you out.

    The generic solution that I'm working on may work on different disk configurations too, but for now I'm limiting this to Separate Disks mode only.

    [Edit 20080408 13:20 UTC]This firmware is based on V3.4R62, for which Linksys makes source code available. It is possible to downgrade to this firmware if you are currently running a later version. However, you will have to manually mount any harddisks that you formatted in non-journaled mode (ext2 filesystem), and you will not be able to use the web interface to create file shares on ext2 partitions. If your first harddisk is ext2, you will have to reformat it (or add an XFS partition by temporarily attaching it to a PC and use a resizing partition editor) to make custom scripts work.

    Installation
    SECURITY WARNING! After you install this firmware and reboot your NAS200, the Telnet port will be open, and it will be possible for anyone to connect to the box, and be root without the need for a password. They will be able to access any files on your harddisks in any way. Please read the following instructions to set the root password and disable telnet.

    You can downloaded the firmware at: http://www.goudsm.it/nas200/NAS200_V34R62jac0.bin. Please verify that the file is exactly 8388608 bytes long and that the md5sum is e79545be02ab9993f7b2c49a43456661.

    [Edit 20080312 14:05 UTC] If you need support for extra file systems, you will also want to download the extra filesystem kernel modules at http://www.goudsm.it/nas200/extrafsmodules.tar.gz. The md5sum of this file is d702f6ff5d96c79f17e6f6e6a9c60a15 [Edit 20080318 14:23UTC] or 335db7c96cb0b6cb6216e7230c4f0a92 depending on whether you got the file before I added sunrpc.ko (see end of this posting)[End Edit]

    To install the firmware, simply download it through the Firmware Upgrade webpage of the NAS200 web GUI. You will get a popup saying that your NAS200 will reboot in 30 seconds, and the NAS200 will beep and all lights will go on when it reboots. Click OK on the notification.

    NOTICE: The first time you boot with the new firmware, it will take about 5 minutes to start up. Dropbear has to generate encryption keys which takes very long.

    If you have a serial port connected, you can see what's taking so long. Subsequent startups will take shorter than the first startup (but still longer than the original firmware because more programs are started now). After the kernel is loaded, the lights will start working normally but you should wait until you hear the two beeps from the internal speaker before you continue: the beeps indicate that all boot scripts have finished executing and the NAS200 is ready for normal operation. In other words: booting is pretty much the same as when you were using the Linksys firmware, only slower. The speed of the box should be about the same during normal operation, but there is slightly less memory available while you're logged in to the shell, so your mileage may vary.

    Changing the root password
    Installing the new firmware doesn't change your configuration and doesn't change the passwords that are stored on your box. That's great because you won't have to jump through any hoops to keep your user names and shares. However it also means that the root password is whatever Linksys stored into the original firmware, which is not known at this time (09-Mar-2008). In fact, non-existing directories and illegal shell strings in the passwd file prevent any account from logging in. Even Linksys engineers who know the password would be unable to log in to your box because root's home directory is non-existent.

    This is why my firmware enables telnetd by default and lets it bypass the login: to let you change the root password and fix the /etc/passwd file. This is a bad security hole and you should not open the telnet port to the Internet; it's only a matter of time until someone finds the open telnet port and wreaks havoc on your NAS.

    These are the steps to change the root password. If you don't know how to use vi, remember you can always copy files to e.g. /harddisk/volume_1/data, edit it with a PC on the network (if you're using Windows, remember to use an editor that understands Unix line endings and doesn't modify them, e.g. Metapad or Notepad++), then copy the file back.
    1. Log in to the NAS200 through telnet
    2. Use the passwd command to change the password
    3. Use vi to edit /etc/passwd to change the login directory from "/root" to e.g. "/" or "/harddisk/volume_1/data"
    4. Copy the modified /etc/passwd to /harddisk/volume_1/conf . Then reboot with the command: /etc/rc.d/rc.reboot. Don't use "reboot", you may destroy data! It's necessary to copy the file to the configuration partition of harddisk 1 because the /etc directory is a RAM filesystem. The file will be copied back from the harddisk to /etc as part of the boot process.
    5. After the reboot, verify that you can log in successfully through a Secure Shell (on Windows, use PuTTY). If you know that your password works (and survived the reboot), you can turn Telnet off in the next step. If not, start over with step 1.
    6. If you are 100% certain that you can log in through a secure shell after rebooting, turn the telnet daemon off with the command: touch /harddisk/volume_1/conf/no_telnetd
    From now on, whenever you restart the NAS200, the telnet port will be disabled (closed) and you will only be able to access the box via secure shell, which will ask for a password. You will not be able to undo this, except by logging in through ssh and deleting the /harddisk/volume_1/conf/no_telnetd file again, or by deleting the file through the terminal on the serial port, or by writing a startup script to delete the file (see below for more info on startup scripts).

    If your configuration should ever be reset to the default, the new default root password is "root".

    Symlinks
    I found out that Linksys enabled a lot of interesting busybox applets that they didn't provide symlinks for in the file system. This is why in the original firmware with telnet mod (or in a serial port session) you couldn't use "sed" or "grep" or "find", for example. I generated all softlinks that are supposed to be generated and added the missing ones to the file system.

    Telnet
    Busybox was patched (see this webpage for more info) so that telnetd won't crash.

    Also, device nodes were added for /dev/pts/{0,1,2,3,4,5,6,7} so that up to 8 telnetd (or dropbear) session can be active at a time.

    Telnetd is started from /etc/rc.d/rc.telnetd which doesn't actually start the daemon but adds a line to /etc/inetd.conf. It only does this if it can't find the /harddisk/volume_1/conf/no_telnetd file. The Linksys program /usr/sbin/rc.bootbin will also add the line to the inetd.conf file if the telnet option is enabled in the /etc/CGI_ds.conf file, but it won't add the "-l /bin/sh" option so you would still have to log in, and it's a little cumbersome to change the configuration file because it's backed up to flash memory, not to the harddisk.

    Dropbear
    I installed Dropbear 0.49 because I had trouble getting 0.50 to run on the NAS200. I don't remember exactly what went wrong. Also, I had to configure dropbear and the kernel to use legacy pseudo terminals; without this, dropbear didn't work. It's possible that this was caused by the same problem as I was having with Telnetd.

    Dropbear is a Secure Shell server and client, which not only allows you to log in to the NAS200 via a secure encrypted connection, but also lets you make outgoing connections once you're in. I have port 22 on my firewall forwarded to my NAS200 so that I can log in from anywhere in the world, and once I'm logged in to my NAS200 I can enter another "ssh" command to log in to any of my Linux systems at home that aren't directly connected to the Internet.

    Furthermore, Dropbear lets you use the Secure Copy command "scp" and the Secure Copy Protocol to copy files to and from your NAS200. This is great, because that means there now is a safe way to copy files from and to the NAS200 when I'm not home (The Linksys web interface only lets you download files from, not upload files to the box).

    Dropbear was built in "multi" mode by using the Gentoo dropbear ebuild. In addition to the standard symlinks "dropbear", "dbclient", "dropbearkey", "dropbearconvert" and "dbscp" I also created symlinks "ssh" and "scp" for backward compatibility.

    The startup script "/etc/rc.d/rc.dropbear" was added for dropbear. It adds SSH support in the same way as Telnet support: by adding a line to the /etc/inetd.conf file. Doing it this way means that dropbear will not use any significant amount of memory while it's not in use. The script also generates the key files in /harddisk/volume_1/conf if they don't exist. This is a good location because it doesn't get wiped when the system restarts (/etc is a RAM file system so it does get wiped).

    Note: if you ever change the host name of your NAS200, it may be necessary to wipe and regenerate the key files.

    Problem and workaround for large files
    When I used WinSCP (a Windows file manager that is able to do Secure File Copies via SSH), I encountered two problems. The first problem is that it always gets an error when it tries to execute the "groups" command, which is not implemented in our busybox. This is no big deal because WinSCP will work around it by trying to guess what the group fields are when it outputs an ls command.

    The second problem is that when WinSCP navigates to a directory with large files, it uses the "ls -al" command to find out what directories are there, but our Busybox displays the group name and file size without space between the fields, so the parser in WinSCP gets confused, shows an error and ignores the file. This is mainly a problem on the harddisk, where files belong to the "everyone" group.

    I found an easy workaround for this which you will have to do on your own NAS200 as well: edit the /etc/group file with vi to rename the "everyone" group to something else that's shorter, e.g. "all" so that in the output from an ls -al command, there's enough space to put the file size behind the group name and leave some space, even if the file is large. After you do this, copy the /etc/group file to /harddisk/volume_1/conf so that it will be restored to its current state after a reboot. I renamed my "everyone" group this way, and haven't had any problems since.

    Startup scripts
    I made a bunch of changes to the startup scripts in /etc/rc.d (I'm thinking of adding another change so that /etc/rc.d will not be copied from /etc.default/rc.d, but symlinked to it; that would save about 95KB of RAM). These are the changes:

    rc.sysinit
    This script is pretty much the first script that runs when your box boots. It takes care of everything that previously happened before rc.bootbin was started: mounting ram-filesystems and creating directories.

    Before rc.sysinit chains to the new rc.0, it now tries to mount harddisk 1's data partition using XFS, and if it can, it checks for the presence of an "early.sh" script. If it exists, it changes the owner and access rights of the file and executes it. This gives you a chance to run a few commands before rc.bootbin gets started (see the next section). I strongly recommend against creating an early.sh: the system should be regarded as unstable until rc.bootbin is started. I envisioned using /harddisk/volume_1/data/early.sh as a way to change init scripts (by copying modified scripts from a different location or by using sed) if I would find bugs in them.

    I put a safety mechanism around the execution of early.sh: Before executing the file, another file "/harddisk/volume_1/data/earlyfail" is created and it is erased after early.sh returns. If something goes wrong and early.sh doesn't return, you can reboot the box. The rc.sysinit script will then find the earlyfail file and will skip execution of the early.sh script. That way the scripts prevent you from painting yourself into a corner; after all, if an error occurs and the execution of the user script stops, you won't be able to access the NAS200 to fix it either (except through the serial port). This way, when a corner-painting situation occurs, all you have to do is turn the box off and then on again.

    rc.0
    The first thing rc.0 does is execute the /usr/sbin/rc.bootbin program. This (closed-source) program does the following as far as I can make out:
    • mount the harddisks
    • set up the network
    • restore configuration from flash

    After this, rc.0 restores the time zone and runs the telnetd script (see the previous chapter).

    Next, it checks if a directory /harddisk/volume_1/data/rc.d exists; if so, it executes all files in that directory after performing a paint-into-corner failsafe check and after changing access rights and ownership of each file. [Edit 20080610 17:08 UTC]Only files starting with "rc." will be started, other files are ignored[End Edit]. It assumes that all files should be executable and it will try to execute the files in alphabetical order. You can use this to e.g. start a Twonkyserver that you have installed on the harddisk. Make sure that when you write scripts to store in the rc.d directory in the root of your first harddisk, you use an editor that's capable of writing Unix-style files, i.e. with Linefeed-only line endings.

    rc.0 chains to rc.1, so all the scripts that follow can be changed by your scripts that are executed from rc.d/ on your first harddisk.

    rc.1
    In the original firmware, this script was where rc.bootbin was started. The reason I split it up into rc.0 and rc.1 is that I thought it would be useful to make changes to the startup scripts from the user startup scripts which are run from rc.0.

    Other scripts in /etc are unchanged from the Linksys versions.

    Kernel changes
    I made changes to the kernel to support the loopback file system. In combination with the losetup applet which is now enabled in busybox, it's now possible to mount a file as filesystem. This makes it possible to mount e.g. the R71 beta firmware as filesystem and extract files that you're interested in. I'll leave it to your imagination what else you can do with this.

    The kernel now also has ext2 filesystem support so it can mount drives that were formatted with the R71 firmware in non-journalled mode (I have such a beast).

    [Edit 20080312 14:10 UTC]The kernel is about as big as it can get: only 1.75MB was reserved in the flash image. Further additions to the kernel will probably have to be in the form of modules that you can load with insmod.[End Edit]

    Additional Filesystems
    [Edit 20080312 14:10 UTC]I compiled modules for the following file systems and related items:
    • ISO-9660 with Joliet extensions
    • UDF
    • NFS version 3 and 4, client and server
    • SMB
    • CIFS
    I couldn't add these to the kernel because it would make the kernel too big to fit in the flash, but they are available at the location mentioned above. Simply unpack the file on one of the harddisks on your NAS and use "insmod" to install the module. Example:

    Code:
    $ cd /harddisk/volume_1/data
    $ tar xvz -f extrafsmodules.tar.gz
    fs/cifs/cifs.ko
    fs/exportfs/exportfs.ko
    fs/isofs/isofs.ko
    fs/lockd/lockd.ko
    fs/nfs/nfs.ko
    fs/nfs_common/nfs_acl.ko
    fs/nfsd/nfsd.ko
    fs/smbfs/smbfs.ko
    fs/udf/udf.ko
    net/sunrpc/sunrpc.ko
    $ cd fs/isofs
    $ insmod isofs.ko
    Using isofs.ko
    $ cat /proc/filesystems
    nodev   sysfs
    nodev   rootfs
    nodev   bdev
    nodev   proc
    nodev   sockfs
    nodev   pipefs
    nodev   futexfs
    nodev   tmpfs
    nodev   inotifyfs
    nodev   eventpollfs
    nodev   devpts
            ext2
            squashfs
    nodev   ramfs
    nodev   hugetlbfs
            msdos
            vfat
            ntfs
            xfs
    nodev   mqueue
            iso9660
    $
    New firmware available on Linksys website
    [Edit 20080626]This week, Linksys released a new version of the firmware (R75) that supports ext2 out-of-the-box.

    [Edit 20080725]Update: The source code for R75 is now available and will be used for the NASi200 project. The Jac0 firmware will not be updated anymore, but at least for now, Jac0 has more features than NASi200.
     
  2. axe2j

    axe2j Networkin' Nut Member

    Great work! Just a few questions:

    1) How do I get ext2 partitions to load. I first flashed R71 and formatted my disk ext2. I then "downgraded" to your firmware, and the disk it not automatically mounting. I can mount by hand, but would like it to be automatic.

    2) Have you given any thought to making the filesystems more *nix friendly? e.g. adding NFS support, or changing the samba configuration to support *nix permissions, etc. I compiled nfs-utils for the nas200, but haven't had the nerve to modify the kernel.

    Thanks!
     
  3. erwinr9207

    erwinr9207 Addicted to LI Member

    Great great great work jac.. thank you very much. now i can run screen and rtorrent. :)
     
  4. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    I don't know enough about the system yet to make it possible to make it mount ext2 partitions automatically and have them recognized by the web UI. I did the same thing you did (upgrade to 71 then back to 62) and I formatted my second harddisk in ext2 format while I had 71 running, but I never reformatted my first disk. I tried coaxing the system into automatically recognizing the second disk but the Linksys software just thinks it's not formatted for some reason. Now I just have a script in my "DISK 1\rc.d" directory that mounts the second disk at /harddisk/volume_1/data/disk2 so I can access it from my Windows system. It's a temporary workaround that works for me, for now.

    I have certainly been giving that some thought. I was also thinking it would be cool to connect a USB DVD-ROM drive and automatically grab CD's and DVD's to the harddisk (NiN/Pizzabox does this). It would also be cool to run FreeNAS. I want my generic solution to give everyone a choice from a large number of options, while still retaining all Linksys functionality. I even count on allowing users to run the Linksys beta firmware without flashing it.

    ===Jac
     
  5. ndyclrk

    ndyclrk Networkin' Nut Member

    Great work, Jac.

    Does your kernel have fat32 support? I ask because I'm hoping it's possible to connect an external hard drive and copy files via USB instead of across the network.
     
  6. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    Yes, FAT32 is supported.

    I didn't add it, though; it was already in the original Linksys kernel.

    Code:
    $ cat /proc/filesystems
    nodev   sysfs
    nodev   rootfs
    nodev   bdev
    nodev   proc
    nodev   sockfs
    nodev   pipefs
    nodev   futexfs
    nodev   tmpfs
    nodev   inotifyfs
    nodev   eventpollfs
    nodev   devpts
            ext2
            squashfs
    nodev   ramfs
    nodev   hugetlbfs
            msdos
            vfat
            ntfs
            xfs
    nodev   mqueue
    $
    Sorry, no ISO9660 or NFS at this time. Let me know if you're interested. [Edit: They are now supported as installable kernel modules, see the top of the thread]

    ===Jac
     
  7. ndyclrk

    ndyclrk Networkin' Nut Member

    NFS would be handy, but I'm just happy to see msdos, vfat, and ntfs. I think I'm going to be backing up my data and installing your firmware this evening.

    Once I've done this, my plan is to disable the installed version of Twonky, and install MediaTomb, mt-daapd, and later Asterisk. Do you see any problem with that?
     
  8. axe2j

    axe2j Networkin' Nut Member

    I would love it if you could build a new firmware with nfs (server) compiled into the kernel (ISO9660 would be useful as well, as you point out). With that, I think I can install nfs-utils on a harddisk and see if I can get it to serve files via NFS.
     
  9. axe2j

    axe2j Networkin' Nut Member

    FYI: I'm trying out running an rsync daemon on the NAS200, and it appears to work pretty well. I use rsync for backups and thought it might be faster to run rsync directly on the device rather than going through samba/nfs. I was concerned that it would use too much memory on large directories, but it appears to be working well so far.
     
  10. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    NTFS support is read-only. NTFS and vfat were enabled by Linksys, not by me, to support harddisks that are mounted through the USB ports.

    I have to say I have no experience with MediaTomb or FireFly (mt-daapd) but I see no reason why they wouldn't work, except maybe for possible performance issues when you try to make them recode media from one format into the other. But if Twonky works, then I suppose other media servers would work as well. Keep us informed of your findings!

    The same goes for Asterisk and for pretty much any other program you'd like to run: it should work if it can run on a headless PC under Linux 2.6.19, but don't expect it to run very fast because there's only 32MB of memory and only 150MHz of clock speed.

    So I'd say: go for it and let us know how it turns out.

    ===Jac
     
  11. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    Extra filesystem modules now available

    I uploaded a tar file with modules for a bunch of filesystems to my website. See the edits to my first post in this thread for a link and for installation instructions. You don't need to reflash your firmware, just unpack the tar.gz and use insmod.

    Have fun!

    ===Jac
     
  12. ndyclrk

    ndyclrk Networkin' Nut Member

    I suppose I probably could have answered my earlier fat32 question for myself if I had thought about it for a minute. The box allows the user to mount external thumb drives and hard drives, and would need fat32 and ntfs support for most users' drives.

    I think I'm going to stick with Twonky, because it's self-contained. MediaTomb depends on MySQL.

    Firefly also depends on avahi-client (bonjour/rendezvous), but I'm willing to work on getting this up and running because it provides a feature that is not currently available on the NAS200.

    Asterisk is something I plan to work on later.
     
  13. axe2j

    axe2j Networkin' Nut Member

    I don't know why I didn't think of just building kernel modules... In any case, I did get an NFS server running, although it required a couple more modules than were provided in your tarball. It wasn't hard to build my own models, though...

    I can provide more details if anyone else is interested in adding NFS support to the NAS200. It appears to work well, although it only achieves ~2MB/sec to an XFS drive.
     
  14. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    If you let me know which other modules are needed, I'll add them. Now I just did something like find fs -name '*.ko' | xargs tar cfvz extrafsmodules.tar.gz . I know that a lot more modules get generated but apart from two NLS related modules that are loaded by one of the init scripts, I don't think any are needed.

    That performance is indeed disappointing... :frown:

    ===Jac
     
  15. axe2j

    axe2j Networkin' Nut Member

    The following is a script that starts NFS. It shows what modules (and other programs from nfs-utils and portmap) are required:

     
  16. ndyclrk

    ndyclrk Networkin' Nut Member

    I concur on the disappointing performance. I thought I would see an improvement copying large amounts of data over usb vs. copying the same data over ethernet. No such enhancement observed, and once I transfer the data I still have to fix the permissions and ownership.

    I'm starting to think that it will make more sense to put my pair of hard drives in an old P4 2.4 HT machine and load Ubuntu server. It may consume more power, but I can use the same machine to rip DVD's and CD's. I can also put in more hard drives and a media card reader, and setting up the services I want is as simple as 'sudo apt-get install ..."
     
  17. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    axe2j, I added the missing net/sunrpc/sunrpc.ko to the extra modules tarball. Thanks!

    ===Jac
     
  18. 5circles

    5circles Networkin' Nut Member

    This is great! After struggling with a NAS200 that won't stop scanning, I'm hopeful that I'll be able to use shell access to help me get back to a working system.

    A couple of questions:

    1. I was hoping to customize the shell to make it easier to understand what's happening (using the shell to copy for example), but the shell doesn't seem to operate the way the documentation for ash and bash suggests. For example, PS1 is '\w \$ '. the \w is supposed to display the current path, but it doesn't.

    2. I've been trying to use cp -a to copy files between two disks, but the performance is still very slow. It looks like (from ps) that a lot of memory is being consumed, and I wonder if the system is just using more memory than is really available. But I don't understand a lot of what is going on.

    3. I'd really like to use the shell to keep an eye on the progress of disk scanning, but I don't know how to do this. It looks like /usr/sbin/CheckHDDDrive or /usr/sbin/DO_Scandisk would be the program that would run, but I don't know how to intercept the output.

    Any ideas greatly appreciated!

    Thanks
    Mike
     
  19. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    I'm glad you like it, and I hope it helps you solve your problem!

    You should realize that you're really talking to Busybox (and an old version of Busybox at that), not a "real" bash or ash. Just like other programs such as tar (where you have to use tar xvz -f filename instead of the usual tar xvfz filename), Busybox is different in some small subtle ways and this could be one of those differences. I'm sure you also noticed that the prompt is '$', not '#', even though you're logged in as root. Oh well; you'll get used to it. Of course you can always build or download a full version of bash if you want...

    I bet if your system is running a disk scan at the same time, it's using up a lot of memory and swapping like crazy. But even if you stop all services, there is still an unfortunate bandwidth limit on the PCI bus or on the SATA bus which appears to be around 6MB/s. That's how fast I've been able to read files off the harddisk anyway, and writing is even slower because of the journaled XFS filesystem. This is a hardware problem and there's nothing you can do about it, but now you have a shell you can always stop any processes that you don't need while you're doing a large copy.

    From the looks of it, clicking the Start/Stop Scandisk button in the utility screen starts CheckHDDDrive. Presumably, this does the actual disk scan by doing a system() call to start xfs_repair which does the actual work but I'm not sure of that. CheckHDDDrive probably just writes a file somewhere in some directory where it gets picked up by the web server, to let it know it's done. But if you're working in a shell, it doesn't really matter what really happens: you can always use the /sbin/xfs_repair program to see on your terminal what's going on.

    ===Jac
     
  20. pepsy

    pepsy Networkin' Nut Member

    Hi jac,

    a little quick question about mounting non journaled formatted hd...

    I upgraded to 3.71, formatted hard drive with non journaled file system, then downgraded to your firmware. I can mount the hard disk in that way:
    mount /dev/sda1 /harddisk/volume_1/data
    but it's not available automatically in the share list from network pc etc..

    Can you please tell me the way you mount the hd ?

    ty,

    pep
     
  21. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    My FIRST harddisk is XFS and gets mounted automatically by rc.bootbin. My SECOND harddisk is ext2 and gets mounted by a script that I put on my first harddisk in the rc.d directory. The Linksys web interface won't let you do anything with the harddisk unless it was mounted by rc.bootbin. I have yet to investigate why this is necessary but I tried mounting my second disk before rc.bootbin runs and it doesn't help.

    You could temporarily attach the harddisk to another computer and use a program such as gPartEd to do a bit of juggling in the partition table so that:

    - The new partition 1 is a new partition anywhere on the disk, type 83, with an XFS file system. This can be a small partition (a couple of MB)
    - The new partition 2 is the old partition 2 (configuration partition, type 83, XFS, unchanged)
    - The new partition 3 is the old partition 3 (swap partition, type 82)
    - The new partition 4 is the old partition 1 (type 83, ext2 formatted, size slightly reduced to make space for the new partition 1)

    That way, the rc.bootbin program will recognize the XFS partition correctly and you can use the web UI to set up shares and stuff. You can then create an rc.d directory on the new partition 2 with a script that mounts the old ext2 partition somewhere in the tree that's already shared e.g. /harddisk/volume_1/data/partition_4 will show up as "DISK 1/partition_4" on the network.

    ===Jac

    PS I haven't tried this and I don't know if it's actually possible to accomplish this using gParted. Back up your data!
     
  22. GregiBoy

    GregiBoy Networkin' Nut Member

    Error Message

    Hi Jac,

    I get the following whenI try to upgrade from the Web UI.

    Upgrade. Bad file name or format.

    I double checked the file size & checksum.
     
  23. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    If file size and md5sum are correct, I can only speculate...

    Try uploading the file from a different location, e.g. the root directory of your C: drive. Maybe there are characters in the path name that your browser doesn't understand.

    Maybe the file name (that ends in .bin) and the fact that you're trying to send it to a website, trigger your firewall software or virus scanner. Try disabling both of them temporarily (if you don't have a virus scanner, stop right here, get avg free at free.grisoft.com and scan your system).

    Use a different web browser (such as Internet Explorer :wink:)

    ===Jac

    PS Just to be clear: the extra filesystem modules are a tar.gz file, they can't be flashed.
     
  24. GregiBoy

    GregiBoy Networkin' Nut Member

    Fixed it

    It must have been the directory structure/naming.

    As you suggested, I put in the root of C: and it worked perfectly.

    Now on to the next steps of getting a version of Twonky working with the correct client.db

    Thanks again, Greg
     
  25. GregiBoy

    GregiBoy Networkin' Nut Member

    All working !!!

    Thanks Jac.

    I now have it all working with a SSH session being able to be established and telnet disabled. :biggrin::biggrin::biggrin:

    All I now have to do is work out how to modify Twonky or install the new version. :confused::confused:

    Can you point me in the right direction?

    Regards,
    Greg
     
  26. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    Excellent!

    On my box, the built-in Twonky is confused but since that's an old broken version anyway, I don't use it and haven't made any attempts to make it work.

    Instead, I downloaded the latest version for Linux from the Twonky website, the latest version at the time of this writing is 4.4.4.

    Unfortunately the people at Twonkymedia decided to distribute the program as ZIP file which is a format that the NAS200 doesn't understand. Also, the files are stored in the root directory of the zip instead of a subdirectory so you have to create a directory first, change to that directory and unpack there.

    I created a directory Twonky in the "DISK 1" share and used WinRAR to unpack the zip there from one of the computers on my network. WinZIP should also work, as well as the unzip command on Linux.

    After unpacking the ZIP over the network, you will have to log in to the NAS200 and change the ownership and access rights of the files, because they are owned by the user who wrote the unpacked files.

    Code:
    chown -Rh root /harddisk/volume_1/data/Twonky
    chmod -R 755 /harddisk/volume_1/data/Twonky
    To start Twonky automatically, create a text file in Unix mode (LF-only line endings!) called /harddisk/volume_1/data/rc.d/twonky.sh . You can use Notepad++ or Metapad from a network computer or vi from the NAS200 command line.

    Code:
    #!/bin/sh
    /harddisk/volume_1/data/Twonky/twonkymedia.sh start
    Make sure the built-in Twonkserver is disabled by using the web interface. Also, make sure that whichever way the twonkymedia.sh script is started (by script or from the command line), you start it by giving the full path, not e.g. "./twonkymedia.sh". I don't know why the Twonky people don't want to make the startup script figure out its own working directory, but oh well.

    Once it's running, you can reach the Twonky server by browsing to port 9000 of your NAS200 in a web browser, e.g. http://192.168.1.13:9000 . You should check and modify all settings there, not in the Linksys web interface.

    For further instructions, refer to the Twonkymedia.com website and the included documentation.

    Note that if you install Twonky this way, it will stop working after 30 days unless you purchase a license key. One could argue that the NAS200 includes a preinstalled Twonky so you shouldn't have to pay for another license, but on the other hand, you aren't really using the built-in version but a different version that you're installing yourself. Oh well. A new license key is only $39.95 (EUR 29.95) which I think is well worth it.

    ===Jac
     
  27. Gripi

    Gripi Networkin' Nut Member

    hi.. is it possible to make this firmware to automaticly sync from drive 1 to drive 2 without using RAID-1? just regular sync, using fat32 or ext3 filesystem.
     
  28. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    You're pretty much bound to XFS filesystem for the internal drives. FAT32 is used only on USB drives.

    Other than that, everything you can do from the command line of a PC running on a 486 processor is possible, including copying with cp, creating archives with tar, or doing remote backups with rsync (but you will have to find a working rsync first; any volunteers?).

    ===Jac
     
  29. redrocker5150

    redrocker5150 LI Guru Member

    Twonky Help

    I've been trying to get twonky setup but i get this error when I try to start it. I made a folder in Disk 1 called Twonky unzipped twonky to that folder and did the chmod's. What did I do wrong?


    Starting /harddisk/volume_1/data/Twonky/twonkymedia ... /harddisk/volume_1/data/Twonky/twonkymedia: 1:ELF: not found

    Almost forgot to mention the nice work you have done with this project.
     
  30. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    Sounds like a file corruption problem. Try unpacking the files with a different program (I recommend WinRAR, as mentioned). Make sure you unpack everything and that you retain the folder structure. The easiest is to unzip the files straight to the twonky folder; if instead you transfered the files there with FTP, you probably forgot to switch the FTP client to Binary mode.

    I just tried 4.4.4 on my own box (I had an older version installed until now) and followed my own instructions, it worked perfectly. Don't give up yet!

    ===Jac
     
  31. redrocker5150

    redrocker5150 LI Guru Member

    Thank you very much Jac. My ftp setting was set to auto. Switched to Binary and it runs now. Very nice work. Now I gotta fig out how to make the startup script for Twonky. I could really use some help with that. Trying to use notepad++ but I'm not sure exactly what to save the file as. Pretty much a nub @ scripts.

    So I've been trying to fig out the startup script for the past couple hours with no luck.
     
  32. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    Try this. No editing required, just enter the following commands from the NAS200 command prompt (telnet or ssh):
    Code:
    mkdir -p /harddisk/volume_1/data/rc.d
    echo '#!/bin/sh' >/harddisk/volume_1/data/rc.d/rc.twonky
    echo /harddisk/volume_1/data/Twonky/twonkymedia.sh start >>/harddisk/volume_1/data/rc.d/rc.twonky
    chmod 777 /harddisk/volume_1/data/rc.d/rc.twonky
    
    I just tried this by copying the text to my clipboard in Windows and pasting it into PuTTY (connected to my NAS200 at home) by right-clicking on the window, and it works :biggrin:

    After this, all you need to do is type (or paste) the command: /harddisk/volume_1/data/rc.d/rc.twonky . Or switch the box off and then on again, of course (*).

    ===Jac

    PS1 Notice that I used an uppercase "T" in the path to Twonky. Linux filenames are case-sensitive so modify accordingly if you unpacked Twonky to a different directory.

    PS2 The name of the script file (rc.twonky) doesn't really matter: all scripts are executed from the /harddisk/volume_1/data/rc.d directory in alphabetical order because that's how the names get sorted by the "for" command. That's why in many Linux distros you see startup scripts that start with numbers e.g. 00-do_me_first.sh or 99-do_me_last.sh

    PS3 (*) Rebooting from the command line is faster and can be done remotely, but you should type /etc/rc.d/rc.reboot instead of simply "reboot", so that the box has the opportunity to sync the file systems and shut down nicely.
     
  33. redrocker5150

    redrocker5150 LI Guru Member

    Success! Yes that worked like a charm. Everything is working. Thanks for the advice on the reboot. I was just using reboot. You have been very helpful, I thank you much.
     
  34. erwinr9207

    erwinr9207 Addicted to LI Member

    hi, jac. is it possible to use the usb port for webcam? :)
     
  35. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    I mentioned it before and I'll say it again: almost anything you can do on an 80486 PC without a monitor, keyboard or mouse can be done with the NAS200. This goes for the USB ports as well: they are just regular USB 2 ports (one is EHCI, the other is OHCI but that doesn't matter). It should be possible to connect a webcam or a printer or a scanner or whatever, but you will have to find the drivers and software.

    ===Jac
     
  36. jolcese

    jolcese Networkin' Nut Member

    Jac,
    I'm trying to uncompress the romdisk squashfs using unsquashfs but I get errors in some of the files.
    Did you tried it or did you mount it as a loop device?

    Thanks
    Jose
     
  37. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    You're not mentioning exactly what you're trying to do and how you're doing it, but you should know you can't simply mount a firmware image as loop device, because the rom image starts with the kernel. The actual file system starts at offset 1835008 (0x1c0000) in the rom image, so you will have to use losetup -o 1835008 on the NAS200 or use dd to extract the filesystem before loopmounting or unsquashing it. In case you want to use dd, the length of the filesystem is 128K maximum.

    These numbers are shown in the boot log when it shows the MTD partitioning information:

    Using physmap partition definition
    Creating 4 MTD partitions on "phys_mapped_flash":
    0x00000000-0x001c0000 : "Kernel"
    0x001c0000-0x007c0000 : "Initrd"
    0x007c0000-0x007e0000 : "Config"
    0x007e0000-0x00800000 : "Redboot"

    Hope this helps.

    ===Jac
     
  38. jolcese

    jolcese Networkin' Nut Member

    Jac,

    Thanks for your reply.
    What I'm trying to do is to open the initrd fs and modify it.

    As you know, in the GPL package for R62, the images directory has the bind tool that binds kernel (bzImage), initrd(romdisk), bootloader(redboot.bin) and config?(nd51.pid)

    The initrd(romdisk file) is supposed to be an squash filesystem. I'm trying to either unsquash this file or loopmount it. Both options are not working 100% correct. I can see some of the files on the filesystem but some give me errors when unsquashing it or give me I/O error if loop mounted.

    BTW, do you know the format of the nd51.pid file?

    Thanks
    Jose
     
  39. jolcese

    jolcese Networkin' Nut Member

    Ok, nevermind.
    I realized that the squashfs uses LZMA instead of GZIP.

    Thanks anyway

    Jose
     
  40. Rooki

    Rooki LI Guru Member

    Hi jac_goudsmit.

    You have mentioned before that It should be possible to connect a printer or a scanner or whatever, but we will have to find the drivers and software.

    We all know that Printer Wirelles USB Servers cost to much & we all have one USB port free, ...

    Is it possible to get some manuals, how to add Printer support to your firmware (for example: Canon IP4300 ) ???

    TNX again for your Great work!


    Regards.
     
  41. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    Unfortunately, I don't know the exact details on how to do this (anyone who does have experience with this is invited to share their knowledge here). As far as I understand (and I may be totally wrong about this!), what's needed is:
    • Support for printers in the kernel: you can compile this as a module and use insmod to load it
    • A printer daemon such as CUPS, and its dependent programs.

    According to an "emerge -pv cups" on my Gentoo Linux install, cups depends on a bunch of other programs and libraries such as libpaper, poppler and foomatic, depending on how you configure it.

    As I said, I have no experience doing this, so you have to do some digging yourself. I'll be happy to help you if you get stuck, but really Google is your friend.

    As an alternative solution, I would also suggest looking into programs such as USB Server which claims to provide a way to access USB ports remotely. I haven't tried it (yet!) and I don't know how well it works but in theory you can run the server program (i386 version) on the NAS200 and the client on a PC running Linux or Windows, and the PC will see anything you connect to the NAS USB port as if it were connected to the PC.

    ===Jac
     
  42. vakol

    vakol Guest

    Please can you post a tutorial how to install rtorrent??

    I am new here and i don't know how to do it.

    Thanks

    v
     
  43. redrocker5150

    redrocker5150 LI Guru Member

    SSH not showing directories

    For some reason when i log into ssh as root through putty. It takes about 30 seconds to connect and then I do ls i get this:

    $ ls
    Twonky lost+found rc.d
    extrafsmodules.tar.gz net redrocker
    fs public twonky.sh
    $

    I see no other directories.

    I also can't login through filezilla as root for ssh. It times out.

    FTP works but i still only see the same directories.

    Shouldn't I be able to login through filezilla with ssh as root?
     
  44. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    When you connect to the box using putty, it goes through a key exchange to make sure that the client and server trust each other. The first hard disk will be spinned up too. If you have programs running that take up memory (such as Twonky), the OS probably has to do some swapping to make space in memory for dropbear. All this takes time, although I agree 30 seconds is a bit on the slow side. My box answers to Putty within 10 seconds or so (but most of the time I don't have Twonky running).

    I have no explanation for the problem that you're not seeing directories. It looks like root's home directory got changed to /harddisk/volume_1/data (in which case you should still be able to cd to anywhere else), or somehow the first partition of your harddisk got mounted as root directory. Did you do anything that you're not telling us about? :eek:

    Filezilla has a timeout setting (default 20 seconds) at the Transfers item in the Edit-Settings screen. Try changing that to a higher value. If that doesn't work, try another FTP client. I myself use WinSCP which supports FTP, SFTP and SCP. My modified firmware understands FTP and SCP but you have to change the "everyone" group name on the NAS200 to something shorter (e.g. "evry1") to work around a problem that WinSCP can't interpret directory listings with large files because Busybox on the NAS200 doesn't leave a space between long group names and big file sizes.

    You can log in as root through ssh. However you cannot connect as root to the FTP server, for security reasons. Also, when you log on to the FTP server, what you will see is a virtual filesystem that only contains the shares that the current user is allowed to access according to the Web GUI settings.

    ===Jac
     
  45. ball007

    ball007 Guest

    I downloaded the firmware and the extrafsmodule. The modified firmware work and I can telnet into the nas200. However, when I was trying to add nfs support using insmod, I got the following error:

    $ insmod nfsd/nfsd.ko
    Using nfsd/nfsd.ko
    insmod: cannot insert `nfsd/nfsd.ko': Unknown symbol in module (-1): No such file or directory

    the following is the detail from dmesg output:
    nfsd: Unknown symbol posix_acl_from_xattr
    nfsd: Unknown symbol posix_acl_to_xattr
    nfsd: Unknown symbol posix_acl_valid
    nfsd: Unknown symbol nfsacl_decode
    nfsd: Unknown symbol posix_acl_alloc
    nfsd: Unknown symbol nfsacl_encode
    nfsd: Unknown symbol posix_acl_from_mode


    Then i try to insmod the nfs_acl.ko in nfs_common folder, I got the same error:
    $ insmod nfs_common/nfs_acl.ko
    Using nfs_common/nfs_acl.ko
    insmod: cannot insert `nfs_common/nfs_acl.ko': Unknown symbol in module (-1): No such file or directory

    The dmesg output show:
    nfs_acl: Unknown symbol posix_acl_alloc
    Fan is on.


    It looks like the module contain the symbol posix_acl* is missing. I would like to know which module i am missing?


    Thanks ^^
     
  46. redrocker5150

    redrocker5150 LI Guru Member

    Thanks for the help Jac. No I didn't do anything that I'm not telling you about. I'm not sure what happened. The last thing I did to the box was in my post before the last one when you helped me get twonky to start. I set filezilla timeout to 60 still no go. I know I was able to login ssh through filezilla.

    This is what happens when I try to login:


    Status: Connecting to 192.168.1.107:22...
    Response: fzSftp started
    Command: open "root@192.168.1.107" 22
    Command: Pass: ******
    Status: Connected to 192.168.1.107
    Error: Fatal: unable to initialise SFTP on server: could not connect
    Error: Could not connect to server

    Also I notice these extra Disk Directories when I ftp into the box. Can I delete Disk 1 1 and Disk 1 1 1.

    DISK 1
    DISK 1 1
    DISK 1 1 1
    PUBLIC DISK 1
    redrocker

    PS: I only have 1 500gb drive installed.
    Thanks for the help
     
  47. drummerroma

    drummerroma Guest

    Amule

    What about running amule on the NAS200? Has someone tried this?
     
  48. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    axe2j wrote a script to start NFS, it's on page 2 of this thread.

    ===Jac
     
  49. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    Filezilla supports FTP, SFTP, FTPS and FTPES. Out of those protocols, the NAS200 only supports FTP and you cannot log in as root with FTP (you will get a return code 421).

    You can log in as admin (or any of the users you set up in the Web GUI) and access your files. But remember FTP is not a secure protocol and all your data and your password will be visible on the network. You shouldn't use FTP to access your files except if you're using it only on a network where you trust everyone.

    If you want to transfer files securely, you will need a client program such as WinSCP that supports the SCP protocol (secure copy over SSH). Or if you insist on using FileZilla, you will have to find and run an SFTP server on the NAS.

    If you didn't create those shares from the Web GUI, it would seem likely that they are caused by a bug in FileZilla when it interprets the directory listing from the FTP server. I tried Filezilla 3.0.9.2 (which came out earlier this week), and I didn't see the problem on my box. You probably can't delete those directories because they are in the virtual root directory which doesn't really exist, it gets created for you by the FTP server program so you can see which shares are available to you. Either way, I wouldn't even try -- chances are that whatever you see in "DISK 1 1" is the exact same data as in "DISK 1" so if you delete everything in "DISK 1 1" it will be gone in "DISK 1" too. That would be bad :biggrin:.

    ===Jac
     
  50. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    Should be possible. You build, you try, you let us know :biggrin:

    ===Jac
     
  51. martin1749

    martin1749 Guest

    This works great!

    Jac,

    Never having touched a Linux box, I dared the step to upgrade my NAS to your firmware and it works great! Now I can have a proper Twonky running and explore additional possibilities.

    Thanks for your great work!
     
  52. newwolf

    newwolf Guest

    First of all very good job you made a hacked version for the NAS200.

    Offcourse there's always a but :tongue: should it be possible to install SABnzbd+ becourse you have to install Python-2.5.1 and my linux sucks hard.
     
  53. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    Once again: if a program runs on a headless 486 PC under Linux 2.6.19, it can probably be made to run on the NAS200. The same goes for this program, but since it's based on Python, you'd have to build a working Python first, and since Python is an interpreted language, you probably shouldn't expect much when it comes to performance; after all, the NAS200 only has a 486 at 150MHz and 32MB of RAM.

    The reason why I can't be more specific about programs like this is that (as stated in the original post), this firmware is just a temporary solution until I find a better way to run a more standard Linux (such as Debian or Gentoo) on the NAS200. The generic solution has been progressing slowly because I've been extremely busy at work.

    ===Jac
     
  54. Nymus

    Nymus Networkin' Nut Member

    Jac,

    I am trying to install rtorrent on my NAS200.
    As I am a *NIX noob, I had a look for (lightweight) torrent clients that run in text mode.
    I dunno if this is the most ideal torrent client available for the NAS200?
    If there are other torrent clients that are more lightweight and so more ideal to run on NAS200, please let me know so.

    After having a look at rtorrent I tried installing it.
    - Got libtorrent and rtorrent unzipped on /harddisk/volume_1/data/somedir
    - Ran ./configure in libtorrent subdir

    It came up with:


    ## ----------- ##
    ## Core tests. ##
    ## ----------- ##

    configure:2016: checking for a BSD-compatible install
    configure:2072: result: /usr/bin/install -c
    configure:2083: checking whether build environment is sane
    configure:2126: result: yes
    configure:2191: checking for gawk
    configure:2221: result: no
    configure:2191: checking for mawk
    configure:2221: result: no
    configure:2191: checking for nawk
    configure:2221: result: no
    configure:2191: checking for awk
    configure:2207: found /usr/bin/awk
    configure:2218: result: awk
    configure:2229: checking whether make sets $(MAKE)
    configure:2254: result: no
    configure:2541: checking build system type
    configure:2559: result: i486-pc-linux-gnuoldld
    configure:2581: checking host system type
    configure:2596: result: i486-pc-linux-gnuoldld
    configure:2630: checking for style of include used by make
    configure:2658: result: none
    configure:2731: checking for gcc
    configure:2761: result: no
    configure:2828: checking for cc
    configure:2875: result: no
    configure:2931: checking for cl.exe
    configure:2961: result: no
    configure:2989: error: no acceptable C compiler found in $PATH
    See `config.log' for more details.

    I see a whole lot of no's I don't know if these should worry me?
    Anyhow no C compiler was found in $PATH.

    Does this mean:

    - I have to change the $PATH variable to my C compiler path somehow?
    - Your firmware doesn't come with C compiler?
    - If I need to install a C compiler, which one is advisable taking into consideration the limited amount of resoures of the NAS200?

    Thx
     
  55. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    From a few Google searches it looks like rtorrent may be your best option: it's small and uses the console instead of a GUI.

    You can't compile programs on the NAS200 like you tried to do. You will have to use a precompiled binary for rtorrent (I don't know if these are available) or cross-compile using the compiler that's part of the Linksys source tarball. To do this, you will have to run ./configure with a number of options to tell it where the cross-compiler is and stuff... I'm thinking of writing a how-to cross-compile for the NAS200 but unfortunately my spare time is very limited right now; I can barely keep up with answering questions in these forums... :sad:

    ===Jac
     
  56. Bob Silva

    Bob Silva Guest

    OK, this is weird...

    First of all, thanks for the mod'ed kernel. It's very cool to have "real" access to the box.

    In "/home/httpd/html/Administration/disk_mode_fs.htm" line 118, there is...

    onClick="document.getElementById('main').contentWindow.saveIt()"

    ..which is all well and good. However, the code loaded in the browser (IE7) says...

    onClick="document.getElementById('main').contentWindow.save0It()"

    ...which is not good at all. I get a JS error - Object doesn't support this method - which of course is correct.

    Any clue -- any at all -- why this might happen? Better yet, how can I fix it?

    Frustrated,
    Bob

    P.S. I read thru the source and learned that mirroring will wipe out both disks. :( So, I got some work to do first...

    DOH!!! Ignore this message... I used Firefox and it worked fine. Gotta love IE... :(
     
  57. dsc68

    dsc68 Networkin' Nut Member

    passwd Idiosyncracies

    Whilst trying to get rdiff-backup working I've noticed a few idiosyncrasies with the passwd file.

    The home directory for all normal users needs to be something like /home/user/username - if it is anything else then both the ftp and web access fails for that user. The shell however can be anything. Somewhere the non-existent home drive is mapped to a share. But a non-existent home drive prevents the user from logging in via ssh. The /home filesystem is part of the flashrom so the non-existent home directories can't be created on the fly.

    This means you can set up a user for web/ftp access or ssh access but not both.

    In addition, for files to be accessible from the web interface, they need to be group readable - despite the error message saying they need to be world accessible.
     
  58. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    Thanks for the rdiff-backup stuff! I will probably use it myself to do network backups.

    However I think you've drawn a couple of wrong conclusions about the passwd file.

    I used the web interface to create three users on my NAS200 and they all have a blank home directory. Example:

    Code:
    jac:EpNaCsRsYwPoTrEdD:2000:501:::/dev/null1
    I haven't had a close look at the FTP and HTTP servers but I think they ignore the home directory setting, and that's okay because they don't need to provide access to the users' home directories. When you log in to FTP or to the HTTP file browser, what you see is a virtual root directory that probably is created on the fly, containing all the shares that can be accessed by the accounts. I think the FTP server reads the information from the smb.conf files or asks the Samba server directly. Logging in as root is forbidden by a configuration setting of bftpd.

    You're correct that a non-existent home directory will prevent logging in through ssh, but an invalid shell value will also do this: I'm pretty sure sshd reads the password information and starts the shell in the home directory, and prevents the login if any of this fails. So the shell setting can't be just anything.

    But there's more. As you can see in the sample passwd line above, the shell for this account is set to /dev/null1, other users in my /etc/passwd have /dev/null0. I think that a 1 means that the user can access the administrator web GUI.

    User numbers are also significant: all users created with the web interface have user numbers 2000 and above; built-in accounts have lower user numbers. This is probably how the software decides which users can be deleted. The decision on which users are visible in the web GUI is probably a matter of checking whether they are part of group 501 (everyone).

    That's correct, but I think it's because of the shell string, not because of the home directory. For FTP/HTTP access the shell string needs to be /dev/null0 or /dev/null1 (possibly other values are acceptable), but that is guaranteed to an invalid shell value for SSH.

    I didn't know that :)

    ===Jac
     
  59. civic95man

    civic95man Networkin' Nut Member

    Jac, I just want to thank you so much for all your posts and your moded firmware. I was about to return the NAS to the store until I found your posts. The main reason I bought this thing was because of the media server. I upset to find out that it doesnt even work correctly! I cant say thank you enough. keep up the good work.

    The only thing i dont like is that the slow file transfer rate (but I know you cant control it). It just makes having a sata kind of pointless.

    I've noticed that the hard drive shutdown and fan shutoff finally works with your firmware, It never did with the old one.

    I wonder if there is an internal temperature sensor that is accessible to linux. It would be kind of cool to provide the internal temperature of the NAS on the network.
     
  60. dsc68

    dsc68 Networkin' Nut Member

    smartctl can be used to get the temperature of the HDD which would be close to the internal temperature.

    When looking at the strings in the Linksys binaries I did come across a message saying the processor was overheating, which implies there is a way of measuring the CPU temperature.
     
  61. civic95man

    civic95man Networkin' Nut Member

    Does anyone know how secure the nas is to the internet on port 22? I'm thinking about opening up a port on my router for ssh to the nas for scp. Is it safe to do this? Thank you
     
  62. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    To be honest, there is no way to be 100% sure that your NAS200 is safe if you open any ports to the Internet. But unless someone discovers a vulnerability in dropbear 0.49 (the SSH2 server in my firmware), or someone discovers your root password, I believe your data is relatively safe: your data and passwords are transferred over an encrypted connection, and the designers of the SSH2 protocol went to great lengths to ensure that is practically impossible (i.e. would take years) to break the encryption or set up a "man in the middle" attack. For more information, check out this Wikipedia page about SSH.

    In theory it would be possible to launch a dictionary attack against your NAS: it's possible to run a program that connects to port 22 of your router, sets the username to root and then throws random passwords at it. But in this case, the slow speed of the NAS is an advantage because it will slow such an attack down significantly, to the point where it's no longer viable.

    So, as long as you set a strong root password and don't tell anyone, your data is (relatively) safe.

    ===Jac
     
  63. civic95man

    civic95man Networkin' Nut Member

    Great, thanks jac for your quick reply. I've ran a dictionary attack on my WPA2 encryption on my home wireless network and the password was not found so I should be fairly happy :) I used a similar password on the NAS. Thanks again
     
  64. civic95man

    civic95man Networkin' Nut Member

    I tried to log in remotely using winSCP and I get the following error:

    Command 'groups'
    failed with return code 127 and error message
    -sh: groups: not found.

    Is there a setting that needs to be changed?
     
  65. ahphoto

    ahphoto Networkin' Nut Member

    Hi Jac,

    I am considdering upgrading twonkymedia on my nas200, I have got a quick question about the trial licence, if I install that too see if it works what happens when the licence expires? Will it notify me? Will I be able to enter a new licence key if I buy a licence?

    Thanks
     
  66. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    This is harmless and you can ignore it. The program will work fine afterwards, but you will have to edit the /etc/group file on the NAS200 to make the name of the "everyone" group shorter (e.g. "all" or "evry1") so that WinSCP doesn't choke on directory listings with large files. See an earlier post in this thread.

    ===Jac
     
  67. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    When the license expires, I think the Twonky web GUI on port 9000 will keep working but it won't serve media files anymore. You can enter a license key through the web GUI or by editing the INI file.

    ===Jac
     
  68. civic95man

    civic95man Networkin' Nut Member

    Jac, thank you again for your help. Your work is the only reason i decided to keep my NAS, rather than return it for a different brand!

    I tried your tip of changing the 'everyone' tag in /etc/group to 'all'. now when I log and view the large files. I remember reading somewhere on here that SFTP was not built into the NAS and only SCP is. I just want to verify. The transfer is real slow, about 40KB/s in both directions. Is this normal? thank you again!
     
  69. civic95man

    civic95man Networkin' Nut Member

    I forgot to add in my last post that I can only log in under root. All my linux experience tells me that this is bad. Is this the only user that can remotely log in to the NAS for both SCP and SSH? Sorry to keep bothering you
     
  70. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    I get about 180KB/sec writing to the NAS200 via WinSCP. I only do it occasionally when I'm not at home so the slow speed is usually not a big deal (my Internet uplink is not very fast anyway). I don't know what would make yours so much slower; do you have the Twonky Server running or something?

    If you have a lot of data to read or write, you might want to consider temporarily attaching the drive in your NAS200 directly to a Linux PC via (E)SATA (shut the NAS200 down before you take the disk out!), and copying the data that way.

    In a normal Linux install, logging in as root is bad because of the amount of damage the account can do e.g. in case of a user error (e.g. do a "rm -Rf /$MYDIR" and then find out that $MYDIR is blank. Oops!). However, on the NAS200, the root filesystem is read-only and can't be made writable (squashfs) so logging in as root is much less likely to cause damage.

    Nevertheless, I do agree with you that it's much safer to use a different account. But keep in mind that by default, accounts created through the web GUI cannot log in through SSH. If you want to allow an account to log in, you have to change /etc/passwd to set the user's home directory, and so that the account's shell is set to e.g. /bin/sh instead of /dev/null0 or /dev/null1. Apparently the Linksys software depends on the shell string in /etc/passwd for other purposes so if you make these changes, your account can't log in to the web GUI anymore. The best thing is probably to keep two accounts for each "normal" user: one for web GUI and samba access, one for shell access.

    Don't forget to copy /etc/passwd to /harddisk/volume_1/conf if you make manual changes, otherwise the changes will get lost after a reboot.

    ===Jac
     
  71. burnoutbob

    burnoutbob Guest

    Hi.

    I have a quick question. I'm pretty new to all this, so please, forgive my simple-ness :)

    I'm having a lot of trouble getting the NAS to remember my root password. I've followed all your instructions, but no matter what I try, copying /etc/passwd to /harddrive/volume_1/conf just won't work. Well, it does, because if I then open /harddive/volume_1/conf it shows that it's the edited version, but after a reboot it reverts back to the original.

    Also, just to see if it'd work, I changed it, and before I rebooted, I tried logging in through ssh, and although it seemed to work, it then just closed my connection and my client (PuTTY for Linux) crashed.

    Am I missing something really stupidly simple here? :( Am I being really dumb and making a mistake somewhere?

    Please help shed some light on this.

    Thanks :)

    EDIT - Nevermind, there was a problem with my telnet client - ME. It's all working fine now. :):)
     
  72. biella1980

    biella1980 Networkin' Nut Member

    Hi jac,

    first of all thanks for your great job.

    I've a little problem with Twony startup script. It seems not works because my RAID1 si mounted on /harddisk/volume_3/data (not on volume_1).
    I saw that there is /etc/rc.d/rc.0 that runs at startup all of scripts in /harddisk/volume_1/data/rc.d .

    Is possible to modify by myself this script to run scripts in /harddisk/volume_3/data/rc.d ?


    Regards,
    Marco
     
  73. ahphoto

    ahphoto Networkin' Nut Member

    Hi Jac,

    Thank you for your advice on twonkymedia, and for prodiving the firmware! I have a new problem, now every time i boot up the device after 20 mins or so i think it starts to scan and I am unable to access the device. I have a 1tb hard drive installed with aprox 750gb used, it seems to take an age and never finishes, do you have any advice on how to stop the device from scanning? I see a guy mentioned shell access in an earlier reply but I have no idea what that means. Can you help?
     
  74. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    As I said, I haven't tested my modified firmware with a RAID setup. According to your information, in a RAID situation, the Linksys firmware mounts the harddisk on volume_3 and there's where the incompatibility comes in.

    The scripts on the harddisk are executed from /etc/rc.d/rc.0 and it's hardcoded to find the scripts on volume_1. While it's theoretically possible to change the script on the fly by writing an early.sh script containing a sed command, using an early.sh script is probably going to corrupt your RAID because my rc.sysinit mounts the first harddisk's data partition as XFS filesystem (no RAID) to find early.sh, and writes to the partition as part of the fail-safe mechanism.

    If you want, you can send me a Private Message and I'll send you the location of the full source code, so you can download it and modify it to your wishes.

    Thanks for the information, though. This will be useful for the generic solution that I'm still working on.

    ===Jac
     
  75. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    I have to admit that I don't use Twonky much myself, and I don't have an answer to this, except: make sure that the built-in Twonky is disabled in the Linksys web interface while you run an alternative Twonky. If there is really that much media on your disk, it may take a long time for Twonky to fill its database; remember this little box is a lot less powerful than your average PC so it can take many hours to scan 750GB for data and build a database from it.

    As for shell access: that's just another name for the command line interface that you can access via Telnet or PuTTY. I think it's outside the scope of this forum to explain what you can do with a Linux command line, sorry...

    ===Jac
     
  76. redrocker5150

    redrocker5150 LI Guru Member

    I still keep getting extra disk directories.

    Now I have a new dir DISK 1 1 1 1

    How do I keep this from happening? Should I stop using Filezilla Client? Isn't there any possible way of getting rid of these extra DISK folders?
     
  77. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    Did you try upgrading to the latest Filezilla? I tried 3.0.9.3 (2008-05-06) and I don't have the problem.

    Where is the "DISK 1 1 1 1" directory? Is it in the root directory i.e. at the same directory level as "DISK 1" and "PUBLIC DISK 1"? Or is it somewhere else?

    What files do you see in "DISK 1 1 1 1"? The same as in "DISK 1"? Or does the program give an error message when you try to access it?

    When you close Filezilla and then reopen it, does it still show the "DISK 1 1 1 1" directory?

    When you restart the NAS200 (push and release the power button on the back side, wait for it to shut down, then push+release the power button again, wait until you hear TWO beeps), and then reconnect with Filezilla, does it still show the "DISK 1 1 1 1" directory?

    When you open a My Computer explorer or an Internet Explorer in Windows, and type "ftp://admin@192.168.1.107" (without the quotes) in the address bar, do you still see the "DISK 1 1 1 1"?

    If the folder only appears in Filezilla and you're using the latest version, file a bug report at filezilla-project.org. You can also use a different FTP client (there are many good FTP clients out there, WinSCP is only one of them).

    ===Jac

    PS as I mentioned earlier, you can't log in as root to the FTP server: root access is blocked on purpose.
     
  78. redrocker5150

    redrocker5150 LI Guru Member

    Hey Jac thanks for the reply. Those directories show up in all ftp clients I have tried and also shows up in the browser gui. I've rebooted the nas several times and still all these extra directories. They all have the same files and yes they are in the root.
     
  79. DragonsLore

    DragonsLore Addicted to LI Member

    Hey Jac, the only times I've ever seen directories such as those created on the NAS200 was when there was corruption on one of the drives which wasn't fixed by the scan disk & repair operation. If you look were to connect the disk directly to a Linux PC, you would find that those directories are not really directories at all. What they are is Ghost Partitions such as a False Partition.

    But the problem here is you can't just delete the Ghost partitions as you run the risk of loosing your data by doing so.

    When these Ghost partitions get created, I don't know if the scan disk & repair operation fails to run which would explain this or what. - But then again, in away, it could be that what ever caused the corruption may have failed to trip the event triggers which cause the scan disk & repair operation to run at the next bootup.
     
  80. civic95man

    civic95man Networkin' Nut Member

    Hey, I have the same issue with mine, in terms of Disk 1 1 1 and so on. Question, Did you run the initial setup CD more than once? As I said, I have the same problem, but mine only shows Disk 1 1. It was fine when I first set it up. Then I found Jac's modded firmware. I thought i had to re-run the setup CD again to configure the NAS. After I ran it the second time did the DISK 1 1 appear. I chose the option that the disk is already formatted. I think its a setup CD/firmware problem (not Jac's problem but linksys's) that it will create another link to the disk (even though one already exits). Anyways, just an idea. I hope it helps some one. Now i gotta troubleshoot why my Twonky server quit working, Kyle
     
  81. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    I didn't make any changes to the FTP server so I don't think the problem is specific to my firmware.

    I think the information about file sharing and access is stored in the /etc/share.info file and that file gets backed up to the conf partition. If you guys are saying that you're seeing the same problem with different FTP clients, my theory is that some way that file got corrupted. I wonder if anyone with this prolem can paste their /etc/share.info into this forum, and/or edit it to see if it fixes the problem. Remember after you edit it, you should copy it to /harddisk/volume_1/conf too or it won't survive a reboot. Restart the NAS200 by running /etc/rc.d/rc.reboot (don't type "reboot").

    ===Jac
     
  82. civic95man

    civic95man Networkin' Nut Member

    I copied the /etc/share.info and pasted it below:

    DISK 1=0:1::/:administrators:7,kyle:7
    PUBLIC DISK 1=0:1::/public/:administrators:7,kyle:7
    jacquie=0:1::/jacquie/:administrators:7,jacquelyn:7,kyle:7
    DISK 1 1=0:1::/:administrators:7

    I am wondering if the multiple DISK 1 1...... is from the linksys install CD for the NAS? I'm thinking that it doesnt check to see that the drive is already configured but instead just creates another DISK 1 and and DISK 1 1 and so on. As I said in my last post, I ran the install CD twice by mistake and thats when I saw the DISK 1 1. I dont think its your firmware mod thats a problem.

    Are you thinking that if i were to delete the last line on the share.info that it would fix the problem? I'm really rusty with linux but could I comment out the line to test it? Is the comment a // or a #? thanks!

    On a side note, I saw that twonky is at 4.4.5. I know jac doesnt use it but can anyone else comment on if it is stable and works well? I have 4.4.4i and dont wanna upgrade if it wont fix or improve anything. I see they fixed avi support for the ps3 in 4.4.5 but other than that, anything else? Thanks
     
  83. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    I think you are right: the DISK 1 1 share is probably created by the install CD and is probably kinda intentional. It probably sees the modified "DISK 1" share and, rather than modifying it back to the default and thereby possibly removing someone's access rights, it sets up a new share with the default access rights and adds a "1" to the name.

    Can you go into the web interface and delete the "DISK 1 1" share? It will give you two message boxes, one to confirm the delete of the share, one to ask if it should delete the files too. Obviously you should be careful to select "CANCEL" in the second message box (even though OK is the default) or all your files will be gone!

    Commenting it out is probably not an option. This is not a standard Linux file(*) and it's not intended to be edited manually so the parser probably doesn't take comments.

    If you're having the problem and you're using my firmware, and if you're not familiar with vi, you can paste the following into a shell prompt:

    EDIT: doesn't work... see following posts
    Code:
    sed -e "/ 1 1=/ d" -i /etc/share/info;\
    cp /etc/share.info /harddisk/volume_1/conf;\
    killall bftpd 2>/dev/null
    This will delete all the shares ending with " 1 1" at the end (without deleting the files of course). If you have shares with 3 or more ones at the end, just do it multiple times.

    ===Jac
     
  84. redrocker5150

    redrocker5150 LI Guru Member

    Hey jac I tried your suggestion for pasting the code in shell and after the last line I get no such file or directory. I'm up to Disk 1 1 1 1 1. I haven't used ftp lately either nor have I ever used the disk that came with the nas. I know it's not your firmware because it did this to me when I had original firmware on it.
     
  85. redrocker5150

    redrocker5150 LI Guru Member

    Ok I just tried to do it to Disk 1 1 1 1 1 and now I cannot access any of the disks listed including my ftp upload diectory. I get this error:


    L] 230 User logged in.
    [L] SYST
    [L] 215 UNIX Type: L8
    [L] FEAT
    [L] 211-Extensions supported:
    [L] XPWD
    [L] EPRT
    [L] EPSV
    [L] ALLO
    [L] APPE
    [L] MDTM
    [L] XCWD
    [L] XCUP
    [L] XMKD
    [L] XRMD
    [L] REST
    [L] SIZE
    [L] UTF8
    [L] CLNT
    [L] 211 End
    [L] CLNT FlashFXP 3.6.0.1240
    [L] 200 Noted
    [L] CWD /
    [L] 250 OK
    [L] PWD
    [L] 257 "/" is the current working directory.
    [L] CWD redrocker
    [L] 451 Error: No such file or directory.
    [L] CWD DISK 1 1 1 1 1 1
    [L] 451 Error: No such file or directory.
    [L] CWD DISK 1 1 1 1 1
    [L] 451 Error: No such file or directory.
    [L] CWD DISK 1 1 1
    [L] 451 Error: No such file or directory.
    [L] CWD DISK 1 1
    [L] 451 Error: No such file or directory.
    [L] CWD DISK 1
    [L] 451 Error: No such file or directory.
    [L] CWD PUBLIC DISK 1

    I also notice that Disk 1 1 1 1 is no longer there. What happened and how do I get access back into these directories especially my share folder. Also I can access and download files via the browser gui. Help! Thanks in advance.

    I also noticed that when in the browser that admin has no rights to any of the folders. The radio buttons aren't able to change to read only or read/write.
     
  86. nobugme

    nobugme LI Guru Member

    Hi jac
    Thanks for putting this brilliant post for NAS200. I am stuck trying to get NFS working I have followed your script on page 2, but I get NFS is disabled. I have extracted extramodules in '/harddisk/volume_3/data/' so changed the volume name in the script and I have tried to run the script step by step and when it get to 'insmod ${MOD_DIR}/nfsd.ko' I get error.

    Please can you tell me where I am going wrong?

    many thanks
     
  87. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    If the commands shown in my previous post don't work, I guess you will have to reset your shared folders to the default settings:

    1. Open the Web GUI and go to the Firmware Upgrade page
    2. Click the Restore button at the bottom to go to the configuration restore screen
    3. In the configuration restore screen, don't enter a filename but select "Shared Folders" and click "Restore to default"

    ===Jac
     
  88. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    Is volume 3 where your internal harddisks are mounted? Are you using a RAID? Raid configurations won't work with some parts of my firmware, especially with the part that automatically runs scripts. If you put scripts on your harddisk and the firmware tries to run them, it may corrupt your RAID.

    Nevertheless... what is the exact error that you get when you run that command?

    ===Jac
     
  89. nobugme

    nobugme LI Guru Member

    Hi Jac, yes volume 3 is where all my data, and it does mount without any problem. I am using your firmware also using RAID, seems to be working fine. SSH and root access works ok.

    error I get as below, i have copied and pasted a few line below --

    $ insmod ${MOD_DIR}/exportfs.ko
    Using /harddisk/volume_3/data/extra/modules/exportfs.ko
    insmod: cannot insert `/harddisk/volume_3/data/extra/modules/exportfs.ko': File exists (-1): File exists
    $ insmod ${MOD_DIR}/lockd.ko
    Using /harddisk/volume_3/data/extra/modules/lockd.ko
    insmod: cannot insert `/harddisk/volume_3/data/extra/modules/lockd.ko': File exists (-1): File exists
    $ insmod ${MOD_DIR}/nfsd.ko
    Using /harddisk/volume_3/data/extra/modules/nfsd.ko
    insmod: cannot insert `/harddisk/volume_3/data/extra/modules/nfsd.ko': Unknown symbol in module (-1): No such file or directory
    ----

    thanks.
     
  90. biella1980

    biella1980 Networkin' Nut Member

    Hi jac,

    about the difficult to run automatic scripts from /harddisk/volume_3/data, can I add a line in /etc/rc in this way:

    #!/bin/sh
    ifconfig lo 127.0.0.1
    route add -net 127.0.0.0 netmask 255.255.255.0 lo
    /etc/rc.d/rc.sysinit
    #added by me
    /harddisk/volume_3/data/Twonky/twonkymedia.sh start

    finally I can copy in /harddisk/volume_3/conf like passwd

    Can be a good idea?

    Regards,
    Marco
     
  91. thainmlh

    thainmlh Networkin' Nut Member

    Hi,

    I've been struggling with this procedure.

    "To start Twonky automatically, create a text file in Unix mode (LF-only line endings!) called /harddisk/volume_1/rc.d/twonky.sh "

    Are you sure about that path? If you creat this directory, it disappears after a reboot.
    In another thread you mention creating "harddisk/volume_1/data/rc.d" for executing this like this.

    So, I tried creating harddisk/volume_1/data/rc.d/twonky.sh.

    If I execute this by hand, Twonky starts. But after a reboot, I notice that Townky is not running when I ssh into the box.

    Any help you can provide here would be awesome and THANKS for the GREAT WORK!!!

    ~Thainmlh
     
  92. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    Oops! My bad. I forgot the /data/ part. I edited the post, should be correct now.

    If the file is in the right location, if it contains LF-only line endings and if it starts with a line "#!/bin/sh", it probably means something goes wrong when Twonky starts. Maybe you should change the script so that the Twonky startup command sends all output to a file e.g.:

    Code:
    #!/bin/sh
    /harddisk/volume_1/data/Twonky/twonkymedia.sh start >/harddisk/volume_1/data/twonky_out.txt 2>&1
    chmod 777 /harddisk/volume_1/data/twonky_out.txt
    Maybe the twonky_out.txt will reveal what goes wrong.
     
  93. thainmlh

    thainmlh Networkin' Nut Member

    I'll give it a shot...though, since it works fine when I run the script by hand, I expected that the problem was that the script was just not getting executed at boot time...

    Thanks!!!

    Thainmlh
     
  94. rr1024

    rr1024 Networkin' Nut Member

    Stuck on telnet instructions

    Hello, was wondering if I could get some help with the password change / directory change instructions.
    I did successfully upgrade to your nifty version ;-)

    I telneted to the unit and used the passwd command however I'm stuck on step 3
    It says use vi to edit etc/passwd
    I change directories to etc and run vi passwd then enter it comes up with
    1st line
    root:WeeOvKUvbQ6nI :0:0:root:/root:/bin/sh

    so in step three are you saying the line should be
    root:WeeOvKUvbQ6nI :0:0:root:/:/bin/sh
    or
    root:WeeOvKUvbQ6nI :0:0:root:/harddisk/volume_1/data:/bin/sh
    Then how do I save this using vi?

    Then on step 4 how (what is the command line to copy) etc/passwd to /harddisk/volume_1/conf

    is it simple like
    "copy etc/passwd /harddisk/volume_1/conf" without the quotes?

    Thanks for any help, and sorry I'm a bit new to this.

    Also can I copy files back and forth between NAS and NTSF USB drive, I'd like to be able to load up my nas when down via USB and use the USB to back up the NAS.

    Also is it possible for the nas to use the backup button to copy everything on disk 1 to disk 2 with out network?

    Thanks all

    HTML:
       1. Log in to the NAS200 through telnet
       2. Use the passwd command to change the password
       3. Use vi to edit /etc/passwd to change the login directory from "/root" to e.g. "/" or "/harddisk/volume_1/data"
       4. Copy the modified /etc/passwd to /harddisk/volume_1/conf . Then reboot with the command: /etc/rc.d/rc.reboot. Don't use "reboot", you may destroy data! It's necessary to copy the file to the configuration partition of harddisk 1 because the /etc directory is a RAM filesystem. The file will be copied back from the harddisk to /etc as part of the boot process.
       5. After the reboot, verify that you can log in successfully through a Secure Shell (on Windows, use PuTTY). If you know that your password works (and survived the reboot), you can turn Telnet off in the next step. If not, start over with step 1.
       6. If you are 100% certain that you can log in through a secure shell after rebooting, turn the telnet daemon off with the command: touch /harddisk/volume_1/conf/no_telnetd
    
    
    
     
  95. rr1024

    rr1024 Networkin' Nut Member

    I have managed to edit the file etc/passwd

    1st line WAS
    root:WeeOvKUvbQ6nI :0:0:root:/root:/bin/sh

    1st line IS
    root:WeeOvKUvbQ6nI :0:0:root:/:/bin/sh

    I have copied the file from with the following command line

    cp etc/passwd /harddisk/volume_1/conf

    Then rebooted with command line
    /etc/rc.d/rc.reboot

    Opens SSH with the PuTTY
    it responds with
    login name i enter admin I think it's default right?
    it responds with password, I type in my password and I'm denied access until SSH is closed

    so I do the whole thing again and i get the same results?

    Should I be using the alternate path for
    root:WeeOvKUvbQ6nI :0:0:root:/:/bin/sh[/
    to
    root:WeeOvKUvbQ6nI :0:0:root:/harddisk/volume_1/data:/bin/sh
     
  96. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    You did everything right. But when it asks for a login name, you should enter "root" (without the quotes). Only root can log in through SSH and Telnet.

    Sorry for the vague instructions; I kinda did that deliberately to discourage beginners -- for now, this is a project for people who know what they're doing or (like you!) are eager to learn and experiment, and possible break stuff in the process.

    ===Jac
     
  97. rr1024

    rr1024 Networkin' Nut Member

    Thanks Jac,
    Actually I tried root too but that didn't work then I realized that my password was 11 chars long so I went through the process again and then used root and everything worked great!
    Thanks very much for the help.....

    Well being a hardware engineer, (expert and breaking software), I just wanted to play around with it a bit. In fact this is my second nas that I bought just to play with. I'm thinking about attempting to upgrade it using
    http://www.avalue.com.tw/products/ESM-2850.cfm
    http://www.fastwel.com/products/356046/epic/240096.html
    or something like that, basically I want to be able to load xampp on it and run my own little development server cause i dabble in php often ;-)
    http://www.apachefriends.org/en/xampp.html


    And thanks for all the hard work and very nice mod, I'm going to go poke around on it now...thanks
     
  98. thainmlh

    thainmlh Networkin' Nut Member

    AH HA! I figure out this issue...
    I renamed twonky.sh to rc.twonky.sh and guess what...the server started ar boot!

    I was looking at your /etc/rc.0 script and noticed the following line:
    "for x in /harddisk/volume_1/data/rc.d/rc.*"
    so, I figured that my twonky.sh should instead be rc.twonky.sh...and I guess I was right.

    Is this correct? or did I just get lucky or something. Figured I post if I was correct so others could benefit.

    Thanmlh
     
  99. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    Ummm... Yes you are right. The file name has to start with rc.* ... Funny, I didn't even remember putting that in. I bet I did that so I could easily rename files to put them offline and to prevent problems with editors that automatically write a backup file.

    Good find!

    ===Jac
     
  100. thainmlh

    thainmlh Networkin' Nut Member

    Problem with attached USB disks

    Hi,

    When I attached an external USB drive to the first USB port, I see the HDD_1_1 share appear, but I can't access it via windows because it asks for a password.

    I tried the user I creayed, as well as the admin user...no dice,

    Permissions on /harddrive/volume_6/data/... look good.

    Any ideas? Does this have someshing to do with those /etc/*.info files? With the config files in /etc/smb?

    Thainmlh
     

Share This Page