synology

最後更新: 2019-03-11

目錄

 


Apps 's Port

 

控制某 Service Listen 什麼 Port

DSM, DS file

5000 (HTTP)、5001 (HTTPS)

Hyper Backup (目的地端) 

6281 (多版本備份)、22 (如果通過 SSH 加密)、873 (遠端資料複製)

Cloud Station, DS cloud

6690

 


常用 Setting

 

 * To enable password strength rules         # Control Panel > User > Advanced

 


Set IP By Cli

 

/etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE=eth0
BOOTPROTO=static
ONBOOT=yes
IPADDR=192.168.123.41
NETMASK=255.255.255.0

/etc/sysconfig/network

NETWORKING=yes
HOSTNAME=DiskStation
GATEWAY=192.168.123.1

/etc/rc.network restart

 


restart service

 

synoservicectl --restart sshd

--start
--stop
--restart
--reload
--status

synoservicectl --status ftpd

ftpd start/running

 



RAID 的種類

 

SHR

Classic RAID creates the storage volume based upon the smallest disk within the array.

Unlike Classic RAID, SHR divides each drive volume into smaller chunks and creates additional redundant storage.

By using SHR, you can use the unavailable volume as smaller usable chunks,
therefore maximizing storage capacity of each drive.

Unlike Classic RAID, SHR makes the newly upgraded storage readily available for use.

If the drives are replaced with larger ones,

the upgraded storage can be used as soon as two of the disks are upgraded to form a redundant storage array.

RAID F1

RAID F1 is a 1-disk resiliency based on RAID 5 concepts.

differs from RAID 5 by selecting one SSD in the array for distribution of additional parity bits,

effectively writing more data to one SSD than to others in the group.

Writing more data to a single SSD in a group of SSDs allows for a single disk to complete its estimated life cycle before any others in the array.

This provides a single, predictable failure point, which is within the fault tolerance of the array.

 


PhotoStation

 

Help

https://www.synology.com/zh-tw/knowledgebase/DSM/help/PhotoStation/photo

相薄的資料夾

"home/photo"

"Photo Station Uploader"

該功能會運用電腦的系統資源來以較快的速度產生縮圖並壓縮影片

權限

瀏覽至您要編輯的相簿。

按一下更多來修改資訊、相簿權限及使用者在相簿中執行特定任務的權限

若要一次編輯全部現有相簿的權限類型,請前往設定 > 相片並按一下存取權限。

權限類型如下:

公開相簿:所有觀看者皆可檢視此相簿。
私人相簿:擁有適當存取權限的使用者可以檢視此相簿。
密碼鎖定:如果您選擇此選項,請在密碼標頭下方輸入密碼。除非使用者輸入正確的密碼來解鎖相簿,否則此相簿會被鎖定。
 


Hyper Backup

 

Homepage

https://www.synology.com/en-global/dsm/feature/hyper_backup

low Consumption

* Data deduplication (cross-version deduplication)
 * Data encryption and compression
 * Block-level incremental backup (For multi-version backup )
 * Integrity check
   (data corruption can be detected in previous backup versions)
 * Pause and resume your backup tasks

Backup destination:

local shared folder
an external device
another Synology NAS (Hyper Backup Vault)
an rsync server
a public cloud service (Google Drive, Amazon Drive, Dropbox, Microsoft Azure, S3-compatible storage, and Synology C2)

Package:

  • Hyper Backup <- Client
  • Hyper Backup Vault <- Server

Network:

6281 / TCP

File:

*.hbk

 * Modifying or deleting files directly in a backup destination does corrupt stored backup data and cause unexpected behavior.

Setting:

Shared Folder: remote shared folder

Dirctory: 本機名_1(Default)

backup integrity check

Relink to existing task

To reuse existing backup data on any destination, select Relink to existing task.

Relinking helps you directly leverage(杠杆作用) the backup data from a different task.

Checking backup integrity

Check index structure:

This action ensures that backup and deletion will be performed successfully.

Check data:

Data check ensures that backup data can be restored correctly.

"0 minutes" indicates no time limit, which means all backup data will be checked in each run.

 * no data is actually transferred during the Integrity Check

 * If the integrity check schedule conflicts with the backup schedule, they will be performed sequentially instead of simultaneously.

 * If "Check data" is enabled, the checking progress will be written into logs with the data size and backup versions that get checked.

log example:

/var/log/messages

2020-01-31T11:07:52+08:00 MyNAS detect_monitor: (24420) [info] task_state_machine.cpp:311 task 
    [1] from state [Backupable] to state [ErrorDetect] with action [Error Detect]
...
2020-01-31T12:29:43+08:00 MyNAS detect_monitor: (24424) [info] task_state_machine.cpp:311 task 
    [1] from state [ErrorDetect] to state [Backupable] with action [Finish]

Case Study

Server 在 Upgrade FW 間死了, 而 Data 仍在.

在 Server 重裝 DSM 後, 再安返 "Hyper Backup Vault" 及建立了相同 User,

但在 Client Side 依然 backup/integrity check 失敗

解決:

"*.hbk" 檔我 owner 不正確 (UID)

 


Time Machine Backup (舊)

 

1 Create a user for Time Machine and set quota limit

2 Create a shared folder for Time Machine backup

3 Set the shared folder as Time Machine's backup target

Control Panel -> File Services

AFP Section -> Enable AFP service

 * port 548/tcp

Advanced Tab -> Enable Bonjour Time Machine broadcast via AFP -> Set Time Machine Folders

 


Cloud Station Backup

 

Client Side:

Package: Synology Cloud Station Backup

 * set backup rules

Web Panel: Version Explorer

 - Manage backed up files and historical versions

The following file types and drive types are not supported in Cloud Station Backup:

Windows folders with these attributes:

  • Hidden files
  • OFFLINE
  • REPARSE_POINT
  • SYSTEM
  • TEMPORARY

=================

NAS Side:

Package: Install "Cloud Station Server"

Folder permission: R/W

Applications permission: Cloud Station Server

Settings

Cloud Station Server -> Settings -> Sync Settings -> Enable 某 folder

Cloud Station Server -> Settings -> Others -> Database Location

 


CloudSync

 

https://www.synology.com/en-global/knowledgebase/DSM/help/CloudSync/cloudsync

 


Synology Cloud Station Drive

 

功能

NAS 和個人電腦之間同步檔案

目的

即便在沒有網路連線的情況下, 您依然可以瀏覽及編輯檔案,

且所有修改皆會在重新連上網路後自動同步至您的 NAS 及個人電腦

Network

Port: 6690/tcp # 無得改, 因為它沒有用 Application Porta

Installation

  • NAS: Cloud Station Server
  • APP: DS cloud
  • PC: Synology Cloud Station Drive

 


Storage Analyzer

 

synology check shared folder size

https://www.synology.com/en-us/knowledgebase/DSM/help/StorageAnalyzer/StorageAnalyzer_desc

 


btrfs

 

btrfs creat with one of the following RAID types:

  - RAID 1
  - RAID 5
  - RAID 6
  - RAID 10
  - RAID F1
  - Synology Hybrid RAID (SHR/SHR-2) with more than one drive

Manage

 - scrubbing (file self-healing)
 - defragmentation

Cloud Station

Btrfs does not require double the storage space for Cloud Station's file versioning and history data.

Quotas

Per shared folders

Data consistency of backups

Clone entire shared folders

Go to Control Panel > Shared Folder.

Select the desired shared folder in Btrfs file system.

Click Create > Clone.

* Only shared folders on Btrfs volumes can be cloned.

Integrity Protection

Enable advanced data integrity protection (Default: Disable. 只有在建立 Folder 時 enable 它(DSM@6.1))

The file self-healing feature is currently available for the shared folders located in a Btrfs volume

Snapshot Replication

 


iSCSI

 

mount iscsi lun synology

建立步驟

1. Create iSCSI LUN

2. mapping iSCSI LUNs to iSCSI Targets

----

synology create iscsi lun (thin provisioning)

1. Storage Manager > iSCSI LUN Tab > Click Create Button >

2. Choose a LUN type (File_Level) > Thin Provisioning (Select Yes)

LUN type:

iSCSI LUN (File-Level)

iSCSI LUN (Block-Level)

File-Level:

Regular file LUNs

provide better overall I/O performance

Advanced file LUNs

support hardware acceleration commands, including VMware VAAI, Windows ODX, LUN snapshots and

clone to enhance storage efficiency and data protection.

 

Allow multiple sessions from one or more iSCSI initiators:

For iSCSI MPIO or MC/S, allow multiple sessions or Initiators to communicate with the same Target.

cluster-aware file system, such as VMware Virtual Machine File System(vmfs), or Oracle Clustering File System.

 

Maximum receive/send segment bytes:

Adjusting the sending or receiving segment frame can yield differences in iSCSI performance.

CRC Checksum

 - Header digest

 - Data digest

performs a checksum over each iSCSI Protocol Data Unit (PDU)

Masking

made accessible or be denied by different iSCSI Initiators, based on the IQN of the iSCSI Initiator

Edit -> Masking -> "Default privileges"

 * Default: RW

CHAP

CHAP

Pass: 12~16 Char

Mutual CHAP

require both initiators and Targets to authenticate each other before facilitating communications.

Masking & CHAP 其中一樣認證失敗都是呢個 log

iscsiadm: initiator reported error (24 - iSCSI login failed due to authorization failure)

File Fast Clone:

physical data blocks will be copied only upon modification of the cloned files, which will save storage space

File Services -> Advanced

Snapshot

On certain models, you will have to go to Package Center and install "Snapshot Replication"

for functions including restoring iSCSI LUNs, taking and cloning iSCSI LUN snapshots.

snapshot feature is supported on advanced LUNs only

 * If you took a snapshot or created a clone,

    and the status turned out to be Abnormal/Crashed,

    please delete this snapshot/clone and create another one.

To clone an iSCSI LUN or snapshot:

Snapshot Replication -> Snapshots -> iSCSI LUN

 

 

 

Plugin

Snapshot Manager for X

plugin for Windows Server allows you to create application-consistent snapshots in DSM

Windows

when a snapshot is triggered on DSM, Synology Snapshot Manager will use the Microsoft Volume Shadow Copy Service (VSS) technology to produce consistent point-in-time copies of data

VMware

when a snapshot is triggered on DSM, vCenter Server will be notified and flush all the data from memory to the LUN to guarantee data consistency.

Once the snapshot is complete, vCenter Server will resume normal I/O operation of VMware datastore.

Internet Storage Name Service (iSNS)

iSNS protocol allows automated discovery, management and configuration of iSCSI and Fibre Channel devices (using iFCP gateways) on a TCP/IP network.

 

Remark

Timezone

* Use GMT +0 timezone

Snapshot Replication -> Setting -> Advanced

 


User Home Service

 

It is referring to the 'user home service' which you can disable in:

Control Panel -> User -> Advanced -> Enable user home service

The 'homes' folder contains a home folder for each user. The 'home' folder is linked to the relevant folder within 'homes',

ie. if logged in as admin the home folder will be the same as homes/admin.

* Once the local user home service is disabled, the domain user home service will also be disabled concurrently.

 

 


Shared Folder Sync

 

log

ssh nas

grep s2s_syncer /var/log/messages

 


rsync

 

Assign rsync backup privileges

Control Panel > Privileges > rsync

If you perform rsync backup from a non-Synology NAS client,

you have to create "rsync accounts" on the destination Synology NAS

so that the rsync users can back up data to your Synology NAS.

Step

[1] Control Panel > File Services > rsync, and select Enable rsync account

[2] Edit rsync Account

 * If the rsync service is unencrypted, you need to create corresponding rsync accounts for them.

第一次進行同步時, 共用資料夾同步功能會將所選的共用資料夾進行完整的同步

如果目的地已存在共用資料夾, 其名稱與來源端共用資料夾 (例如名稱為 SharedFolder) 相同,

目的地資料夾將被命名為「SharedFolder_1

依照預設, 使用者皆無權限存取目的地共用資料夾。請連絡目的地 admin,請求權限。

若目的地端伺服器名稱和您的 Synology NAS 相同, 共用資料夾同步將會失敗

若來源端 Synology NAS 將 homes 共用資料夾同步至目的地端 Synology NAS,

目的地端 Synology NAS 的使用者家目錄功能會被停用。
 


Synology NAS migration

 

# Prepare

0. Disable file sharing service on NEW NAS

1. Setup "Shared Folder Sync" on both NAS ( OLD --> NEW )

2. Sync

# Onsite

3. tell ALL user save file

4. Disable file sharing service on OLD NAS ( Or disconnect both NAS from network and link it directly )

5. Sync again

6. import dss file (User ...)

8. Shutdonw OLD NAS & Enable file sharing service on NEW NAS

 


dss file (Backup)

 

The configbackup.dss is a tar.gz containing 2 files :

_Syno_UserBkp.db : SQLlite commands to create tables like user_app_privilege_tb, group_id_tb, user_id_tb, and some inserts (users and groups)

configbackup : a text file with user passwords, shares, ...

 


Resource Monitor - Usage History

 

historical performance metrics:

Time Range:

  • Real Time
  • 1 Day
  • 1 Week
  • 1 Month
  • 1 Year

 

 


"@eaDir" Folder

 

This directory is used by the indexing service.

Disable the Service Creating Them

SSH in as root and run the following:

cd /usr/syno/etc.defaults/rc.d/

chmod 000 S66fileindexd.sh S66synoindexd.sh S77synomkthumbd.sh S88synomkflvd.sh S99iTunes.sh

find . -type d -name "@eaDir" -print0 | xargs -0 rm -rf

 


Update Local SSL Certificate

 

get_ssl.sh

#!/bin/bash

# 行 letsencrypt 的 server
Server=192.168.123.14
SSL_Path=/etc/letsencrypt/live/datahunter.org/
Local_SSL_Path=/usr/syno/etc/certificate/system/default

cd $Local_SSL_Path

# 要設定用 key login
scp $Server:$SSL_Path/chain.pem ./
scp $Server:$SSL_Path/fullchain.pem ./
scp $Server:$SSL_Path/cert.pem ./
scp $Server:$SSL_Path/privkey.pem ./

# restart Application Portal
synoservicectl --reload nginx

 


Log Center

 

Archive logs(SYNOSYSLOGDB__LOCALARCH.DB)

要安 log center 先有 Archive 功能

Local logs (System, Connection, and File Transfer logs) are saved in a system partition that has limited storage.

By enabling Archive local logs to the storage location specified.

If you did not enable archive log function, previous log will be deleted when accumulated log exceeds log database's maximum retainable log number.

File Station     20,000
FTP     20,000
SMB     100,000
AFP     20,000
WebDAV     20,000

Settings:

Archive logs as text format in addition to default format:

Saves archives as a plain text files in addition to the default SQLite files.

Archive logs separately according to device:

Saves separate archives for individual client devices that send logs to the Synology NAS.

設定 log 什麼

File Services -> Enable Transfer Log

File Station -> Settings  -> Enable File Station Log

 


Models

 

DS218+

  • Access: 17.23 W
  • HDD Hibernation: 5.4 W

 


Replace HDD

 

1) 確定那 HDD 有問題

Storage Manager -> HDD/SSD -> Select HDD -> Action -> Switch Drive Indicator Status

Set the amount of time the drive indicator remains "alert" for, which can be between 1 minute and 60 minutes.

HDD 綠 -> 橙

2) 換好 HDD 後 repair RAID

 * The size of the replacement drive must be larger or equal to the size of the smallest drive in the storage pool.

 * The status of the drive for replacement must be Initialized (已經 Sync 好 OS) or Not Initialized.

Storage Manager -> Storage Pool -> Select "Pool" -> Action -> Repair

Select the replacement drive which you would like to add to the volume.