Showing posts with label Synology. Show all posts
Showing posts with label Synology. Show all posts

Tuesday, April 4, 2017

How to reboot Synology NAS from terminal when GUI is unresponsive

I own a Synology NAS (it's a Ds213j) that every now and then get unresponsive.
The web GUI doesn't works, the network share doesn't works.
But the NAS does still respond to ping, so the network is working.

When my NAS get unresponsive my first solution has always been to power-cycle it, by unplugging the power cable.
But this isn't very nice for a NAS, so I found another solution:  reboot the NAS from SSH terminal.

So here is a little guide about how to reboot the NAS via the SSH terminal.
This guide works on my Synology DS213j. On different model YMMV.

Disclaimer: with the instructions in this guide you can mess up your NAS, you can loose your data, and do a lot of bad things. So, be responsible of your actions, and do something only when you clearly uderstand the full consequence of your actions.
A NAS can contains a lot of data, and form a terminal console with administrative right is very easy to mess things up, lose data, or do bad things.


First thing: you need to enable SSH/Telnet access to your NAS.

Access the NAS GUI, click  "Control Panel", scroll to and click "Terminal & SNMP", Enalbe Telnet and SSH Services, Click Apply.
Important: Always use strong password for any account that can access your NAS.

Even more important: If your NAS is accessible from outside your LAN, take care about the security of any new service that you enable: are they going to be accessible form the internet? Do you need to protect the in some way? (firewall?)

Now you can access the terminal of your NAS. So, the next time you need to reboot your NAS you will be able to try to force a reboot by using the terminal.

How do you access the terminal of your NAS? There are many software that can do that, I use Putty, that is a free ssh/telnet client for windows. You can download Putty there.

After installing Putty, fire it up, and insert your NAS IP/host name.

 Click the "open" button, and this will take you there:
 
Now enter the username, and then the password.
The user must be part of the administrators group of your NAS.

Then You are logged in the terminal

Now you must type the command "sudo su", press enter, and then re-type the user password.
This will give your command prompt the administrative right.

Now we are ready to type the command that will reset/reboot the NAS.

There are 4 different command that you can use:

1) reboot
2) echo C >/dev/ttyS1
3) echo 1 >/dev/ttyS1
4) echo 0 >/dev/ttyS1

The "reboot" command should gracefully reboot your Synology NAS... but for me it doesn't works.
It just stop some NAS services, get me disconnected from the terminal, but the NAS doesn't reboot.

The "echo C >/dev/ttyS1" command is my favorite one: this will instantly hard-reset the NAS, like when you press the reset button on your computer. This is not nice for a NAS, but it's still better than unplugging the power when the NAS get unresponsive.

The  command "echo 1 >/dev/ttyS1" will instantly power off your NAS, like unplugging the power cable.

The  command "echo 0 >/dev/ttyS1" should be like pressing the NAS power button, I never tried that one.

So when my NAS get unresponsive, I usually go for the "echo C >/dev/ttyS1" command.
Press Enter, and the NAS get a forced reset!


Saturday, June 1, 2013

Synology DS213j: review and power consumption test with WD RED 3Tb HDD

I was looking at Synology Nas from long time.
I knew that if I waited enough, they would release the right Nas, with the right spec, at the right price.
And 2 weeks ago this time went. And I placed an order for my new Nas, the Synology DS213j.
I also ordered the HDD for the Nas: 2 Western Digital RED 3Tb HDD (WD30EFRX).

Why the DS213j?
  • because i need an external backup
  • because the price is good
  • because it consume 3.65W in HDD hibernation
  • because it's powerful
  • because it have 512Mb of Ram
  • because I like the DSM (Disk Station Manager, the OS of the Synology Nas) and all it's addons, especially:

Here is the Synology DS213j, in all its glory :-)

Synology Disk Station DS213j Review photos, benchmark, and power consumption testSynology Disk Station DS213j Review photos, benchmark, and power consumption test


Synology Disk Station DS213j Review photos, benchmark, and power consumption testSynology Disk Station DS213j Review photos, benchmark, and power consumption test

Now, one of the reason that pushed me toward the DS213j was one of its specs: a power consumption of 19W when working, and a very low power of 3.65W in HDD hibernation.
The 3.65W in HDD hibernation is very important, because I use my home PC mainly in the evening (19..24) so for the big part of the day (00..19) the NAS will be sitting idle.
Now, if the NAS is powered on 24h/day, even a tiny power consumption will build up.

So, based on my utilization profile, I can calculate the impact on the electricity bill.

Let's try to asses how much will cost to run a DS213j 24h/day for a year.

For each day I have about 5 hours of active utilization, and 19 hours of Nas sitting idle.
lets say 6 vs 18 hours (using a HDD hibernation delay of 1 hour)

So, for the normal working days, we have
1 day power = 6h*19w + 18h*3.65w =  114wh + 65.7wh = 179.7wh / day

But in the week end I spend more time with my PC, so it will be more something like
1 day power = 16h*19w + 8h*3.65w =   333 wh /day

In a year this will build up to:
1 year power = 333wh * 104d + 180wh *261d = 35kwh + 47kwh = 82kwh

You can't ignore 82kwh / year.

The electricity, in Italy, is between 0.2€/kwh and 0.4/kwh (depending on contract), so 82kwh/year will set you back between 16.4€ and 32.8€ / year
Having a NAS that consume about 3.65w during HDD hibernation is beneficial for the electricity bill :-)

About the HDD choice
I bought 2 Western Digital RED 3Tb HDD (WD30EFRX), to use in RAID 1 configuration.
These drives have some advantage over the competition:
  • they are built specifically for NAS usage
  • they consume a bit less than the others WDC models (4.6W read/write, 4.1W idle, 0.6w standby)
  • they are sufficiently cheap

The testing setup
Synology Disk Station DS213j Review photos, benchmark, and power consumption test
The PC (i7-3770k overclocked @4.5Ghz, 16Gb ram, ASUS P8Z77-V Deluxe, SSD Intel 520, bla-bla-bla-yada-yada.... :-) ) and the NAS are connected via a Netgear WNDR 3700v2 gigabit router (not shown in the photo, it's hidden over the furniture :-) ).

The DS213j power consumption test.


The testing equipment is a cheap power meter, that can measure consumption up to 2000w, so I wont  expect a 0.1w precision in the 0w to 20w range... anyway, it's better than nothing :-)

DS213j power consumption during boot process: it oscillate between 5w and 16w
Synology Disk Station DS213j Review photos, benchmark, and power consumption testSynology Disk Station DS213j Review photos, benchmark, and power consumption test


DS213j power consumption at idle, just after booting the Nas: it's stable at 15w
You can see the nas doing nothing, just logged in DSM
Synology Disk Station DS213j Review photos, DSM, benchmark, and power consumption testSynology Disk Station DS213j Review photos, DSM, benchmark, and power consumption test

DS213j power consumption during data reading operation: it's stable at 16w
In the screenshot you can see the statistics in the DSM, I was copying a single big 10Gb file from the Nas to my PC, the data is being copied at a rate of about 71Mb/s.

Synology Disk Station DS213j Review photos, DSM, benchmark, and power consumption testSynology Disk Station DS213j Review photos, DSM, benchmark, and power consumption test


DS213j power consumption during data writing operation: the power consumption is stable at 17w.
In the screenshot you can see the statistics in the DSM. I was copying the same 10Gb file from my PC to the Nas. The file is being copied at a rate of about 64Mb/s. (I made my test with HDD write cache disabled, enabling write cache may enhance performance)
Synology Disk Station DS213j Review photos, DSM, benchmark, and power consumption testSynology Disk Station DS213j Review photos, DSM, benchmark, and power consumption test


 Finally, DS213j power consumption during HDD Hibernation: ...wait for it... wait  for it... 4w!
Synology Disk Station DS213j Review photos, DSM, benchmark, and power consumption test
Eureka! It works (as expected)! Just 4w!
My power meter have a 1w precision... so I will simply assume that the Synology specification are correct about the 3.65w consumption during HDD Hibernation)
Here I don't have a DSM screenshot for the HDD in hibernation state, because accessing the DSM will wake up the HDD.



Additional power consumption testing

Power consumption during a scheduled  Power Off
As requested by a commenter, I've tested the power consumption during a scheduled power off.
After a scheduled power off the DS213j consume 0W , so it's effectively turned off.
Keep in mind that a scheduled power off will have a bit of delay.
On my DS213j, when I schedule a power-off at 15:00, the DS213j will effectively power-off at 15:01.47, about 1 minute and 47 seconds later than the scheduled power-off .
Instead, if you request a power off with the Nas GUI, it will effectively shut-down in about 47 seconds.

Power consumption and Wake On Lan (WOL)
On DS213j you can activate the WakeOnLan function.
When the WOL function is active you can Power On your DS213j via the network.
If the WOL function is active, and the DS213j is powered off, the power consumption is still 0W.
(Well... some time the power consumption have a short spike to 1w or 2w for about 1 sec, but this happen every 2/3/4 minutes... with my power meter I cant do a better analysis of the phenomenon. Anyway, this may be totally unrelated to the WOL feature.)
After activating the WOL function I used a free utility (Depicus wolcmd command line) to test it, and the Wake On Lan worked perfectly.



DS213j FAQ, Tips, Tricks... & Quirks

How much time will take a backup?
My first full backup (850Gb of data on more than 700'000 files.) took about 10 hours. I made it using SyncBack. Your mileage will vary wildly (depending on files size, files count, software used...).

How much time take to sync data with Cloudstation?
I started today to use Cloudstation to sync about 8.5Gb of data (about 18'000 files) it took about 6 hours to sync (upload) all the data from my PC to the NAS. Your mileage may vary.
The maximum Cloudstation upload speed I've seen (from PC to NAS) is about 8Mb/s, when transfering a single very big file (2Gb).
Update: After updating the nas to DSM v4.3 the Cloudstation got faster, now it upload data (from PC to NAS) at about 11Mb/sec (on very big files).

How much space will use the Cloudstation sync service?
If my preliminar understanding are correct, it take AT LEAST two times the size of the data you want to sync.
Do you want to sync 10Gb of data? For these 10Gb of data, Cloudstation will employ at least 20Gb of disk space on the NAS.
But It can use much more than 20Gb of  space, because by default Cloudstation save the last 32 versions of any synced file. So If you edit often a 100Mb file, this may occupy up to 100Mb*32 = 3.2Gb of space on the NAS.

Why the free space on the NAS doesen't increase when you delete some files?
If these file are these file synced via Cloudstation, you need to remove the file from the cloudstation history/recycle bin.
Log in the NAS using the account of the user using the sync service (the admin user wont works), then: Open CloudStation, open the Recycle bin, Select the synced shared folder, and remove the old files.

Why the free space on the NAS, still, doesn't increase when you delete some files?
Are the deleted files in a shared folder that have the recycle bin enabled?
Log in  in the NAS as administrator, open control panel, open the shared folder list, then click "Action" and you'll be able to click "Empty all recycle bins" (for all shared folders) .

TimeBackup: dedicated volume required
The TimeBackup package WILL NEED a "dedicated" volume as a destination for your backup.
You CAN'T use the TimeAckup to backup MyShare on Volumne1 to MyTimedBackupShare on Vloume1. If MyTimedBackupShare is the destination of your TimeBackup, it will need to be on a different volume (Volume2, Volume3...)
This have some implications: you will need to do a planing, do some test, and decide beforehand how much space you are going to dedicate to the TimeBackup function, then  you will create a volume of the needed size.
I used 3Tb HDD in Raid 1, these are effectively about 2780Gb of total space.
I've create a Volume1 of 2000Gb, and a Volume2 of 780Gb.
The Volume1 will contain the shared folder for my data.
The Volume2 will contain the shared folder I will use as a destination of the TimeBackup function.

You CAN'T shrink a volume
On Synology DSM, you can grow a volume (if you have free space) but you CAN'T shrink a volume.
So, I have 2 volumes: Volume1 = 2000Gb, and volume2 = 780Gb.
If I want to grow Volume1, The only way is to delete volume2, then grow volume1, then recreate volume2. You CAN'T shrink volume2, even is it's totally free and unused.
This mean that if you want to use the TimeBackup function, you need to think carefully about how to size your volumes.

Wake On Lan function after a blackout
During my testing I discovered a tiny quirk of the WOL feature.
If you power-off the DS213j 'normally' (by the GUI, or by the button) the WOL function will work perfectly.
But if the DS213j is powered off, and you detach it from the power, the WOL function get 'deactivated', and wont work. In this situation, to power on the DS213j, you need to push the button.
Clearly the WOL function still use a very tiny bit of power, and unplugging the power cable disable the WOL function.
To sum it up: the WakeOnLan function wont work after a blackout :-)


Additional speed testing over WiFi/Smartphone
I've tested the files transfer speed between the Nas and a smartphone over a WiFi network.
  • Smartphone: Samsung Galaxy S4
  • Router: Netgear WNDR3700v2
  • WiFi: 5GHz,  WPA2/PSK
  • The Galaxy S4 link speed: 150Mbps.
  • The Galaxy S4 distance from the router: less than 2 meters
  • The NAS is connected to the router one a Gigabit Lan port
The test: I downloaded 6,89 Gbytes of data (1534 files) from the Nas to the internal memory of the Galaxy S4 using the DSFile App.
The DSFile App is setup to use an HTTP connection.

The files got transferred to the phone in about 1427 sec, the mean download speed is 4,95 MBytes/sec
I think this is s not bad at all, after considering that it's a real data-transfer speed over WiFi for a smartphone.
The network transfer speed reported y the Nas Resorce Manager oscillated between 2MBytes/sec and 8MBytes/sec.
The maximum speed is clearly limited by the WiFi connection, and/or by the smartphone.


Conclusion
I'm very happy about my brand new DS213j, I love the DSM and it's packages.
I'm also very happy about the HDD choice, using a pair of 3Tb WD RED the maximum power consumption is about 17W when writing, 15W when idle, and less than 4W during HDD hibernation.
Exactly what I was expecting :-)

If you have any questions about the DS213j: feel free to ask. :-)