Sunny Setup Part 1

Neues Wochenende, neues Glück :-).

Ich habe mittlerweile auch die anderen Betriebssysteme durch:

FreeBSD:
Obwohl dies einer meiner Favoriten war, werde ich nicht FreeBSD einsetzen. Die ZFS-Unterstützung ist teilweise noch erschreckend.
Ohne angepassten Kernel gibt es wohl noch des öfteren Kernelpanics. Weiterhin scheint bei dem FreeBSD-Projekt selber nach einer Umstellung des Packet-Servers auf ZFS
ein paar Probleme aufgetaucht zu sein.
pro:

  • Sehr schmale Installation möglich.
  • Unterstützung der eingebauten Encryption-Hardware (siehe VIA-Eden-Plattform)
  • Unterstützung von encrypted devices

contra:

  • Warnmeldung bei Netzwerkzugriffen (Packet lost/Packet Timeout)
  • ZFS ohne “Kernel-Hacking” nicht ausreichend stabil.

Zu Milax ist nicht viel zu sagen. Es ist scheint für einen kleineren Desktop eine gute Wahl zu sein (graphisch macht es schon etwas her und nutzt nur wenig Ressourcen).
Für einen Server ist es aber wohl wenig geeignet. Es gibt zwar eine spezielle Server-Version, allerdings ist auch hier die Unterstützung der VIA-NICs nicht gegeben.

Nachtrag:
OpenSolaris. Da OpenSolaris schon erfolgreich in NAS-Systemen eingesetzt wird [1,2,3], habe ich mir die Developer-Preview von Project Indiana besorg und testweise installiert.
Leider scheint es out of the Box nur möglich zu sein, eine Komplettinstallation mit Gnome usw. durchzuführen. Das ist schade, verspricht der Weg, den Sun mit Project Indiana eingeschlagen hat, doch durchaus vielversprechend zu sein. Aber anscheinend scheint auch hier die Hardwareunterstützungen auf reine Intel/AMD-Systeme beschränkt zu sein.

Nun sitze ich als wieder vor einem Nexenta-System.
Ich bin gerade dabei, ein iSCSI-Target aufzusetzen um dann mal einen aussagekräftigen Wert für die Datenübertragung erhalten zu können.

Blogged with the Flock Browser

Software Update

Ich hatte mittlerweile etwas Zeit, mich um eine allererste Softwareinstallation meines NAS-Systemes zu kümmern.
Die Grundausstattung des Mainboards ist etwas mau. Es liegt eine CD (mit Treibern und PDF-Handbuch) bei, eine kleine Karte mit der Beschreibung des Lieferumfangs und ein IDE-Kabel.
Die Kabel für die 4 Sata-Anschlüsse muss man sich dann erst noch kaufen.

Was mir bisher auffiel:

  • Das Bios hat eine genial animierte Laufleiste. Erinnert irgendwie an Windows 2000.
  • Das Bios scheint sehr Buggy zu sein – veränderte Einstellungen (wie ein neues Boot-Device) werden nicht abgespeichert.
  • Man erhält beim Starten durch Drücken von F11 ein Startmenü.

Abschließend meine bisherigen Ergebnisse:
Das System ist _SEHR_ leise – bis auf den Lüfter des Netzteiles hört man nichts. Okay das DVD-Laufwerk dann noch.
Die Einschätzung der Geschwindigkeit ist schwierig – dazu später mehr. Als NAS aber denke ich ausreichend.

Software-Tests:

Nexenta Core Platform 1.0.1 (NexentaCore):
pro:

  • Root- (Boot-) Partition ist ZFS-Device.
  • Da ich nur eine schmale Installation gewählt habe (um die 256 MB), kann man mit dem System gut arbeiten.
  • SSH, Sata (RAID im Bios ausstellen) und Netzwerk werden auf Anhieb gefunden.

contra:

  • Niedrige Netzwerkperformance (1-2 MB). Ich denke mal einfach, dass selbst eine 1 GHz CPU sicherlich mehr schaffen wird.

Solaris: Project Indiana – Developer Preview:
pro:

  • Grafischer Installer

contra

  • Größerer footprint (ab 1,5 GB)
  • Netzwerkkarten nicht erkannt
  • Oberfläche sehr langsam

Bisher haben mich beide Systeme nicht wirklich überzeugen können – Schade eigentlich, waren das doch meine Favoriten.
ich werde mich nun befassen mit Milax und FreeBSD.

Vielleicht sollte ich die Tage dann noch ein paar Worte zu meinen Anforderungen an das OS verlieren :-).

Blogged with the Flock Browser

Codename Sunny

I really had to wait a long time to get finally the first little part of my NAS-System.
I recently received my ordered VIA mini-itx Mainboard.


You can read more about this Hardware on the via homepage.
Unfortunately i have currently no DDR2 RAM available.
So i could only assemble it to an atx-case.




Yes, there is lots of space left :-).

This will be the base of sunny V 0.0.0.1:

  • VIA EPIA-SN10000EG
  • around 1-2GB DDR2 RAM (you cannot get less for reasonable money.
  • Standard ATX-Case
  • some brand 350W PSU
  • some brand DVD-Drive
  • one 20GB PATA Laptop hard disc
  • one 40GB PATA IBM hard disc

So there will be i tiny Problem with the drive connection.
I can either connect a DVD and one hard disc or both hard discs.
So i will use the laptop drive as my primary system drive.
After installing the OS i will switch the DVD with the other 40er hd.

Ein allererstes Konzept für das NAS-System kann  man hier herunterladen.

Blogged with the Flock Browser

my very first (ehm… useful ?!?!) ruby script.

So concerning my first try of a web based zfs managment interface i will restart the project with some new conditions:

  • 1. i will switch from the former language PHP to the – like everywhere told – dev-friendly language ruby.
  • 2. i will first concentrate on just the basic functions.
  • 3. i have to use the system build in security realms (so either PAM or an equal interface)
  • 4. i will use dynamic JS-Functions to enhance the GUI. But the system should also work with simple browser (e.g. lynx/links)
  • 5. i will offer a RESTful interface. So it should be very easy for 3rd party apps to connect to them and use alle the functionality.

The Beginning ^^:
So my first task is to bring an overview of all system-disks (other devices are not necessary at the moment) into my ruby context.
So basic system command is:

root@sunny:~# format < /dev/null
Searching for disks…

The device does not support mode page 3 or page 4,
or the reported geometry info is invalid.
WARNING: Disk geometry is based on capacity data.

The current rpm value 0 is invalid, adjusting it to 3600
done

c3t0d0: configured with capacity of 18.61GB

AVAILABLE DISK SELECTIONS:
0. c0d0 <DEFAULT cyl 3734 alt 2 hd 255 sec 63>
/pci@0,0/pci-ide@11,1/ide@0/cmdk@0,0
1. c3t0d0 <ST92011A–3.04 cyl 2430 alt 2 hd 255 sec 63>
/pci@0,0/pci925,1234@11,3/storage@2/disk@0,0
Specify disk (enter its number):

Beside of the interesting warning, this will do the job. The format command will normally lead to a prompt. To avoid this, you just pipe the output to /dev/null.

The really valuable stuff is in the upper part of the output.
After consulting the ruby API about strings and arrays i ended up with the following (dirty) lines of code:


#!ruby
#!/usr/local/bin/ruby -rubygems

s = %x{format < /dev/null}
sa = s.split(“\n”)
counter = 0
dsk = false
puts “Array: “+sa.length().to_s()
sa.map do |i|
if i.strip().length() > 0
print counter.to_s()+” ”
if counter == (sa.length()-1)
dsk = false
end
if dsk == true
puts “DSK: “+i.strip()+”\n”
else
puts i.strip()+”\n”
end
if i.eql?(“AVAILABLE DISK SELECTIONS:”)
dsk = true
end

end
counter += 1
end

I found a really nice post about the ruby command line interface. That post gave me a good start in experimenting with the produced string output. You just always remember the irb to test parts of your code. Of course there is _A_Lot_ of debugging code. But the end-result is correct. Of course there should no hard-coded string in there. A by the way: it was a little bit inconvenient to quarrel again with the integer<->string conversion after some relaxing and luxurious years coding Java ^^. Okay so no implicit casting in ruby (?). Oh wait a minute – no typed language, so no casting?.

Oh yes… i don’t want to hide the output:

root@sunny:~$ ruby cmd.rb

The device does not support mode page 3 or page 4,
or the reported geometry info is invalid.
WARNING: Disk geometry is based on capacity data.

The current rpm value 0 is invalid, adjusting it to 3600
Array: 12
0 Searching for disks…
1 done
3 c3t0d0: configured with capacity of 18.61GB
6 AVAILABLE DISK SELECTIONS:
7 DSK: 0. c0d0 <DEFAULT cyl 3734 alt 2 hd 255 sec 63>
8 DSK: /pci@0,0/pci-ide@11,1/ide@0/cmdk@0,0
9 DSK: 1. c3t0d0 <ST92011A–3.04 cyl 2430 alt 2 hd 255 sec 63>
10 DSK: /pci@0,0/pci925,1234@11,3/storage@2/disk@0,0
11 Specify disk (enter its number):


So i guess i found my disks. At the end, i can just iterate about the even number of entries :-).
Okay ruby-gurus. How can i optimize my code. I am beginner level and “slurred” during years, coding Java and anciently PHP.
I am sure there is a lot of potential to cleanup this mess ^^.

Blogged with the Flock Browser

very first test with ruby camping :-)


I tried The Camping Short, Short Example for the ruby camping framework.

#!ruby
 #!/usr/local/bin/ruby -rubygems
 require 'camping'

 Camping.goes :HomePage

 module HomePage::Controllers

   # The root slash shows the `index' view.
   class Index < R '/'
     def get
       render :index
     end
   end

   # Any other page name gets sent to the view
   # of the same name.
   #
   #   /index -> Views#index
   #   /sample -> Views#sample
   #
   class Page < R '/(\w+)'
     def get(page_name)
       render page_name
     end
   end

 end

 module HomePage::Views

   # If you have a `layout' method like this, it
   # will wrap the HTML in the other methods.  The
   # `self << yield' is where the HTML is inserted.
   def layout
     html do
       title { 'My HomePage' }
       body { self << yield }
     end
   end

   # The `index' view.  Inside your views, you express
   # the HTML in Ruby.  See http://code.whytheluckystiff.net/markaby/.
   def index
     p 'Hi my name is Charles.'
     p 'Here are some links:'
     ul do
      li { a 'Google', :href => 'http://google.com' }
      li { a 'A sample page', :href => '/sample' }
     end
   end

   # The `sample' view.
   def sample
     p 'A sample page'
   end
 end


It seems to be very easy to create the separat pages.

The example above generates one entry page. (the index method in Views) and one additional page (sample method).
As far as i should know it from rails, it uses the same MVC pattern and theres is a similar syntax. Just the Views are in native ruby without mixing up with html.
But maybe that will appear later on.
The next step is to see howto connect ruby with some inner sys-functions of nexenta ^^.

Blogged with the Flock Browser

Installing ruby camping


Just a short one:

After succeeding in installing ruby gems, i finally was able to install the ruby micro-framework camping.
So ruby should just be used as a small administration web interface. In my eyes a rails aproach seems to be like breaking a fly on the wheel.

Just easy as this:

  root@sunny:~# gem install camping –source http://code.whytheluckystiff.net
    …
    Installing ri documentation for markaby-0.5…
    Installing ri documentation for camping-1.5.180…
    Installing RDoc documentation for activesupport-1.4.2…
    Installing RDoc documentation for builder-2.1.1…
    Installing RDoc documentation for markaby-0.5…
    Installing RDoc documentation for camping-1.5.180…

Smooth and easy. Ready to rumble ;-).

Blogged with the Flock Browser

Install Gems (Ruby with zlib) on Nexenta (GnuSolaris) 1.01

Next in the row is the installation of the ruby gems package.
So it should be easy… just following the instructions.
So…..

root@sunny:~# wget http://rubyforge.org/frs/download.php/38647/rubygems-1.2.0.zip
root@sunny:~# unzip rubygems-1.2.0.zip
root@sunny:~# cd rubygems-1.2.0
root@sunny:~# ruby setup.rb config
./lib/rubygems/spec_fetcher.rb:1:in `require’: no such file to load — zlib (LoadError)
from ./lib/rubygems/spec_fetcher.rb:1
from ./lib/rubygems/source_index.rb:10:in `require’
from ./lib/rubygems/source_index.rb:10
from ./lib/rubygems.rb:767:in `require’
from ./lib/rubygems.rb:767
from setup.rb:22:in `require’
from setup.rb:22

Welcom to error world ;-).
Okay…. should be easy to solve:

root@sunny:~# apt-get install libzlib-ruby zlib1g-dev

or for 64bit Plattforms:

root@sunny:~# apt-get install libzlib-ruby lib64z1-dev

But still the same Error!
Finally i found something in the Weblog of Lucas Chan.
Hm its about readhat/centos…. okay why not.
Just go to the ruby sources:

root@sunny:~# cd /usr/local/src/ruby-1.8.6-p110/
root@sunny:~# cd ext/zlib
root@sunny:~# ruby ruby extconf.rb –with-zlib-include=/usr/include –with-zlib-lib=/usr/lib
checking for deflateReset() in -lz… yes
checking for zlib.h… yes
checking for kind of operating system… Unix
creating Makefile

root@sunny:~# make
root@sunny:~# make install

and finally:

root@sunny:~# cd /usr/local/src/rubygems-1.2.0/
root@sunny:~# ruby setup.rb config
….
== Thanks

Keep those gems coming!

— Jim & Chad & Eric (for the RubyGems team)

Again: something learned!

Blogged with the Flock Browser

Install Ruby on Nexenta (GnuSolaris) 1.01

If you want to build your own small ruby script for administrating you Nexenta-Box, you normally just have to do a:

root@sunny:~# apt-get install ruby

Unfortunetally this Package seems to be broken:

root@sunny:~# ruby -v
ld.so.1: ruby1.8: fatal: libruby1.8.so.1: open failed: No such file or directory

The needed lib libruby1.8.so.1 is not on its desired place.
So you need to compile yourself a version of ruby:


root@sunny:~# apt-get remove ruby
root@sunny:~# apt-get autoremove
root@sunny:~# apt-get install build-essential

root@sunny:~# cd /tmp
root@sunny:~# wget ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.6-p110.tar.gz

root@sunny:~# tar xvfz ruby-1.8.6-p110.tar.gz
root@sunny:~# cd ruby-1.8.6-p110

root@sunny:~# ./configure
root@sunny:~# make
root@sunny:~# make test-all
root@sunny:~# make install
root@sunny:~# make install-doc

/usr/local/bin should be in your path!

root@sunny:~# echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11

root@sunny:~# make install-doc


root@sunny:~# which ruby
/usr/local/bin/ruby
root@sunny:~# ruby -v
ruby 1.8.6 (2007-09-23 patchlevel 110) [i386-solaris2.11]

DONE!

Blogged with the Flock Browser

FINALLY: Comments are working again

A friend of mine told me some minutes ago that the Comments function on this blog still produces some errors, when trying to post a comment. So i decided to stay with the spam and to disable the filter function until i have the time and the infos about the wordpress system to code my own plugin.

I found another project i worked on in the past years. I updated it a little bit and can now present some screen impressions:

First of all what is it?
So i have the big problem of to many files on to big disk space. As a result there is first the problem of finding files and second the high probability to save identical files on several places. Not only small files like the typical 1×1 spacer.png, but also some sound files, hi-res images or movie files. Just in case of the backup of a backup.

So i decided that i need a system, that organizes my files in that way, that i can have a quick view, i may search through all the files and that there is the safety, that a file is just saved onced and all the copies of it should be just links to the original ones.

I end up with a system design that scans a particular folder for new files and copy them into a special ordered file structure. The unique property of a file is its md5 sum. The original file/folder structure is mapped into a DB table.
The system is no at exactly this point. I created a easy low level plugin interface for examining the different file types.
Lateron i will create a class, that make sys links equivalent to the original folder structure and offer them e.g. as a samba share. Even the possibility of a file history is imaginable. At this point the main task is the imense low performance (due a big use of DB queries and redundant method calls) and the definition of a usefull interface.

Here are some screens of the current system:
File-Vault storage Folder
System File Storage

File-Vault picture Viewer
Picture Viewer

File-Vault mysql Viewer
SQL (Text) Viewer with Import Function

File-Vault PHP Viewer
PHP Viewer

File-Vault MP3 Viewer
MP3 Player