Debian Lenny on the NSA-220

Marvell Orion based
whopperg
Posts: 1
Joined: Sat Feb 05, 2011 9:19 am

[UPDATE] Debian Lenny on the NSA-220

Post by whopperg » Sat Feb 05, 2011 10:07 am

Hi everyone!

Just wanna share some infos / howto that i learned when i installed debian on my nsa-220:

Infos about my BOX:
Firmware 3.22
2x HDDs ( Western Digital; Model: WD10EACS-00ZJB0) RAID 1
Connected via GigaBit Switch

Lets begin:

First thing i noticed is that after the first (or second) boot of the box, the sys led keeps blinking and the fan was gone wild ;-)
so as you can see some posts earlier, there is a way how to fix this - but its not an permanent fix. after reboot the sys led keeps blinking again.
Here is what i do to fix this:

just copy and past this code into your terminal session (telnet or ssh)

Code: Select all

mkdir /usr/AllPack
cd /usr/AllPack
lzma -d /mnt/firmware/AllPack.lzma -c | tar x -C /usr/AllPack 
mount --bind /usr/AllPack/usr/ /mnt/firmware/usr/ 
mount --bind /usr/AllPack/sbin/ /mnt/firmware/sbin/
after that, you can check thats all correct by running:

Code: Select all

/etc/init.d/nsa220.sh start
it should print some output like this:

Code: Select all

 1047 ?        00:01:01 fanctrld
and the sys led should stop blinking and stay on.

is everything ok then modify /etc/init.d/nsa220.sh so it looks like this:

Code: Select all

# PATH should only include /usr/* if it runs after the mountnfs.sh script
# ADD by ME

mount --bind /usr/AllPack/usr/ /mnt/firmware/usr/   # <<< PASTE ONLY THIS LINE HERE
mount --bind /usr/AllPack/sbin/ /mnt/firmware/sbin/ # <<< PASTE ONLY THIS LINE HERE

PATH=/sbin:/usr/sbin:/bin:/usr/bin
DESC="ZyXEL specific stuff"
NAME=zyxel.sh
Try to reboot an see if the sys led stops blinking. Done.

Next step: Configure smb/samba deamon:

after you install the samba server ( apt-get install samba ), and you want to access your shares via a windows machine, without being asked for username and password (yeah i know what your security guys thinking - but its all behind a firewall and only my pc and my ps3 have a connection to the box :-) ) , then edit this file

/etc/samba/smb.conf like this:
(add or modify the settings to the global seciton)

Code: Select all

[global]
guest account = root
guest = ok
public = yes
netbios name = storage 	# or what ever name you want
workgroup = WORKGROUP   # this should be the same as your windows pc workgroup
security = share	
preferred master = no
At the end of the File, put your shares. here's some examples - they should work on every box because they are the default ones:

Code: Select all

[public]
	path = /mnt/md0/public
	hide dot files = no
	writeable = yes
	public = yes
	guest = ok

[music]
	path = /mnt/md0/music
	hide dot files = no
	writeable = yes
	public = yes
	guest = ok

[photo]
	path = /mnt/md0/photo
	hide dot files = no
	writeable = yes
	public = yes
	guest = ok

[video]
	path = /mnt/md0/video
	hide dot files = no
	writeable = yes
	public = yes
	guest = ok

[root]
	path = /
	hide dot files = no
	writeable = yes
	public = yes
	guest = ok
save the file.

now change the owner and permissions of the shared folder to gain full access to your files:

from shell:

Code: Select all

cd /mnt/md0

chown -hR root photo
chown -hR root:root photo
chmod 777 photo -R

chown -hR root music
chown -hR root:root music
chmod 777 music -R

chown -hR root video
chown -hR root:root video
chmod 777 video -R

chown -hR root public
chown -hR root:root public
chmod 777 public -R
all done? then restart the samba server:

Code: Select all

smbd restart
now try to access your shares. if something doesnt work - REBOOT!!!

Some more things that i found very helpful:

midnight-commander (apt-get install mc)
Webmin (see webmin website for installation instructions)

the only thing thats left is an dlna server - but thats task im doing right after im finish writing this ;-)

Another hint - if you press the powerbutton for like 10 secs (beeps 2 times) the box will get switched off ...

Greetings and a BIG THANKS to Mijzelf who has made all this possible!


[UPDATE]
How to compile transmission 2.13 for your new debian box:

First, Download source:

Code: Select all

wget http://download.transmissionbt.com/files/transmission-2.13.tar.bz2
get additional needed libs (because the defaults are way to old) and set up your make enviroment (be WARNED! this needs alot of time and space! (min 170 MB)) :

Code: Select all

apt-get install build-essential automake autoconf libtool pkg-config libcurl4-openssl-dev intltool libxml2-dev libgtk2.0-dev libnotify-dev libglib2.0-dev libevent-dev

wget http://ftp.de.debian.org/debian/pool/main/libe/libevent/libevent-1.4-2_1.4.13-stable-1_armel.deb
wget http://ftp.de.debian.org/debian/pool/main/libe/libevent/libevent-extra-1.4-2_1.4.13-stable-1_armel.deb
wget http://ftp.de.debian.org/debian/pool/main/libe/libevent/libevent-core-1.4-2_1.4.13-stable-1_armel.deb
wget http://ftp.de.debian.org/debian/pool/main/libe/libevent/libevent-dev_1.4.13-stable-1_armel.deb
install the deb files:

Code: Select all

dpkg -i *.deb
extract transmission and build (takes also a awful lot of time):

Code: Select all

tar xvjf transmission-2.13.tar.bz2
$ cd transmission-2.13
$ ./configure -q && make -s
$ su (if necessary for the next line)
$ make install
there are many warings - but i dont have any problems using transmission so far ;-)

after all that is done, start the daemon for the first time:

Code: Select all

/etc/init.d/transmission-daemon start
wait a few seconds then stop the daemon

Code: Select all

/etc/init.d/transmission-daemon stop
now the initial config files a created under /root/.config/transmission-daemon/settings.json

you now can check that your config file is working:

Code: Select all

transmission-daemon -f
it should give you an output similar to this:

Code: Select all

[14:20:03.291] Transmission 2.13 (11501) started (session.c:624)
[14:20:03.292] RPC Server Adding address to whitelist: 127.0.0.1 (rpc-server.c:789)
[14:20:03.292] RPC Server Adding address to whitelist: 1.2.3.* (rpc-server.c:789)
[14:20:03.292] RPC Server Serving RPC and Web requests on port 9091 (rpc-server.c:962)
[14:20:03.292] RPC Server Whitelist enabled (rpc-server.c:966)
[14:20:03.292] RPC Server Password required (rpc-server.c:969)
[14:20:03.293] DHT Generating new id (tr-dht.c:384)
[14:20:03.293] Using settings from "/root/.config/transmission-daemon" (daemon.c:483)
[14:20:03.293] Port Forwarding (NAT-PMP) initnatpmp succeeded (0) (natpmp.c:70)
[14:20:03.293] Port Forwarding (NAT-PMP) sendpublicaddressrequest succeeded (2) (natpmp.c:70)
[14:20:03.293] Saved "/root/.config/transmission-daemon/settings.json" (bencode.c:1683)
[14:20:03.293] transmission-daemon requiring authentication (daemon.c:503)
[14:20:04.301] Port Forwarding (UPnP) Found Internet Gateway Device "http://1.2.3.254:49000/upnp/control/WANIPConn1" (upnp.c:113)
[14:20:04.301] Port Forwarding (UPnP) Local Address is "1.2.3.250" (upnp.c:115)
[14:20:04.301] Port Forwarding (UPnP) Port forwarding through "http://1.2.3.254:49000/upnp/control/WANIPConn1", service "urn:schemas-upnp-org:service:WANIPConnection:1".  (local address: 1.2.3.250:51413) (upnp.c:202)
[14:20:04.301] Port Forwarding (UPnP) Port forwarding successful! (upnp.c:205)
[14:20:04.302] Port Forwarding State changed from "Not forwarded" to "Forwarded" (port-forwarding.c:95)
[14:20:33.591] DHT Attempting bootstrap from dht.transmissionbt.com (tr-dht.c:241)
[14:20:40.661] Searching for web interface file "/root/.local/share/transmission/web/index.html" (platform.c:526)
[14:20:40.661] Searching for web interface file "/usr/local/share/transmission/web/index.html" (platform.c:526)
if you dont get any errors, you can quit with CTRL-C


If you want to run transmission automaticly at boot time, use webmin or something else to do so ;-)

Thats done.

Next: DLNA-Server :-)

Csatarij
Posts: 1
Joined: Sun May 15, 2011 7:20 am

Re: Debian Lenny on the NSA-220

Post by Csatarij » Sun May 15, 2011 7:25 am

Is it possible to run Debian on the NSA-221, too?

Mijzelf
Posts: 6205
Joined: Mon Jun 16, 2008 10:45 am

Re: Debian Lenny on the NSA-220

Post by Mijzelf » Sun May 15, 2011 10:42 am

Yes and no.

Yes as in: This box is fully capable of running Debian. There are no reasons why it wouldn't run.
No as in: The trick used for the 220 (using reloaded.ko to load a Debian compatible kernel) doesn't work (yet) for the 221. I've done some work on the 210 (which is almost identical to the 221), and I succeeded in starting Debian, but the reloaded kernel failed in initializing/starting the network interface, making this almost useless.

KeyCat
Posts: 70
Joined: Tue Apr 05, 2011 8:07 am

Re: Debian Lenny on the NSA-220

Post by KeyCat » Wed Aug 03, 2011 5:18 pm

Thanks to Mijzelfs guide I now have Debian Lenny up running but I'm a bit unsure about one thing.... so I better ask before I screw something up ;)

Should I install mdadm even if I only have one HDD as a JBOD in the NSA-220 or is mdadm only for RAID HDDs?

/KC

Mijzelf
Posts: 6205
Joined: Mon Jun 16, 2008 10:45 am

Re: Debian Lenny on the NSA-220

Post by Mijzelf » Wed Aug 03, 2011 6:00 pm

Yes, you need mdadm if you want to access a firmware made datapartition. JBOD is also handled by mdadm.

And mdadm won't screw anything up, if it's not needed. It will only take a few milliseconds bootup time (to check if there are any raid arrays to manage) and maybe a few MB's of diskspace.

KeyCat
Posts: 70
Joined: Tue Apr 05, 2011 8:07 am

Re: Debian Lenny on the NSA-220

Post by KeyCat » Wed Aug 03, 2011 6:30 pm

Installing mdadm now.

Thanks for your help Mijzelf!

/KC

KeyCat
Posts: 70
Joined: Tue Apr 05, 2011 8:07 am

Re: Debian Lenny on the NSA-220

Post by KeyCat » Thu Aug 04, 2011 3:50 pm

After getting the basics up running (MC/Samba/lighttpd/vsftpd) I tried to get S.M.A.R.T working, searched for and installed smartmontools (via apt-get).

However, what I thought would be a simple query failed and I'm stuck figuring out what I'm doing wrong here.

Code: Select all

smartctl -a -d marvell /dev/md0
Returns...

Code: Select all

Smartctl: Device Read Identity Failed (not an ATA/ATAPI device)

A mandatory SMART command failed: exiting. To continue, add one or more '-T permissive' options.
also tried with -d ata and adding -T normal but no go...

Another thing I wonder is if there is a utility to read system temperature, fan RPM and how to control the fan? Lurking around I found "/mnt/firmware/etc/init.d/conf_ADT7463A.sh" that seems to set up the fan controller and then start fanctrld but I couldn't find any clues on how to get temperatures etc. but in other places I see references to "lm85" wich I assume is the hardware monitor?... any help appreciated.

/KC

KeyCat
Posts: 70
Joined: Tue Apr 05, 2011 8:07 am

Re: Debian Lenny on the NSA-220

Post by KeyCat » Thu Aug 04, 2011 5:19 pm

Found a utility named "lm-sensors" to read temps and fan RPM and just wanted to share if anyone else is struggling in the Linux world ;)

Install by...

apt-get install lm-sensors

After it's installed type...

sensors

and you will get something like the following:

Code: Select all

adt7463-i2c-0-2e
Adapter: SMBus mv88fxx81 driver
V?:          +2.45 V  (min =  +0.00 V, max =  +3.32 V)
VCore:       +1.19 V  (min =  +0.00 V, max =  +2.99 V)
V3.3:        +3.30 V  (min =  +0.00 V, max =  +4.38 V)
V5:          +5.06 V  (min =  +0.00 V, max =  +6.64 V)
V12:        +12.09 V  (min =  +0.00 V, max = +15.94 V)
CPU_Fan:     986 RPM  (min =    0 RPM)
CPU Temp:    +45.2°C  (low  = -75.0°C, high = +75.0°C)  
Board Temp:  +45.2°C  (low  = -75.0°C, high = +75.0°C)  
Remote Temp: +34.8°C  (low  = -75.0°C, high = +75.0°C)  
cpu0_vid:   +0.000 V
You do not have to run sensor-detect since drivers was alreayd loaded (fanctrld ?) and
there is a config file (sensors3.conf) to edit in etc/.

Edit under the following section...

Code: Select all

    ...
    #
    # Sample configuration for the Intel S845WD1-E
    # courtesy of Marcus Schopen 
    #
    chip "lm85c-*" "adm1027-*" "adt7463-*" "lm85-*" "lm85b-*"
    ...
Haven't verified temps yet but fan RPM seems to be same as I remember, will read some more and test...

Here are the data sheet for ADT7463 (not needed for lm-sensor)

http://datasheets.pl/A/ADT/ADT7463.pdf

Also want to thank whopperg for info on how to fix the blinking SYS LED (and other info), thanks man!

/KC

Mijzelf
Posts: 6205
Joined: Mon Jun 16, 2008 10:45 am

Re: Debian Lenny on the NSA-220

Post by Mijzelf » Sat Aug 06, 2011 8:48 am

KeyCat wrote:However, what I thought would be a simple query failed and I'm stuck figuring out what I'm doing wrong here.

Code: Select all

smartctl -a -d marvell /dev/md0
The point is that md0 is not the disk. It's a raid-array. The disks are /dev/sda and /dev/sdb. So try:

Code: Select all

smartctl -a -d marvell /dev/sda
KeyCat wrote:and you will get something like the following:
Nice! Do those value also wiggle a bit? I am surprised that there are that much sensors available (and that much values to measure). Can this also be used to write a script to do the fancontrol, and ditch fanctrld?
KeyCat wrote:You do not have to run sensor-detect since drivers was alreayd loaded (fanctrld ?)
This kernel is build especially for this box. So it's to be expected that the driver is already in the kernel. (It doesn't make sense to put it external, when you load it anyway)

KeyCat
Posts: 70
Joined: Tue Apr 05, 2011 8:07 am

Re: Debian Lenny on the NSA-220

Post by KeyCat » Sat Aug 06, 2011 2:32 pm

Mijzelf wrote: The point is that md0 is not the disk. It's a raid-array. The disks are /dev/sda and /dev/sdb. So try:

Code: Select all

smartctl -a -d marvell /dev/sda
Tried both /dev/sda and /dev/sdb but still the same problem? Also tried sda1/2 and "-d ata" but no go...

Code: Select all

smartctl -a -d marvell /dev/sda
smartctl version 5.38 [armv5tel-unknown-linux-gnu] Copyright (C) 2002-8 Bruce Allen
Home page is http://smartmontools.sourceforge.net/

Smartctl: Device Read Identity Failed (not an ATA/ATAPI device)

A mandatory SMART command failed: exiting. To continue, add one or more '-T permissive' options.
It's wierd since I know the S.M.A.R.T works when running the original configuration and looking in /mnt/md0/.zyxel/zy-pkgs/bin there is a smartctl, smartd along with a script that Zyxel is using, seems like the same program to me?
Nice! Do those value also wiggle a bit? I am surprised that there are that much sensors available (and that much values to measure).


Yes, all except "cpu0_vid" vary a bit so looks like they are active. Below is some results taken over time...

Code: Select all

adt7463-i2c-0-2e
Adapter: SMBus mv88fxx81 driver
V?:          +2.45 V  (min =  +0.00 V, max =  +3.32 V)
VCore:       +1.18 V  (min =  +0.00 V, max =  +2.99 V)
V3.3:        +3.31 V  (min =  +0.00 V, max =  +4.38 V)
V5:          +5.08 V  (min =  +0.00 V, max =  +6.64 V)
V12:        +12.09 V  (min =  +0.00 V, max = +15.94 V)
CPU_Fan:    1091 RPM  (min =    0 RPM)
CPU Temp:    +42.2°C  (low  = -75.0°C, high = +75.0°C)  
Board Temp:  +41.5°C  (low  = -75.0°C, high = +75.0°C)  
Remote Temp: +31.0°C  (low  = -75.0°C, high = +75.0°C)  
cpu0_vid:   +0.000 V

adt7463-i2c-0-2e
Adapter: SMBus mv88fxx81 driver
V?:          +2.45 V  (min =  +0.00 V, max =  +3.32 V)
VCore:       +1.19 V  (min =  +0.00 V, max =  +2.99 V)
V3.3:        +3.31 V  (min =  +0.00 V, max =  +4.38 V)
V5:          +5.08 V  (min =  +0.00 V, max =  +6.64 V)
V12:        +12.16 V  (min =  +0.00 V, max = +15.94 V)
CPU_Fan:    1006 RPM  (min =    0 RPM)
CPU Temp:    +45.2°C  (low  = -75.0°C, high = +75.0°C)  
Board Temp:  +44.5°C  (low  = -75.0°C, high = +75.0°C)  
Remote Temp: +34.0°C  (low  = -75.0°C, high = +75.0°C)  
cpu0_vid:   +0.000 V


adt7463-i2c-0-2e
Adapter: SMBus mv88fxx81 driver
V?:          +2.46 V  (min =  +0.00 V, max =  +3.32 V)
VCore:       +1.19 V  (min =  +0.00 V, max =  +2.99 V)
V3.3:        +3.30 V  (min =  +0.00 V, max =  +4.38 V)
V5:          +5.08 V  (min =  +0.00 V, max =  +6.64 V)
V12:        +12.09 V  (min =  +0.00 V, max = +15.94 V)
CPU_Fan:     986 RPM  (min =    0 RPM)
CPU Temp:    +44.2°C  (low  = -75.0°C, high = +75.0°C)  
Board Temp:  +44.5°C  (low  = -75.0°C, high = +75.0°C)  
Remote Temp: +33.0°C  (low  = -75.0°C, high = +75.0°C)  
cpu0_vid:   +0.000 V
Can this also be used to write a script to do the fancontrol, and ditch fanctrld?
Thats what I hope for but since I'm pretty much n00b at this I haven't figured out how yet...
This kernel is build especially for this box. So it's to be expected that the driver is already in the kernel. (It doesn't make sense to put it external, when you load it anyway)
OK and thats a good thing.

I just wanted to clarify that you don't have to run sensor-detect after installing lm-sensors. It actually hung my NAS when searching for ISA and I had to do a hardreset.

Damn, after searching the 21000+ repository a bit my head is spinning about the all the things this little NAS eventually can do when running Debian, just wonder how far you can go with 128 MB RAM and a 500 MHz CPU but quite far I guess ;)

Nice to have a WWW server (built in one was crap so never used it) and a FTP server up running and the best is that it's power consumption in standby is just 14 W (18-21 W with HDD active).

/KC
Last edited by KeyCat on Sat Aug 06, 2011 4:31 pm, edited 1 time in total.

Mijzelf
Posts: 6205
Joined: Mon Jun 16, 2008 10:45 am

Re: Debian Lenny on the NSA-220

Post by Mijzelf » Sat Aug 06, 2011 3:11 pm

It's wierd since I know the S.M.A.R.T works when running the original configuration and looking in /mnt/md0/.zyxel/zy-pkgs/bin there is a smartctl, smartd
You can try that smartctl.
I remember there was an issue with the kernel, which was solved later. Alas I can't remember the status of the kernel you are using (I suppose it's the one I provided long,long ago?) Maybe you should build you own kernel from the latest GPL sources.
just wonder how far you can go with 128 MB RAM and a 500 MHz CPU but quite far I guess
Well, I can tell you what I did (simultaneous):
  • Webserver (lighttpd) with several virtual servers, a https site, and webdav.
  • FTP server (vsftpd).
  • Samba server.
  • NFS server.
  • TFTP server (used as bootserver in cooperation with my router)
  • Tor relay.
  • HTTP proxy (polipo)
  • Mailserver (exim4, dovecot, fetchmail)
  • Webmail (roundcube)
  • NBD server (to create some diskspace for my router. It didn't support USB or NFS, but by compiling a kernelobject I got a NBD client running)
  • rsync daemon
  • Torrent client (transmission)
  • Usenet downloader (nzbget)
  • Web downloader (download daemon)
  • IPv6 tunnel (sixxs, aiccu)
  • SSH server (duh!)
And maybe some more, which I can't recall at the moment. The memory was not a problem, as far as I know. (I did choose low memory options, as far as possible).
Recently I replaced my '220 by a more powerful Kirkwood based NAS (Debian Squeeze on, at the moment, linux 2.6.39) mainly because webmail was a bit slow. (And because I could buy a relatively cheap, bricked Lacie 2Big2 ;) )

KeyCat
Posts: 70
Joined: Tue Apr 05, 2011 8:07 am

Re: Debian Lenny on the NSA-220

Post by KeyCat » Sat Aug 06, 2011 4:35 pm

Mijzelf wrote:You can try that smartctl.
Will try and report back.
Alas I can't remember the status of the kernel you are using (I suppose it's the one I provided long,long ago?)
Yes, I downloaded lenny_for_nsa220.zip from your site and the newest file are "extract_me.tgz" dated 100103 - 18:14:36.
Maybe you should build you own kernel from the latest GPL sources.
A bit above my head at the moment, trying to get a grasp on all new things in Linux world but maybe if I find a good HowTo/book. For me this is a long term "project" and I'm going slow while trying to learn as much as possible, next up is rsync daemon...

Thanks for sharing your (old) program list, would be fun to read what other people use their NSA-220+ for...

/KC

KeyCat
Posts: 70
Joined: Tue Apr 05, 2011 8:07 am

Re: Debian Lenny on the NSA-220

Post by KeyCat » Sat Aug 06, 2011 6:05 pm

Same result with programs from Zyxel.

Code: Select all

smartctl -a -d marvell /dev/sda

Returns:

smartctl 5.39.1 2010-03-18 r21914 [arm-unknown-linux-gnu] (local build)
Copyright (C) 2002-10 by Bruce Allen, http://smartmontools.sourceforge.net

Smartctl: Device Read Identity Failed (not an ATA/ATAPI device)

A mandatory SMART command failed: exiting. To continue, add one or more '-T permissive' options.
However after remember seeing some scsi processes running I tried with:

Code: Select all

smartctl -a -d scsi /dev/sda 

Returns:

smartctl version 5.38 [armv5tel-unknown-linux-gnu] Copyright (C) 2002-8 Bruce Allen
Home page is http://smartmontools.sourceforge.net/

Device:   C      WD10EADS-00L5B1  Version: 01.0
Device type: disk
Local Time is: Sat Aug  6 19:56:48 2011 CEST
Device does not support SMART

Error Counter logging not supported
Device does not support Self Test logging
And WD10EADS-00L5B1 is my HDD so some progress at least but since it doesn't report back S.M.A.R.T values and I know for sure S.M.A.R.T is enabled on that HDD the mystery continues...

/KC

Mijzelf
Posts: 6205
Joined: Mon Jun 16, 2008 10:45 am

Re: Debian Lenny on the NSA-220

Post by Mijzelf » Sun Aug 07, 2011 12:00 pm

I PM'ed you a link to the kernel and modules my NSA220 was running on. Have a try with them.

KeyCat
Posts: 70
Joined: Tue Apr 05, 2011 8:07 am

Re: Debian Lenny on the NSA-220

Post by KeyCat » Mon Aug 08, 2011 11:18 am

Thanks mate, will check it out!

/KC

Post Reply