Using Debian on linksys NAS-200
NAS200 is 486 (x86) architecture so for us building
i386 debian is perfect.
first i build debian base system on my laptop with this
#debootstrap --arch i386 etch /tmp/debian http://ftp.de.debian.org/ debian
wait a while - you will have a time for cup of cofee
next thing to do is to tar /tmp/debian with
#tar -cvvf debian.tar /tmp/debian
then download this firmware
http://www.goudsm.it/nas200/ NAS200_V34R62jac0.bin
and uprade your NAS 200
then restart it
Now you have XFS support so you can upload files larger than 2GB ( imposiible on fat 16 [the fs used on nas 200])i386 debian is perfect.
first i build debian base system on my laptop with this
#debootstrap --arch i386 etch /tmp/debian http://ftp.de.debian.org/
wait a while - you will have a time for cup of cofee
next thing to do is to tar /tmp/debian with
#tar -cvvf debian.tar /tmp/debian
then download this firmware
http://www.goudsm.it/nas200/
and uprade your NAS 200
then restart it
You will need XFS because it is imposiible to install your debian ot FAT .(no sumbolik liks, and no user permissions )
Now go to your web interface and format the hard drive using XFS.
Then login using ftp and upload debian.tar somewhere on the hard disk .
for me it is /debian folder
i created a user called debian , and uploadet debian.tar in his directory so now i can be sure that nowbody will delete it .
go to System Options on your web interface and change ports for the interface ( changed HTTP (Web Browser) Port Number to 8081 )
from now you will be able to configure your NAS from http://192.168.1.111:8081 ( or whatever is your nas's IP addres )
we are doing this because port 80 will be used by our apache2 that we are going to install later ;)
Now you will have to telnet to your nas200 on port 23
so:
#telnet 192.168.1.111 23
or whatever is your NAS200's IP
#cd /harddisk/volume_1/data/
debian/
now untar the file that you uploadet before fey minutes
#tar -xvvf debian.tar
( wait until untar the file )
go to debian's root directory
#cd /harddisk/volume_1/data/
now untar the file that you uploadet before fey minutes
#tar -xvvf debian.tar
( wait until untar the file )
go to debian's root directory
#cd /harddisk/volume_1/data/
debian/tmp/debian
mount dev and proc
#mount -t proc proc proc
#mount -o bind /dev dev
chroot in your new debian system
#/harddisk/volume_1/data/ debian/tmp/debian/usr/sbin/ chroot . /bin/bash
now you should see something like this
root@NAS200_A2CD84:/#
Now you have your debian installed
you can use this lines to install apache php mysql-server phpmyadmin proftpd
#apt-get update
#apt-get install apache2 php5 mysql-server phpmyadmin proftpd ssh
to start apache use
#/etc/init.d/apache2 start
start mysql server
#/etc/init.b/mysql start
start proftpd FTP server
#/etc/init.d/proftopd start
if you fave hard disks or USB drives formated under ext* FS you can mount them from your debian using
// mount /dev/sda* /mnt
to secure your nas and disable telnet
you can simply kill inetd from outside of chroot jail
#exit
killall inetd
( this will not disable you web interface )
now you can add users and use your virtyal debian as a real one
it's easy :)
( one important note , running debian as chrooted environment on your hard disk is not the best solution .Better one is to run it from USB , at first it is faster , second thing is that your HDD wil not work forever , so it will not overheat "nas 200 has a problem with cooling so be carefull, in theory nas200 has a small cooler , in practise , it has no cooler at all" )
One Advice .... try to look for new Intel Mini motherboards [D945GCLF2] with intel atom 330 ( dual core with Hyper threading [ 4 logical cores ] ) it's cheaper... faster ( cpu is faster and with 10/100/1000 Lan ) and it has 2xSATA & 1 IDE interfaces .
so that's it
not so scaring ;)
mount dev and proc
#mount -t proc proc proc
#mount -o bind /dev dev
chroot in your new debian system
#/harddisk/volume_1/data/
now you should see something like this
root@NAS200_A2CD84:/#
Now you have your debian installed
you can use this lines to install apache php mysql-server phpmyadmin proftpd
#apt-get update
#apt-get install apache2 php5 mysql-server phpmyadmin proftpd ssh
to start apache use
#/etc/init.d/apache2 start
start mysql server
#/etc/init.b/mysql start
start proftpd FTP server
#/etc/init.d/proftopd start
if you fave hard disks or USB drives formated under ext* FS you can mount them from your debian using
// mount /dev/sda* /mnt
to secure your nas and disable telnet
you can simply kill inetd from outside of chroot jail
#exit
killall inetd
( this will not disable you web interface )
now you can add users and use your virtyal debian as a real one
it's easy :)
( one important note , running debian as chrooted environment on your hard disk is not the best solution .Better one is to run it from USB , at first it is faster , second thing is that your HDD wil not work forever , so it will not overheat "nas 200 has a problem with cooling so be carefull, in theory nas200 has a small cooler , in practise , it has no cooler at all" )
One Advice .... try to look for new Intel Mini motherboards [D945GCLF2] with intel atom 330 ( dual core with Hyper threading [ 4 logical cores ] ) it's cheaper... faster ( cpu is faster and with 10/100/1000 Lan ) and it has 2xSATA & 1 IDE interfaces .
so that's it
not so scaring ;)
Comments
To install it on usb drive you should format the drive under ext file system. Than to mount the drive from the nas200 terminal under some directory. ( i cant remember what was the device for the usb drive so for this example i will use /dev/sdc ).
Login to your nas200
1) create directory /mnt/usbdireve
#mkdir /mnt/usbdrive
2) mount usbdrive there
#mount /dev/sdc /mnt/usbdrive
3) assuming that you put your debian on this drive inside a directory named 'debian', navigate to it.
#cd /mnt/usbdrive/debian
4) mount dev and proc
#mount -t proc proc proc
#mount -o bind /dev dev
Then chroot using this directory '/mnt/usbdrive/debian' instead of "/harddisk/volume_1/data/debian"
If you have some other questions don't hesitate to ask.
Good luck :).
there's only one more think. can i use some script to start debian when nas turn on?? i dont know. some rc.file?? thanks again and sorry for my bad english!!
Try to write some empty file on init.d directory on your nas ( not on the chrooted debian ) and to reboot.
if this file exist after reboot than you can place it in the init.d directory and make it executable ( keep in mind that files in init directory are executed in alphabetical order, so make it so it executes last ).
If file does not exists after reboot. There is other way. You can create a script on your desktop computer do execute the list of commands over telnet ( you have a telnet port enabled after changing the firmware ) and to start it from your PC or any other remote computer.
And there is other way that comes in mind. Try to mount the bin-file of the firmware as loop device in your desktop as RW ( read-write ). Inject your script in init folder and update the firmware again with your version.
All the methods that i suggest in this comment are just ideas that i never tried. My Nas200 is now at the garage somewhere .... probably covered with motorcycle parts and old hardware :-)
i won this old NAS of a friend of mine and i want use as media server for my daughter and wife. they will use as media server to watch her movies and cartoons .
i will use as torrent server to download hers movies and cartoons ! :-)!!
thanks, i will try and tell you latter! thanks!