My new office is slightly warmer than my old office (or: manually adjusting temperature controls on Synology NAS.)

Look, it’s been a while since I wrote one of these. I feel kind of bad about that, but on the other hand it’s been an interesting couple of months of doing more IT than writing about doing IT – which culminated in the entire floor of the building I had my office in being sold to some shadowy conglomerate and thus having to go and find a new place to work from. Tl;dr – I’ve been busy.

Still, I have a new office now, and it while it has… indifferent air conditioning, it also has big, cool, old-fashioned windows that let a lot of sunlight in.

This is the least-cluttered this desk will ever be.

This, of course, is lovely. And I have no complaints about this save for the fact that my Synology NAS gets warm, and because it gets warm it decides to turn itself off semi-regularly, and while I appreciate the clever design of a piece of tech that takes the extra step to preserve data, I’d really rather it didn’t do it quite so often.

The root cause of the problem is that my NAS is full of SSDs, because they’re quiet and fast and I had a lot of SSDs and nowhere to put them. They’re a superb alternative to old-school rotational hard drives, although they do tend to get warmer, and that’s the issue I’ve been running into. Regular hard drives run fairly cool, and the Synology DSM monitors the temperature of those drives and switches itself off once they hit about 61° – which is fine and laudable because having your NAS shut itself down is infinitely preferable to having your NAS suddenly filled with the screaming, smoking ruin of all of your hard drives exploding at once. SSDs, however have a significantly higher thermal threshold before performance and functionality degrade, and so shutting down when an SSD hits 61° is somewhat premature.

Synology DSM gives you some fairly stripped down tools for managing temperatures – chiefly, the ability to choose how fast the fans run in the thing and thus how effectively they can cool the drives down. And when I say “chiefly” I mean “solely”. Still, I started doing some digging into what could be done to manually adjust those fan speeds – after all, Synology NAS units use Linux as an operating system, and as such a lot of settings for how the thing actually runs are stashed away in editable form in .XML documents. Fan control should be, therefore, something that could be tweaked, and shouldn’t be limited to just the handful of presets that Synology gives you to work with right out of the gate. It transpires that fan speed and settings are stashed in a file called scemd.xml that can be accessed by ssh-ing into the DSM, and that when you open that file you see this:

Now, I don’t know about you, but I see fan_speed in there and also disk_temperature, and it didn’t take a herculean leap to note that:

<disk_temperature fan_speed="99%00hz" action="SHUTDOWN">61</disk_temperature>

…might mean that when the temperature of the disk gets to 61° then the NAS decides that it’s time to shutdown. Common sense would dictate that if you could edit that file with a temperature that an SSD might be happier with – say, 70° – then the thing wouldn’t stop working every time there’s a warm day (which there are a lot of here in California). So, I decided to fix it, and here’s how I did it.

First, you’ll need to log in to your Synology DSM and make yourself a home folder on the thing to work from (it’s possible to do all the below a lot faster if you log in as root, but I prefer to go slow and steady and build in break points when I’m tinkering around with the device that holds all of my work data oh god please don’t go wrong). In the DSM, open the Control Panel, hit the Terminal & SNMP tab, then check the box to enable ssh.

Open a terminal window on your Mac, and log in to your NAS via ssh:

ssh administrator@fake-nas-name.local

Note: I’m using administrator and fake-nas-name.local as the user and name of the NAS for the purposes of this article. Use your actual admin name and the address of your actual NAS. That sort of goes without saying, right?

If prompted, hit “yes” and then enter the password of the DSM user you’re ssh-ing with.

DSM users don’t have homes set up by default, but you can make one by doing the following in the ssh session:

cd /var/services

sudo mkdir homes

sudo chmod 777 homes

cd homes

sudo mkdir administrator

sudo chmod 777 administrator

Once you’ve got that set up it’s time to go and start mucking with the scemd.xml file. Because I’m not an utter blithering incompetent I decided to go make a backup of that file so that if I screwed something up terribly, terribly badly then I’d be able to roll things back. I encourage you to do the same:

cd /usr/syno/etc.defaults

sudo cp scemd.xml scemd.xml.bak

With that out of the way, it’s time to go grab the scemd.xml file and either edit it yourself on the DSM or do what I did and copy/paste the thing into BBEdit on your Mac so that you’re not tampering with a live file. To to this I just did a cat scemd.xml and then copy/pasted out from the terminal and into BBEdit.

The scemd.xml file is pretty straightforward; it’s laid out in sections with the settings for the NAS at the top in both DUAL_MODE_HIGH (i.e., the DSM default more-cooling-more-noise) and DUAL_MODE_LOW (quieter fans, more heat) underneath, followed by settings for a lot of expansion chassis units that we’re not going to mess with.

Find the DUAL_MODE_HIGH and DUAL_MODE_LOW lines that read:

<disk_temperature fan_speed="99%00hz" action="SHUTDOWN">61</disk_temperature>

and edit the 61° to 70° so that it reads:

<disk_temperature fan_speed="99%00hz" action="SHUTDOWN">70</disk_temperature>

Save the file to your Desktop, close BBEdit, then open a new Terminal window.

The next step is to move the newly-edited sceml.xml file to your newly minted home folder on the DSM, which you can do with this command:

cat ~/Desktop/scemd.xml | ssh administrator@fake-nas-name.local 'cat -> scemd.xml'

Jump back into the Terminal window running your ssh NAS session and check that the scemd.xml file is in your home folder:

ls /var/services/homes/administrator

All things being equal you should see scemd.xml as the output.

Finally, you’ll need to write over the existing scemd.xml file with your edited version, and then copy the new file to /usr/syno/etc:

sudo mv /var/services/homes/administrator/scemd.xml /usr/syno/etc.defaults/scemd.xml

sudo cp /usr/syno/etc.defaults/scemd.xml /usr/syno/etc/scemd.xml

Reboot your Synology NAS to restart the appropriate services, and that should do the trick.

As is ever the case with these things, your mileage may vary, and any time you tinker with the guts of your NAS you run the risk of fat-fingering something and the whole thing coming crashing down. Please, I implore you, please do a full backup of your data before attempting to do any of the above.

So far, this has worked without incident. In fact, as of writing this I can see that one of my SSDs is hovering at about 57° and the other is running at °61 without a hitch, which I’m calling an absolute win…

Leave a Reply

Your email address will not be published.