UFS200

query($qstats);
}

$qvisits = ‘SELECT COUNT(*) FROM statistics WHERE request_uri=”/ufs200/” AND x_forwarded_for!=”192.168.7.1″ AND script_name LIKE “%/index.php” AND user_agent NOT LIKE “%bot%”;’;
$rvisits = $conexion->query($qvisits);
$rvisits = $rvisits->fetch_row();
$visits = $rvisits[0];

$qdownloads = ‘SELECT COUNT(*) FROM statistics WHERE request_uri LIKE “%/download.php?get_file=ufs200v11” OR request_uri LIKE “%/download.php?get_file=ufs200v11_mirror1″ AND x_forwarded_for!=”192.168.7.1″ AND script_name=”/ufs200/download.php” AND user_agent NOT LIKE “%bot%”;’;
$rdownloads = $conexion->query($qdownloads);
$rdownloads = $rdownloads->fetch_row();
$downloads = $rdownloads[0];

?>

Announcing UFS200 v1.1

About

UFS200 a is full writable USB filesystem for your NAS200 running jac4 or higher. UFS200 v1.1 was downloaded times since 2013-06-22 when it was released
It provides the same features as jac4 firmware, plus all these new:

  • New shell with updated Busybox (a lot more and updated applets than the original one)
  • Rsync support
  • Bittorrent support (dctcs + ctorrent)
  • aMule 2.2.4
  • iSCSI Enterprise Target 1.4.19 (iSCSI support – turn your NAS200 into a SAN)
  • VBlade (AoE support – turn your NAS200 into a SAN)
  • Midnight Commander 4.6.1
  • UnRAR
  • Shoutcast support (listen to your music anywhere)
  • lighttpd/1.4.23 (ssl)
  • PHP 5.2.10 (fastcgi + cli) + extensions (mysql + mssql + gd + etc)
  • MySQL 5.0.85
  • SQLite 3.6.17
  • No-IP DynDns client
  • nfs-utils 1.0.10
  • Vim 7.2 (with sintax support)
  • Terminfo support
  • OpenVPN 2.1.1 (routed mode and bridged mode now supported!)
  • kexec (load your own custom Linux kernel anytime!)
  • OpenSSL 0.9.7e
  • Maintenance mode (similiar to “single” user mode)
  • CUPS (share your USB printer and print over the network) new!
  • SANED (share your USB scanner and scan over the network) new!
  • APCUPSd (UPS monitoring) new!
  • Plowshare new!

As jac4, by default, UFS200 will not interfere with the standard NAS200 features provided by Linksys standard firmware.
Almost all the new features comes unconfigured and disabled by default (specially the network services). So you can enable them as needed and also configure them to run at startup by editing a simple file.
If after trying UFS200 you decide not to use it, rolling back is as simple as turning off the NAS200, removing the USB drive and turning NAS200 on again.
UFS200 is not a firmware, it requires jac4 or higher in order to run.

Where to get it

You can download UFS200 v1.1 from here or from this mirror (courtesy of Jac).
MD5: 65d91dcd743b3aeb477e07342cbb5d34

Running UFS200

To run UFS200 first of all you need:

  • One USB flash drive formated with FAT32 and at least 1GB of free space
  • Jac4 already installed and running. You can get it from here.
  • Some GNU/Linux knowledge (file copying, editing, at least).

Installation steps

  1. Download UFS200 from the link above.
  2. Unpack the RAR file into a USB drive formatted with FAT32 and at least 1GB of free space.
  3. Login as root to your NAS200 already running Jac4 through SSH and execute the following:
    Code:
    # cd /harddisk/volume_X/conf/
    # cp passwd passwd.ufs200
    # vi passwd.ufs200

    Note: X is a number between 1 and 6 and it depends of your harddisk configuration. For example for RAID1 configuration X=3.

  4. Edit the passwd.ufs200 file and add this lines:
    Code:
    mysql:x:15:77:MySQL server:/var/lib/mysql:/bin.newbusybox/sh
    lighttpd:x:16:78:Lighttpd server:/home/lighttpd:
    amuled:x:17:79:aMuled user:/home/amuled:
  5. Also modify the line for root user to look like this (except for “WhatEverHashForYourRealPasswordIs”):
    Code:
    root:WhatEverHashForYourRealPasswordIs:0:0:root:/root:/bin.newbusybox/sh
  6. Save and close the passwd.ufs200 file.
  7. Back to the prompt, execute the following:
    Code:
    # vi groups
  8. Edit the “groups” file and add the follwing lines:
    Code:
    mysql:x:77:mysql
    lighttpd:x:78:lighttpd
    amuled:x:79:amuled
  9. Save and close the groups file.
  10. Upload the file rc.ufs200_boot that comes in the RAR file to your NAS200.
  11. Make sure that you put the rc.ufs200_boot file in /harddisk/volume_X/data/rc.d/ directory.
    Note: X is a number between 1 and 6 and it depends of your harddisk configuration. For example for RAID1 configuration X=3.
  12. Also make sure that you don´t have more files starting their filename with “rc.”. If so, it´s really recommended that you move them somewhere else at least for the first run of UFS200 and until you verify that everything is working as expected with UFS200. Just for the record, the rc.ufs200_boot script is in charge of booting a custom kernel if the user decides to do and also to launch the normal UFS200 startup process. If you don´t need your scripts to run at this precise moment of the booting process it would be better to run them from the /etc/rc.d/rc.local file right after the system finishes the starup process.
  13. Shutdown the NAS200.
  14. Plug the USB drive to the NAS200 USB port 1 (and ONLY to that port, since it will not boot from the other port).
  15. Turn on the NAS200.
  16. Enjoy playing with UFS200 and its features.

Enabling and disabling features at startup

You can enable and disable features at startup, easily, by commenting or uncommenting them in: /etc/rc.d/rc.ufs200_services_startup.

Please keep in mind that if you enable or disable a feature at startup, you also need to do it for shutdown and reflect it by commenting or uncommenting the corresponding line in: /etc/rc.d/rc.ufs200_services_shutdown

Notes about some features

Running a custom kernel

With UFS200 you will be able to run a custom kernel image after the normal startup or even on every startup.
UFS200 already provides a custom Linux kernel that you will need to run in order for OpenVPN feature to run in bridged mode. But of course this is also usefull if you need to run a custom kernel image for anything else you can think of right know.
To run your custom kernel:

  1. Compile your custom kernel BzImage in another computer and copy it to /boot/ in the NAS200 running UFS200.
  2. Make sure that the symlink /boot/vmlinuz point to the kernel image that you want to use.
  3. Run /etc/rc.d/rc.kexec_reboot

If you want to make this the default kernel for all your future startups you just need to execute:

Code:
# touch /boot/boot_my_custom_kernel

If you want to go back to the stock kernel, then just:

Code:
# rm /boot/boot_my_custom_kernel

And after the next reboot, the NAS200 will be running the stock kernel.

MySQL Server

UFS200 MySQL server data dir is: /var/lib/mysql .
By default this is symlink to a directory in the same path named mysql.data. It’s highly recommended that you move this directory and its content to a harddisk in the NAS200 and then point the /var/lib/mysql symlink to the new path.

Default password for MySQL server (change it ASAP): “admin” (without quotes).

OpenVPN Server

You can run OpenVPN server in two modes:

  • Routed mode (default)
  • Bridged mode

For further details of each mode please consult OpenVPN documentation.
Regarding UFS200 to run OpenVPN server in bridged mode you need to boot the system with the included custom kernel.
You can do this by executing:

Code:
# touch /boot/boot_my_custom_kernel
# /etc/rc.d/rc.reboot

After the NAS200 reboot you will be able to run OpenVPN server in bridged mode.

To run OpenVPN server in routed mode (default) use: /etc/rc.d/rc.openvpn script.
To run OpenVPN server in bridged mode you should use: /etc/rc.d/rc.openvpn_bridged script.

Midnight Commander

To launch Midnight Commander run: mc200.
Don´t call it directly by running: mc.

Maintenance Mode

Maintenance mode is very similar to “single” user mode in every other GNU/Linux distribution. When you go into “Maintenance Mode” the system will stop almost all running processes, umount the harddisks and remount the root filesystem as readonly.
This can be usefull if for example you want to run e2fsck on a harddisk.

To go into “Maintenance Mode” run: /etc/rc.d/rc.maintenance_mode
To reboot the NAS200 while in “Maintenance Mode” run: /etc/rc.d/rc.maintenance_mode_reboot
To shutdown the NAS200 while in “Maintenance Mode” run: /etc/rc.d/rc.maintenance_mode_halt

What you are not getting with UFS200

I will not support or answer any questions regarding specific configuration of UFS200 features like:

  • How can I configure MySQL replication?
  • How should I configure NFS server?
  • How can I configure virtual hosts in lighttpd?
  • And so on

To configure any feature in particular please go to the application website and review it’s documentation. And at the end you will always have www.google.com.

I will only answer questions regarding this apps and running them in UFS200, or problems itself.

Known Bugs (you need to read this!)

  • The fan control script (rc.ufs200_fan_control) is not working with some HDDs brands. It has problems with: Seagate at least. It can be fixed by changing a regexp in the script or moving from sed to awk.
  • The fan control script is not working when only one HDD is installed in NAS200. The script needs to be fixed.
  • When booting to a new kernel UFS200 is not cleanly unmounting the data partition which can lead to a filesystem corruption problem.
  • If dctcs is stopped with running torrents, the torrents will not be killed. In a reboot process this may prevent the conf or data partition to be cleanly unmounted which can lead to a filesystem corruption problem.
  • New torrents download added through dctcs will not be reniced. After adding new downloads to dctcs they are not going to be reniced to low the priority of the process on CPU usage.
  • When connecting a USB flash drive to NAS200 it will not be automatically mounted and shared as expected.
  • The download manager included with NAS200 in some cases is not working. When you add a download to the download manager, it will not start and it will be showed in the list as “Unknown”.

DISCLAIMER
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 USB filesystem. By initiating a download of any part of my USB filesystem in any form, you acknowledge that you understand that this USB filesystem 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 USB filesystem 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.

Visits: