Building a new fanless and silent server and NAS

I wanted a low-power micro server to have a permanent personal point of presence online to support my own operations. Main usages range from hosting some Git repositories to sync my data on OwnCloud and run HTTP servers.

Using a single board PC (raspberry-pi style) was a bit limiting as I wanted to have ZFS running with at least a mirrored zpool (so I needed SATA connectors and at least 8 GB of RAM).

Another requirement was low power consumption: I don’t want to notice the effect of this thing on my power bill.

Last important requirement was silence: I will have to sleep in the same room as my server. So, I decided for a completely fanless design, which also (necessarily) conciliates the low power consumption.

Shopping list

With a budget in mind of < 400 Euro, this is what I bought:

  • CPU. I didn’t shop a CPU because it was already mounted on the motherboard. I only needed a low power processor powerful enough for home and personal usage.
  • Motherboard. The choice was for the Asrock Q1900-ITX. The mini-itx factor was crucial for a small size and I was already inclined to get one of the new Intel Celeron processors (either the j1800 or j1900). This board has a j1900 on-board, fanless. Compared to other boards from Asus, Gigabyte, MSI (or even other models from Asrock), this one had the advantage of including 4 SATA connector (2 SATA-III and 2 SATA-II), 4 USB 3.0 ports (2 front, 2 rear), DDR3/-L memory slots (other models only supported DDR3L)

IMG_20140809_201516

  • Memory. Nothing interesting here, the motherboard supports DDR3 1333MHz SODIMM memory, so I picked two Corsair value select modules of 4 GBs each. (The memory supports up to 16 GB of memory, which for ZFS would be better!).

IMG_20140809_201529

  • Disks. The disks were one of the harder choice. Ideally, SSDs would have been the perfect candidate, but there was no way I could stay in my budget unless I wanted a ridiculous amount of storage capacity. It had to be HDDs. With a fanless design, the mechanical drives became the only source of noise of the system, so I made an extensive research to find a good and silent drive. The red line from Western Digital has a 1TB drive that is as low as 21dBA (WD10EFRX), but unfortunately that is a 3.5″ disk. The “corresponding” 2.5″ model has 25dBA on paper (WD10JFCX) and is the biggest of its category (1 TB). WD RED devices are made for NAS, so I decided this could be a good choice. The amount of storage I could put into my server was limited by the space available in the case. The one I chose could only contain 2×2.5″ disks, so I ordered two WD10JFCX with the idea of using them in a mirror’ed zpool.

IMG_20140809_201556

  • Case. The TDP of the system is low and there are many nice mini-itx cases that include small PSUs. I opted for the mini ITX Q-6 from Inter-Tech, which includes a (fanless) 60W power adapter. The PSU had only one SATA power connector, so I had to buy an extra MOLEX to SATA cable for the second disk.

IMG_20140809_211117

Assembling the server

The only problem for putting the motherboard in place was that I needed to bend the black power cable a bit to make space for the audio connectors block. In this picture I still had to put the metal plate for the connectors layout in place.

IMG_20140809_211306

 

The case has a support on which to hook the hard drives. The disks have to face the motherboard as this support goes really on top of the case. The space remaining between the disks and the CPU heat sink is not much. I wonder at what temperature will the disks have to operate (the cores are usually at 60-62 degrees Celsius) and if this could shorten their life.

IMG_20140810_101403

 

 

Here is the disk support mounted on top of the case:

IMG_20140811_200427

And this is the final result. The only thing missing is the 60W external power supply (like those of laptop computers), that is included with the case and that connects near the bottom-left corner.
IMG_20140811_200602

Software

The server is currently running FreeNAS, so I have my ZFS mirrored zpool and my services running inside their Jails.

Conclusions

I am happy about the new server, especially about FreeNAS, and I already found good uses for it (and new ones will come!). The power is certainly limited and so is the bandwidth of the home ADSL, so getting services from the outside is as slow as the upload byte-rate!

The noise is not absolute zero as one can hear the hard disks spinning, but this is really a minor background factor that doesn’t disturb the quietness of the bedroom.

Posted in Services, Uncategorized | Tagged , , , , | Leave a comment

Adding a new split functionality to konsole (multi-terminals)

The existing “Split-View” functionality in Konsole certainly has its rationale (http://dot.kde.org/2007/05/23/road-kde-4-konsole-gets-overhaul), but it is not the one I expect to use.

I am trying to implement a different split, which works similarly to the one found in Terminator.

A picture can explain it better than words:

Multi-Terminals in Konsole

Multi-Terminals in Konsole

The work-in-progress is at this “personal” konsole repository on gitHub, which I will keep aligned with the master, hoping that, once finished, it will be possible to integrate this implementation into the KDE repos.

Posted in KDE, Programming | Tagged , , , | 1 Comment

Sogno il giorno in cui…

Sogno il giorno in cui la smettiamo di dire che l’Italia fa schifo.

Il giorno in cui la smettiamo di dire ai nostri amici tedeschi, inglesi e svedesi che viviamo in un paese che non funziona, che ci vergogniamo, che ci dissociamo. Come se non ci fosse più niente da fare, come se loro non avessero i loro problemi.

Vedo gente insultarsi: “Bravo! Bella figura! Siamo proprio un popolo di me**a”. Come se provvedendo subito a condannare il gesto del connazionale si potesse creare un distinguo: “Io lo so come funzionano le cose, non sono come lui (o loro)”. Come se fosse normale sentirsi sempre senza dignità.

Possiamo ricominciare dall’orgoglio?

Posted in General | Tagged | Leave a comment

DHCP failure on Android WiFi (stuck on obtaining IP address) – How I solved it

This evening my phone wouldn’t connect to my WiFi network anymore after a SIM change + reboot (maybe unrelated?).

Anyway, it seems that many people are affected by this issue, but it took me a while to find a workaround, because I found a lot of incomplete and fragmented information. I’ll try to put everything in this post so people with the same problem can hopefully spend less time to solve it.

My configuration: Sony Ericsson Live with Cyanogen mod 9 (Android 4.0.4).

Problem description

Wireless card will not connect to WiFi network when using DHCP (in my case the AP is a CISCO router flashed with DD-WRT and secured with WPA2). In the Android WiFi settings, you will see the connection status looping between the same states over and over (the most noticeable is “obtaining an IP address” as that string remains on the screen longer).

To investigate a bit on the cause of the issue, I had a look at the ERROR logs, that revealed the failure of DHCP:

E/DhcpStateMachine( 218): DHCP failed on wlan0: DHCP result was failed
E/WifiStateMachine( 218): IP configuration failed
E/LanLinkProvider( 471): Sending udp identity package failed
E/LanLinkProvider( 471): Sending udp identity package failed
E/LanLinkProvider( 471): Sending udp identity package failed
E/LanLinkProvider( 471): Sending udp identity package failed
E/DhcpStateMachine( 218): DHCP failed on wlan0: DHCP result was failed
E/WifiStateMachine( 218): IP configuration failed
E/LanLinkProvider( 471): Sending udp identity package failed
E/LanLinkProvider( 471): Sending udp identity package failed
E/DhcpStateMachine( 218): DHCP failed on wlan0: DHCP result was failed
E/WifiStateMachine( 218): IP configuration failed
E/LanLinkProvider( 471): Sending udp identity package failed
E/LanLinkProvider( 471): Sending udp identity package failed
E/DhcpStateMachine( 218): DHCP failed on wlan0: DHCP result was failed
E/WifiStateMachine( 218): IP configuration failed
E/LanLinkProvider( 471): Sending udp identity package failed
E/LanLinkProvider( 471): Sending udp identity package failed

Solution

What worked for me (and hopefully for someone else too), was to delete every files in

/data/misc/dhcp

In my case, I had the following two files:

dhcpcd-wlan0.lease
dhcpcd-wlan0.pid

So, if you can access the adb shell, you can try the following (please, see which files you have there with “ls”, so you will correctly remove what you need):

$ adb shell
# cd /data/misc/dhcp
# rm dhcpcd-wlan0.lease dhcpcd-wlan0.pid

Or, if you cannot use the adb shell, try to remove those files with a file explorer directly from the device.

After this, I had to reboot before I could get my WiFi connection work properly with DHCP.

Credits go to this page: http://forum.xda-developers.com/showthread.php?t=2112161.

Posted in Android | Tagged , , , , | 15 Comments

Remember The Lens – Revamped

I want to start this post by thanking Pavel Shabardin as he created some new tickets on the GitHub page of Remember The Lens that caused new nice features to be brought to the project.

What’s new

  • Icons. I was willing to replace those ugly icons I made a while ago since a long time. I found some really nice ones on openclipart.org that gave the lens a new fresh look.
  • Preview. It is now possible to right-click on a task to get extra information.
  • Complete/Uncomplete tasks. On the preview screen, a button will appear to complete/uncomplete a task (depending on its current status). Very handy.
  • Show completed tasks. Because of that button above, it’s also good to show already completed tasks, so a “Complete” can be easily undone. A new “Show/Hide” section on the lens filters has a button for this.
  • Internationalization. The lens is now open to translations. I lost the Russian translation because I introduced new messages and changed existing ones. The Italian translation is of course there :).

Under the lens

Screenshots are more immediate than a video showing the lens at work (also, last time I wasn’t able to speak loud enough). Here are some.

Posted in Programming, Ubuntu | Tagged , , , , | Leave a comment

Ubuntu 13.04 and Hybrid Graphics on Sony VAIO S

Of course, it works also for 13.04: link.

Posted in Uncategorized | Leave a comment

Search and replace from command line

I usually do my find and replaces from within VIM or Eclipse (refactoring).

It may be useful to do it from the command line in case you don’t want to (or cannot) open your editor or if you need to work on a larger set of files (e.g.: scripts, meta-languages that Eclipse won’t refactor, etc).

The following command will recursively find all the *.cpp, *.h and *.c files starting from the current directory and change every occurrence of the pattern (in this case just a string) “createAndSet” with “init” (IMPORTANT: read the WARNING notice below before using the command):

find . -name *.c -o -name *.cpp -o -name *.h | xargs sed -i.bak 's/createAndSet/init/g'

The -i option tells sed to edit files in place and the optional parameter “.bak” tells sed to create backup files with a “.bak” suffix. By removing the “-i” option, sed will just output the result to stdout.

Warning

Use the command above judiciously, it may be disruptive and change your code in ways you do not expect.

Sed will replace every occurrence of a regular expression. If you want to change every occurrence of the string “int” to “long int” and you try to use the substitution “s/int/long int/g“, then every occurrence of a “printf” call will become “prlong intf”.

Test the regular expressions and observe their effect by calling sed in “dry run” mode, without the “-i” option (no in-place editing).

I cannot be responsible for any damage caused by the usage of the above command or a similar one :)!

Posted in Programming | Tagged , , , , , , , | Leave a comment