Odroid HC4, the energy ascetic

I had a Fujitsu SFF desktop PC, which has i5-4590T CPU. Despite being a regular desktop, it worked quite frugal, drew only 16…27W depending on load. But most of the time it is just idling and being ready to serve…
This server acts as CalDAV/CardDAV via Radicale, filesharing-synchronization server via Seafile, and mail server Postfix, Dovecot. There’s also ftp, Samba and NFS. There’s NGINX for the web stuff (webmail), and reverse proxy for some services.
It’s not just me using this server but 2 of my friends have their small firms emails here. So we share the costs…
Recently purchased an Odroid HC4.
I tried to “netinstall” Bullseye from petitboot, but after installation keyboard wasn’t working, so I stuck…
I tried Armbian image on an SD card, which started, worked, but seemed to be based much more on Ubuntu than on Debian. Which is normally OK, but I’d like to have a Debian based system as clean as possible.
I found the (for me) perfect base:

I started to tinker with this image, put it on a 16GB microSD. My HC4 got a 4TB Seagate HDD as the “big” storage, and a 1TB 2,5" SSHD as the smaller storage.
The smaller disk (1TB) has now 3 partitions, one for /home, one for /srv and a 3GB swap. The bigger is in one chunk.
I edited hostname, fstab, sources.list to my liking.
/srv holds the served data, such as mail server directories, www-root, mysql datadir. The microSD I use for / (system partition) is OK for reading, but quite slow for writing. So I decided to move /var/mail /var/spool to /srv as well.
I considered to move /var/log too, but did not do it yet.
Having the original server up and running, I wasn’t in a big hurry.
Collected a list of packages on the original server via apt list --installed
Used this list as a guide, but did not install everything blindly.
Just installed those I knew I need there.
So installed postfix, nginx, dovecot, vsftpd, spamassassin, and so on.
I had to tinker a bit with the database.
On the original server I had MySQL5.7. However, MySQL doesn’t provide an arm64 port. MariaDB has arm64 packages, and it is told to be compatible with MySQL on client side. So I went for MariaDB, installed it on the HC4 instead as a replacement of MySQL.
Exported the database on the old server with a mysqldump command.
Actually it was mysqldump --routines --events --all-databases --triggers --single-transaction -u root -p >/srv/mysqldump.sql

Tried to import that on the HC4 to MariaDB. Well… almost done. :slight_smile:
It had problems with the users table, so the import was unsuccessful.
In a forum I found that adding 2 lines to the dump would solve the problem:

DROP TABLE IF EXISTS `mysql`.`global_priv`;
DROP VIEW IF EXISTS `mysql`.`user`;

So I edited the dump to start with these lines. Bingo! Import went smooth.
But noticed strange log entries in syslog, like:

mariadbd[1255]: 2022-09-08 21:26:46 0 [ERROR] Incorrect definition of table mysql.event: expected column 'sql_mode'
    at position 14 to have type set('REAL_AS_FLOAT','PIPES_AS_CONCAT',// don't paste here the whole...
Sep  8 21:26:46 ubuserver mariadbd[1255]: 2022-09-08 21:26:46 0 [ERROR] mariadbd: Event Scheduler:
    An error occurred when initializing system tables. Disabling the Event Scheduler.

Found that I need to run mysql_upgrade -p –force, after that everything seems to be perfect.
So I considered these steps to be the working recipe of migrating the database from the original server to the HC4.
At the end, most of the migration was fairly easy, just install the needed packages, and copy the config files accordingly.
As for Seafile, Releases · haiwen/seafile-rpi · GitHub there’s the arm64 build (for Raspberry, but it cheerfully works on the HC4).

My friends are patient, so couple minutes downtime is not a problem, but couple hours would be. So I migrated all the big heaps of data via rsync (took almost a whole day). Then shut down some services on the original servers, such as postfix, dovecot, seafile… Then repeated the rsync, this time it took about 5 minutes.
Shut down the original server completely, but before that I edite the interfaces file, to have it another staic IP - to avoid conflict in the case I need to boot it up for something I may have forgotten. Then the HC4 got the IP of the original, rebooted it, and go…
Replace complete.
Now it draws between 5.2…5.5W on basic load, but on heavy syncing with Seafile it draws up to 13…14W.
Looking at Samba or NFS the HC4 easily performs the same as the original server (approx. 100MB/s). Looking at Seafile, it is somewhat slower, the max syncing speed achieved is about 60MB/s, whereas with the original server it was 90MB/s.
However, approx 87kWh a year worths this performance drop :slight_smile:
I’m happy with the Odroid!

My old backup server will be retired, and the Fujitsu machine is going to be my new back-up server. Which means, it will store the backups from the new server.
I recommend Odroid to anyone considering to run a home-server…

3 Likes

@kovacslt
Could I make a server out of an old desktop pc that has been retired, if I can get it to run again?

1 Like

This is interesting. I looked it up locally
https://auseparts.com.au/ODROID%20HC4
There are lots of pictures and specs on that site.

Question: Would you consider this suitable to build a small home NAS, just for personal use.

Regards
Neville.

2 Likes

Absolutely yes.
The link you shared shows a version which has a display. I think that display is could be omitted, if you find a version without that, it will work the same.
I ordered my Odroid from Sweden, but I live in Europe.

1 Like

Yes you could. It would be a good exercise, to practice and see how you can deal with a headless setup. However, really running an old retired computer 24/7 (as a server) will cost very much in electricity price.

@kovacslt
That is what I am thinking!!! What would you recommend?

Get your old retired computer, that costs nothing. Install Ubuntu server, or Debian onto it, but without any GUI! Just console…
Practice begins: install ssh, config ssh, start to access you server via ssh.
Detach keyboard and monitor, you will need it only in case there’s a need to access the server physically.
Access you server via ssh, and do all you configs, installs, customizations etc.
If you are already comfortable with such a headless system, go and grab a SBC.
Single board computers tend to use very few electricity. You can get a Raspberry for example, or an Odroid if you whish…
I saw there are prebuilt images for Odroid with OMV and similar userfriendly stuff.
That would be an option too. Easier, faster to build a NAS, but much less fun…
:slight_smile:

3 Likes

@kovacslt
Thanks @kovacslt, I will get my old machine down and see if it will run!! Will a usb stick run a server and save the two sata ports for the data drives?

1 Like

Better install the system onto the drive. A separate partition with a size of 16GB is plenty. You can then use the rest of your drive for storage purposes.

@kovacslt
OK!!! I know my old machine has two sata ports and eide port, but I don’t think I have any eide drives that still works. Do I use .ext4 for the drives or ntfs?

As you will use these drives with Linux only, I vote for ext4.

1 Like

Duh, Sweden is in Europe, isn’t it?

Not funny!
Instead of ‘but’ he meant ‘because’.
You wish you could speak his language just 5% as good as he speaks English!

1 Like

English is indeed a difficult language. Courtesy, on the other hand, is even more difficult. You and I need more lessons.

He was answering my question.
I read it differently… " but I live in Europe (ie not in Australia)"
English is indeed a strange language, and I agree @kovacslt has a very good command of it.
If it had been spoken instead of written, the emphasis would have made the meaning clear. Written English can be ambiguous.

1 Like