Synology DSM (terminal) service control

DSM 6

Webuserinterface, Synology recommended:

Control Panel, Task Scheduler, Create Scheduled Task, Stop/Start Service

Terminal command:

ssh <admin account>@server

sudo -i

synoservicecfg --list

synoservicecfg --hard-stop <service>

synoservicecfg -stop <service>

synoservicecfg --hard-start <service>

synoservicecfg -start <service>

synoservice –status

synoservice –restart <service>

synoservicectl –restart <service>

Apache webserver:

stop pkg-apache22

start pkg-apache22

reload pkg-apache22


restart DSM Webapplication:

restart synoscgi


DSM 7

Terminal command:

ssh <admin account>@server

sudo -i

To list installed packages, try: synopkg list --name and hit Enter.
To stop a package, try: synopkg stop <package name> and hit Enter (EG synopkg stop USBCopy).
To start a package, try: synopkg start <package name> and hit Enter.
To restart a package (stops a package, then starts it), try: synopkg restart <package name> and hit Enter.

 

Restart HybridShare

synopkg restart HybridShare

 

 

 

 

 

Synology Speedtest

Synology Speedtest

Synology Snelheidstest is een test die uitgevoerd wordt tussen twee Synology NAS-servers. Voor de test wordt gebruik gemaakt van de FTP service op één van de  Synology NAS-servers. Op deze server staat een bestand wat gedownload wordt vanaf de andere server via het Curl commando.

Synology Snelheidstest

Synology Snelheidstest voorbereiding:

turn on ssh on the Synology NAS, Control Panel, Terminal & SNMP, enable SSH service.

root Login using ssh:

ssh user@servernameoripaddress

sudo -i

To download a file from a ftp server anonymous (example):

curl -O ftp://ftp.xs4all.nl/pub/test/1gb.bin

To download a file from a Synology ftp server with authentication(example):

curl  -O ftp://<servername>/<shared folder>/<name file> --user '<Synology User>:<password>'

or

curl -n --netrc-file <file name, or path to file name>  -O ftp://<servername>/<shared folder>/<name file>

-n, --netrc   Must read .netrc for user name and password

     --netrc-file FILE  Specify FILE for netrc

file name contents:

machine <name Synology NAS-server>

login <ftp user on Synology NAS>

password <password ftp user on Synology NAS>

To upload a file to a ftp server (example):

make sure you have a 1GB file. Not in the root folder or delete afterwards.  

curl -T 1gb.bin ftp://speedtest.tele2.net/upload/

Speed in MByte/s(MB/s or kByte/s)
In case M multiple by 10 for megabit per second(Mbps)
In case k divide by 1000 for MByte/s(MB/s)
In case k divide by 100 for megabit per second(Mbps)

schedule download speed task:

create owner executable file with following contents:

cd /volume1/homes/user/
curl -O ftp://ftp.xs4all.nl/pub/test/1gb.bin
rm /volume1/homes/admin/1gb.bin

Control panel, Task Scheduler, create task, run command

/volume1/homes/user/<name file>.sh

Synology Parity Consistency Check

Synology Parity Consistency Check

Synology Parity Consistency Check to control and check with terminal commands the process

Synology parity consistency check terminal commands. How to see the status of the check and control it for example to let it run faster. Also to see where logging takes places.

Running this commands are at your own risk!  

Synology Parity Consistency Check

start ssh session with Synology NAS.

as root:

To check the status of the running parity consistency check:

cat /proc/mdstat

You can also see the speed.  speed=

Showing the running speed:

cd /sys/block/md<X>/md

Where X is your volume, md0 and md1 are system partitions. So md2 would be the first volume

cat sync_speed will show the running speed

To control speed:

cd /sys/block/md<X>/md :

Where X is your volume, md0 and md1 are system partitions. So md2 would be the first volume

cat sync_speed_min

cat sync_speed_max

By changing this values you can control the speed.

echo <value> >sync_speed_max

The standard value sync_speed_max is high so there is no limit.  By lowering this value you can max the speed and slow down the process.

The standard value sync_speed_min is set low By making this value higher you can try to speed up the process. Just check the current speed and try to make this setting higher and check what happens.

Start/Stop and Pause the parity check

cd /sys/block/md<X>/md :

Where X is your volume, md0 and md1 are system partitions. So md2 would be the first volume

Start:

echo check > /sys/block/mdX/md/sync_action

Pause:

There is no actual pause, since you will still fall back a little bit or resume from the beginning if you reboot the unit. But below is the closest one.

#echo idle > /sys/block/mdX/md/sync_action

Stop:

#echo frozen > /sys/block/mdX/md/sync_action

You will need to replace mdX with your volume. For example, md2, md3... ( md0, md1 are system partitions. )

Where logging takes place? 

/var/log/kern.log

To change debug setting:

cd /sys/block/md<X>/md :

Where X is your volume, md0 and md1 are system partitions. So md2 would be the first volume

echo 1 > sync_debug

tail -f /var/log/kern.log will show the last messages

Messages like this to watch for:

md: data-check of RAID array md2

md: md2: data-check stop due to MD_RECOVERY_INTR set.

md: md_do_sync() got signal ... exiting

Do you want Diktio Solutions to help you. Click Here to contact Diktio Solutions.

Synology check health info disks

Storage Manager, HDD/SDD

Select disk and expand information.

Check Status: Normal

Check S.M.A.R.T status: Normal 

Check Bad sector count: 0

Select disk and health info, overview

Disk Reconnection Count, Bad Sector Count and Disk Re-identification Count indicate the total quantity of events that have occurred on your disk or system.

Your data are still safely stored on the disk. Although these parameters provide early warning and information about disk health trends, they do not directly imply imminent disk failure.

Disk Reconnection Count display the sum of S.M.A.R.T. Attribute “UItraDMA CRC Error Count” and other interface issues detected by the system. If this parameter increases abruptly compared to general tendency, it may indicate that the disk or some hardware components are aging.

Select disk and health info, S.M.A.R.T test

Run Quick and Extended test. Check results. 

Select disk and health info, S.M.A.R.T info 

Use https://en.m.wikipedia.org/wiki/S.M.A.R.T. for reference 

check status: OK

Important attributes:

01 Read Error Rate:

(Vendor specific raw value.) Stores data related to the rate of hardware read errors that occurred when reading data from a disk surface. The raw value has different structure for different vendors and is often not meaningful as a decimal number.

If you see any non-zero raw values for ID 1 (for WD and Samsung disks) in the disk S.M.A.R.T. info, the disk is defective.

05 Reallocated Sectors Count : 0 

09 Power-on Hours:

Count of hours in power-on state. The raw value of this attribute shows total count of hours (or minutes, or seconds, depending on manufacturer) in power-on state.

By default, the total expected lifetime of a hard disk in perfect condition is defined as 5 years (running every day and night on all days). This is equal to 1825 days in 24/7 mode or 43800 hours.

10 Spin Retry Count: 0 

184 End-to-End error / IOEDC: 0

187 Reported Uncorrectable Errors: 0

188 Command Timeout: 0

196 Reallocation Event Count: 0

197 Current Pending Sector Count: 0

198 (Offline) Uncorrectable Sector Count: 0 

201 Soft Read Error Rate or TA Counter Detected: 

According to Synology Support:

If you see any non-zero raw values for ID 1 (for WD and Samsung disks) and ID 5/197/198 (for all disks) in the disk S.M.A.R.T. info, the disk is defective.

Synology terminal show S.M.A.R.T report

smartctl --scan

smartctl -a -d sat -T permissive /dev/sda

/dev/sda is the drive

-aPrints all SMART information about the disk.

-d satSpecifies device type. “Sat” is SCSI to ATA Translation (SAT) that is required with Synology.

 -T permissiveDefines tolerance type. “Permissive” tells to ignore failure(s) of mandatory SMART commands and is required with Synology.
 
The commando also shows Hardware disk information:
 
Model Family:     

Device Model:     

Serial Number:   

LU WWN Device Id:

Firmware Version: 80.00A80

User Capacity:    

Sector Sizes:     

Device is:       

ATA Version is:   

SATA Version is:  

Local Time is:    

SMART support is: 

SMART support is: 

 

To run a short S.M.A.R.T test: 

smartctl -d sat -t short /dev/sda