All is worthwhile if the soul is not small.

Menu

Tag Archives: nas

To protect data residing on my Synology NAS I’ve bought and installed an UPS, an APC 700U to be exact. The trigger for buying and installing one was the loss of (some) disk data event that happened to family member external hard disk due to power loss. The data recovery cost was higher than buying an UPS and of course the lack of backups added to outcome of that event.

While no Synology NAS was involved on the above data loss, I know first hand that backups by themselves only add one layer of protection to possible data loss, and since from time to time I also have some power loss events, it was just a matter of time that my NAS might be hit by an unrecoverable power event, and, who knows, data loss.

So buying an UPS just might be a good idea…

Anyway the UPS from APC that I bought has an USB port allowing it to be connected to the Synology, which allows the UPS to be monitored and also allows the NAS to gracefully shutdown before UPS battery exhaustion. As a bonus it also allows to run an UPS monitoring server where other devices that share the same UPS power source can be notified of a power event through the network. Just keep in mind that the network switch or router must also be power protected…

Installing the UPS:
Installing the UPS is as simple as power down all devices that will connect to the UPS: Synology NAS, Odroid, external hard disks, PC base unit and network switch, and connecting an USB cable from the UPS to the back Diskstation USB ports.

After starting up, just go to DSM Control Panel and select Hardware & Power and then the UPS tab. Enable the UPS by ticking the Enable UPS support and also enable the UPS server to allow remote clients by ticking Enable UPS Network Server:

We can see by pressing the Device Information button that the UPS was correctly detected:

To end the configuration we need to press the Permitted DiskStation Devices and add the IP’s address of the devices that also have their power sources connected to the UPS and will also monitor the power status, in my case the IP of Odroid and my home PC.

And that’s it.

Setting up Arch Linux
Interestingly I dind’t found the NUT tools (Network UPS tools) on the core Arch repositories, but they are available at the AUR repository:

yaourt -S network-ups-tools nut-monitor

The above packages will install the core NUT tools and a graphical monitor.

After installing and enabling Synology Mail Station (RoundCube), I added a POP3 external account, so that account’s mail also was available at RoundCube’s interface on my Synology.

The issue is that after that change/configuration the NAS didn’t hibernate any more.

I thought that the issue was related to the pooling interval to the POP3 account, and I was right, it was set to 5 minutes by default. I’ve changed to 4 hour’s (240 minutes), but checking the logs I could see that the pooling was still at 5 minutes… and still the NAS wouldn’t hibernate.

So a quick check I’ve found out that the fetchmail process that fetchs the mail from the external POP3 accounts reads it’s configuration files from /var/packages/MailStation/target/roundcubemail/ext

In my case the POP3 account was defined on the admin accounts, and so there is an admin_fetch file, which might be different if other users are using the POP3 external accounts feature.

Editing this file there is a line

#### .fetchmailrcset daemon 300

Which means pooling every 5 minutes (300 seconds)

I’ve changed the value to 21600 (6 hours), and waited for the next NAS restart.

After that pooling was set to every 6 hours and the NAS does hibernate now.

Didn’t bother to much to see how to restart the fetchmail process without rebooting the NAS, but probably restarting the Mail Station packages will suffice.

One of the packages available for installation on the Synology NAS is the PHPMyAdmin application that allows to use the web to administer the embed MySQL.
The problem with this is that the PHPMyAdmin will also available on the root web server of the Web Station package, and if this package is exposed to the internet, then PHPMyAdmin application will also be exposed… a big no-no security wise…

My quick solution is not to install this PHPMyAdmin package, and since I seldom access the MySql package, a better alternative, yet not “light” is to use the Desktop Application MySQLWorkbench: http://www.mysql.com/products/workbench/ to access and administer your databases.