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.
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
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…