Tag: terminal

Synology rsync synchronisation terminal

Synology rsync synchronisation terminal explains the steps to synchronise two shared folders via the rsync protocol. The rsync commando's are executed in a terminal session that's why SSH must be enabled on the Synology NAS. Be careful running the terminal commands because files and folders can be deleted, running the commands is at your own risk.

Synology rsync synchronisation terminal access

You have to make sure that SSH is enabled on the Synology NAS. This can be done from the control panel under Terminal & SNMP. For Windows you can use PuTTY to connect via SSH.

Terminal command:

ssh <admin user>@server

sudo -i

Turn on rsync on the Synology NAS-servers

To turn on rsync on the Synology NAS open control panel, file services, enable rsync service. Both Synology NAS-servers should have the rsync service running otherwise the Synology rsync synchronisation terminal commands don't run.

Identify both folders for Synology rsync synchronisation

Choose which folder on the source Synology NAS you want to synchronise to the other Synology NAS server which will be the destination. When the folder on the destination doesn't exits it will be created but not seen in the control panel as a shared folder. You can make it a shared folder afterwards and the synchronised data will not be overwritten. It is also possible to create first the shared folder on the destination NAS before the synchronisation. The advantage here is that the folder is created with the correct settings like permissions.

With Hyper Backup you can create a rsync copy (single-version). The disadvantage from this way is that a subfolders are created under the destination shared folder and not directly inside the shared destination folder. The rsync job will create a backup folder and is not suitable for this purpose.

When you have already on the destination, shared folders with identical names as the source shared folders, the folders at destination will be renamed! When the folders don't exists on the destination the will be created. When you already have a shared folder on the destination and the data is quit large, deleting the folder will take more time than to synchronise only the differences. After the creating of the shared folder at the destination you cannot access the files without changing the permissions. Also changing the files/folders at the destination after changing the permissions will not result in synchronising the source folders to the destination, running a full synchronisation does the job.

Synology rsync synchronisation terminal commands

Let me start by saying to be careful how you proceed with the following commands because they will overwrite and delete files and folder! So test first and check if the command is doing as expected.

Run the following Synology rsync synchronisation terminal commands at your own risk and first test before usage!!!!

Name Source Synology NAS server: server01

Name Destination Synology NAS server: server02

Shared folder on server01: test test

Shared folder on server02: test test

start terminal session on server02:

Terminal command:

ssh <admin user>@server02

sudo -i

command is run from server02:

Assumed volume1

Purpose: make source shared folder the same on the destination NAS. Delete files/folders within the destination shared folder to make sure that the destination shared folder is the same as the source shared folder.

Synology File System Check

How to run a Synology File System Check on a ext4 file system?

DSM used: DSM 6.2

When checking the log files on a ext4 file system under /var/log I discovered the log file fsck. It appears that every time the system is started the following command is run for Synology File System Check: /sbin/e2fsck -pvf. From the GUI on my Synology NAS it is not possible to start a Synology File System Check on a ext4 file system.

-p Automatic repair (no questions)

-n Open the filesystem read-only, and assume an answer of 'no' to all questions. Allows e2fsck to be used non-interactively. This option may not be specified at the same time as the -p or -y options.

-v Be verbose

-f Force checking even if filesystem is marked clean

How to run the Synology File System Check on a ext4 manually?

Running this commands are at your own risk. Always make sure you have a good backup as there are risks off data loss.

turn on telnet and don't forget to turn it off again. It is a security issue, passwords go unencrypted over the line. In control panel under Terminal & SNMP you can turn telnet on. You need a telnet program on your computer to connect to the Synology NAS. Don't use SSH because when running the below commands you will loose connection.

-C fdThis option causes e2fsck to write completion information to the specified file descriptor so that the progress of the filesystem check can be monitored. This option is typically used by programs which are running e2fsck. If the file descriptor number is negative, then absolute value of the file descriptor will be used, and the progress information will be suppressed initially. It can later be enabled by sending the e2fsck process a SIGUSR1 signal. If the file descriptor specified is 0, e2fsck will print a completion bar as it goes about its business. This requires that e2fsck is running on a video console or terminal.

After completion run: reboot

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

-R, --run Attempt to start the array even if fewer drives were given than are needed for a full array. Normally if not all drives are found and --scan is not used, then the array will be assembled but not started. With --run an attempt will be made to start it anyway.

command should return the message "mdadm: /dev/<md not listed> has been started with x drives."

lvm vgscan : take note of volume group name

vgchange -a y <volume group name, for example:vg1000>

-a, --activate

The command to mount the volume as read-only in order:

mount -o ro,noload /dev/<volume group name>/lv /volume1

volume group must exists on your system.

the volume should be reachable in the terminal session.

To see the data in DSM using File Station or Windows File Service (SMB)