Sunday, March 9, 2025

 A new NAS is born: a repurposed QNAP TS-412 case (kirkwood, single-core arm with 256Mb memory).

The nice thing is: this is actually a Mini-ITX board. So if you have a low-profile board, it might just fit. The only downside is the backplane: QNAP has the SATA controller on the actual backplane. I investigated a bit and someone got it working using a regular PCI-e slot, but this didn't sound very appealing since the SATA controller is pretty antique.

 Instead I opted to replace the board with an Odroid H4 Ultra board (N305 CPU, 8 cores) with 32Gb of DDR5 memory.
The reasons for choosing this board:

- It's a lot more modern than that old Kirkwood
- The GPU is pretty OK when using Jellyfin (AV1 decoding support)
- It has onboard SATA (4 ports)
- The M.2 slot can be bifurcated into 4 separate lanes!
- The BIOS allows for IBECC (inline ECC: using a part of the memory for ECC without using special ECC memory). This is actually a lot like regular ECC, but instead of using a separate memory chip on the DIMM, the ECC is stored alongside the regular content. Performance is a bit worse, but it uses normall DIMMs as opposed to special ECC SODIMMs.
- It has a watchdog/tco and can redirect the console to a serial port (perfect for going headless).

So here is the NAS from the outside:

 


Just a regular NAS so far... A photo from the back reveals a bit more:


So what I have done is, after opening up the NAS and taking carefull measurements, I found that above the hotswap bays there is room for a 5,25" bay! Perfect. I was planning on adding an NVME drive, but this is even better: there is room for 6 SSDs in one of those 6-in-1 hotswap bays.

The larger white part is a (3d printer) backplate for the Odroid H4 motherboard. It's quite a bit smaller than an ITX board which leaves more room for routing cables.

On the bottom there are 4 extra network ports and the left-side (with the cable hanging out) is also a network port, both to which I will come later.

Opening up the case (just 3 screws) shows the Odroid mainboard:


This is the backside. More information on the board can be found at the hardkernel site.
People who know this board might see I used the M.2 4x1 card. This board gives you 4xM.2 slots, each with 1 lane of PCI-e 3.0 speed (about 950 megabyte per second). I've add 2 lexar NVMe drives here and 2 special cards:
  1. An m.2 to PCI-e extender (on the left)
  2. An m.2 to m.2 extender (on the right)
The m.2 to m.2 extender holds an ASM1166 controller give 6 extra SATA ports (idead for the 6-in-1 hotswap extension). You can see the 6 lanes of SATA on the right in the case.

When looking at the other side of the case we get a nice little surprise:


The red cable is connected to a little single-board-computer (SBC). Specifically a Luckfox Pico. It's a small Arm based machine (using a Rockchip  CPU) which has:
  1. Ethernet (100Mbit)
  2. 256 megabyte onboard bootable flash
  3. An SDK
  4. More pins than you can shake a stick at
This board is connected to the Odroid UART pins to allow remote control of the Odroid board in case of problems: the Odroid is configured for a Serial console during boot and grub and Linux that run on the Odroid als have their console on ttyS0. This means that even if the Odroid is having a hard time, login is possible. Combined with the built-in hardware watchdog of the Odroid this gives almost the same options as using a full IPMI solution (in my case I only use remote control and power-cycle options of the machines that have IPMI overhere. A full ipmi can do more, but this solutions covers the majority of my usecases)

The only thing missing is controller the power-button the Odroid via GPIO on the luckfox (still working on that bit)

The Luckfox is powered via the Odroid always-on 5V pin (gives about 500mA which is about 8 times more that this board uses)

The only thing missing is the 4 port ethernet at the bottom:



I found that below the hot-swap bays there is just a bit of room for a PCI-e card when there is no heatsink mounted. I was able to put an Intel I340 quad-port NIC in there which is connected to the m.2 to PCI-e adapter (the card is PCI-e 2.0 only, so the 1 lanes becomes about 500 megabyte per second. Just about enough for 4 ports at full speed).
As no proper mounting is possible here, electric tape and some plastic is used to insulate the card from the case.
I printed a special bracket that keeps the card in place while in normal, so it's fully usable in my setup.

You can also see the power cabling for the harddrives: I lost the ability to hotswap drives which would have been nice, but not absolutely required.

Software

The machine is running Proxmox on top of Debian. The NICs are bridged in Linux and the guests get a virtio NIC. This should alleviate the PPPOE performance hit of FreeBSD (tested previously, not yet on this machine)

The Luckfox board is running Buildroot linux with minicom so I can connect to the the Odroid (although SSH directly to the Odroid is must faster and convenient).

After testing Proxmox iTCO watchdog, I found out that the initial bios did not support the watchdog functionality of the hardware. After a quick forum request Hardkernel released a patched bios within a week or 2 that allows you to enable the watchdog in the bios (it's not iTCO_wdt but wdat_wdt). I configured proxmox to use this watchdog as well.

Furthermore, I uses powertop and hd-idle to save power. When the machine powered on but doing nothing (all HDDs powered down) I get about 25W as measured by my powermeter (an old ELRO not sure about the accuracy). This is caused by the SSDs in the hot-swap bay: I've got some older enterprise drivers in there (intel S3700). I measured a naked board using my power-meter at about 12W.
When spinning up all HDDs and doing some work I see about 50W on the meter (spin-up peak at about 90W).

Proxmox is installed on an eMMC module on the board which is fast enough. Swap is configured on one of the older enterprise drives. This allows for hd-idle to spindown the actuall 18 terrabyte disks. 

It's been a nice little project required my 3d printer, some elbow grease and a dremel to get it up and running and many many reboots/tries/tests to make sure everything kept working when abusing it: cooling is an issue in such a small case (it's about 45 degrees celcius when idle but ramps up to about 65 degrees when doing some more work. When stress testing the machine it starts to throttle the CPU. In my case not really an issue as the main things it will run are

- Jellyfin
- Opnsense
- Gitea
- Nextcloud

8 cores is plenty for all this, so there is still room for growing.

On the storage side: it's running ZFS raid-z1 on 4x18Tb drivers with 2 SSDs in a mirror as a special device (this really helps as small files and directory information is stored on the SSDs, so the drives only spinup when actual data is read from the HDDs)

This is my new 24x7 server, allowing an older Xeon to be powered of. That machine will be repurposed to run Proxmox Backup server or Rsync for backups (and will not have to be powered on 24x7)




Sunday, October 30, 2011

Verdere afwerking

De komende periode zal er nog een hele rits aan kleine karweitjes gedaan moeten worden voordat ik kan beginnen aan de deuren.
Vandaag heb ik de koker van de afzuigkap op maat  gemaakt. Het zijn 2 metalen delen die je, door ten opzichte van elkaar te verschuiven, op iedere maat kunt passen. Behalve in mijn keuken.. De afstand afzuigkap tot plafond is +/-55cm terwijl een van de kappen 60cm is. Dat gaat dus niet werken. Een slijptol en een slijpsteen doen wonderen:


Vervolgens nog wat randen afkitten zodat het beter toont.

De voegen waren beschadigd/verkleurd door de cementsluierverwijderaar. Op zicht was dit weg te krijgen door de voeg licht op te schuren, maar wat nog beter werkt is zgn. voegenverf. Hiermee kun je tevens de voeg iets lichter kleuren zodat'ie meer 'spreekt'. Het resultaat is ook op de foto te zien.

Friday, October 14, 2011

Een maand later

Al een maand lang geen keuken update gedaan. Hoog tijd voor een update dus. De voortgang is vrij laag geweest de afgelopen periode o.a. door de geboorte van mijn zoon. Het blad is klaar (gelakt en gekit). De afzuigkap is nu ook stil tijdens het zuigen. Nu eerst de voegen opknappen die de tegel ontsluiraar niet overleeft hebben....




Wednesday, September 14, 2011

Start VirtualBox machines automatically

VirtualBox is a nice way to run various virtual machines. Although it's mainly meant to be used interactively, using PhpVirtualBox it can even be used headless. Great for running a few isolated virtualmachines on a headless machine without having to remember the VBoxManage commandline options.
However, when a machine is rebooted, the state of the virtualmachines is lost (ie. which one is powered of and which one is powered on). To remedy this, I use a small shell-script that runs as part of the machine bootup sequence to revitalize all paused virtualmachines that are marked as autostart. VirtualBox has the option to attach 'extradata' to each virtual machine which are just basic key-value pairs. I mark all auto-start virtual machines as follows:

vboxmanage setextradata XYZ autostart true

Where XYZ is the machine name. Unfortunately the property cannot be set using the web-ui. But as this is one-time command, it's not that big of an issue.
Next the virtual machines are booted manually (using the web-ui or otherwise) to run headless. Next when the host goes down orderly, a shell-script runs pausing all virtual machines marked as autostart=true. When the machine starts up, all virtual machines marked as autostart will be resumed.

The basic script I use is this:


#!/bin/bash
USER=marcel
VBOXMNG=vboxmanage
CMD="$1"
start_stop()
{
for f in `su -l -c "${VBOXMNG} list vms" ${USER}`
do
        if [ "${f:0:1}" == "{" ]
        then
                if [ "`su -l -c "${VBOXMNG} getextradata ${f} autostart" ${USER}`" == "Value: true" ]
                then
if [ "${CMD}" == "start" ]
then
echo Resuming ${f}
su -l -c "${VBOXMNG} controlvm ${f} resume" ${USER}
else
echo Pausing ${f}
su -l -c "${VBOXMNG} controlvm ${f} pause" ${USER}
fi
                fi
        fi
done
}
case $CMD in
start)
start_stop
;;
stop)
start_stop
;;
*)
echo Only stop or start is supported
exit 1
esac
Just put this in the init.d directory and use "update-rc.d startvms 99" to setup the script.


Sunday, September 4, 2011

Opruimen

De 9e september nadert met rasse schreden en het is dus zaak de boel zo goed mogelijk op orde te maken. Dit weekeinde dus opruimen. Een aanhanger gehaald, alle oude resten hout en rommel erin en wegbrengen naar de vuilstort. Verder de losse delen die nog zwerven in huis (o.a. notenhoutenplaten en laminaat delen) verder verwerken en plaatsen. Al met al is de keuken nu functioneel en opgeruimd, maar nog niet klaar..



Wednesday, August 31, 2011

Avondje vrij

Deze avond heb ik bar weinig gedaan. Even opladen voor het komende weekeinde. Gisteren wel begonnen met de vloer te leggen. Het laminaat wat ik had van de Hornbach was waardeloos: de messen braken af in de groef als je het probeerde te koppelen. Toen ik met superlijm bezig was de planken te verbinden dacht ik bij mezelf: dit is gekkenwerk, ik heb al heel wat keren laminaat gelegd en zo slecht had ik het nog niet gehad. Terug ermee en ander laminaat gehaald. Dit werkte beter:


Vanavond alleen de afzuigkap opgehangen: is dat ding ook eens uit de huiskamer weg..


Op stand 3 stijgt de keuken op, dus dat zit wel snor. Ik zal nog wat geluidsisolatie rond de buis doen voordat ik de kap monteer in de hoop wat rust te creeeren in de keuken.

Tuesday, August 30, 2011

Voegen

Vandaag de eerste wand gevoegd. De voeg is iets donkerder dan verwacht maar ziet er wel goed uit.