Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
synology useful config tips

Table of Contents

Use NVMe as a storage

# synopartition --check /dev/sata1
/dev/sata1: partition layout is version 8, list index is 13.
# synopartition --part /dev/nvme0n1 13

        Device   Sectors (Version8: SupportRaid)
 /dev/nvme0n11   4980480 (2431 MB)
 /dev/nvme0n12   4194304 (2048 MB)
Reserved size:    260352 ( 127 MB)
Primary data partition will be created.

WARNING: This action will erase all data on '/dev/nvme0n1' and repart it, are you sure to continue? [y/N] y
Cleaning all partitions...
Creating sys partitions...
Creating primary data partition...
Please remember to mdadm and mkfs new partitions.
# cat /proc/mdstat
Personalities : [linear] [raid0] [raid1] [raid10] [raid6] [raid5] [raid4] 
md1 : active raid1 sata1p2[0] sata2p2[1]
      2097088 blocks [2/2] [UU]
      
md0 : active raid1 sata1p1[0] sata2p1[1]
      2490176 blocks [2/2] [UU]
      
unused devices: <none>
# mdadm /dev/md0 -a /dev/nvme0n1p1
mdadm: added /dev/nvme0n1p1
# mdadm /dev/md1 -a /dev/nvme0n1p2
mdadm: added /dev/nvme0n1p2
# cat /proc/mdstat
Personalities : [linear] [raid0] [raid1] [raid10] [raid6] [raid5] [raid4] 
md1 : active raid1 nvme0n1p2[2](S) sata1p2[0] sata2p2[1]
      2097088 blocks [2/2] [UU]
      
md0 : active raid1 nvme0n1p1[2](S) sata1p1[0] sata2p1[1]
      2490176 blocks [2/2] [UU]
      
unused devices: <none>
# mdadm --create /dev/md2 --level=1 --raid-devices=1 --force /dev/nvme0n1p3
mdadm: /dev/nvme0n1p3 appears to be part of a raid array:
       level=raid1 devices=1 ctime=Mon Jul 13 16:46:20 2020
mdadm: Note: this array has metadata at the start and
    may not be suitable as a boot device.  If you plan to
    store '/boot' on this device please ensure that
    your boot-loader understands md/v1.x metadata, or use
    --metadata=0.90
Continue creating array? y
mdadm: Defaulting to version 1.2 metadata
mdadm: array /dev/md2 started.
# cat /proc/mdstat
Personalities : [linear] [raid0] [raid1] [raid10] [raid6] [raid5] [raid4] 
md2 : active raid1 nvme0n1p3[0]
      239476416 blocks super 1.2 [1/1] [U]
      
md1 : active raid1 nvme0n1p2[2](S) sata1p2[0] sata2p2[1]
      2097088 blocks [2/2] [UU]
      
md0 : active raid1 nvme0n1p1[2](S) sata1p1[0] sata2p1[1]
      2490176 blocks [2/2] [UU]
      
unused devices: <none>
# mkfs.ext4 -F /dev/md2 
mke2fs 1.42.6 (21-Sep-2012)
Filesystem label=1.42.6-25426
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
14974976 inodes, 59869104 blocks
25600 blocks (0.04%) reserved for the super user
First data block=0
Maximum filesystem blocks=2208301056
1828 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks: 
	32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 
	4096000, 7962624, 11239424, 20480000, 23887872

Allocating group tables: done                            
Writing inode tables: done                            
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done     

# reboot
# cat /proc/mdstat 
Personalities : [linear] [raid0] [raid1] [raid10] [raid6] [raid5] [raid4] 
md2 : active raid1 nvme0n1p3[0]
      239476416 blocks super 1.2 [1/1] [U]
      
md1 : active raid1 sata2p2[1] sata1p2[0]
      2097088 blocks [2/2] [UU]
      
md0 : active raid1 nvme0n1p1[2](S) sata1p1[0] sata2p1[1]
      2490176 blocks [2/2] [UU]
      
unused devices: <none>

Namecheap DDNS Support

wget -O /usr/syno/bin/ddns/namecheap.php https://gist.github.com/hwkr/906685a75af55714a2b696bc37a0830a/raw/f043a1b0d7edacb68eaaf16c6779181fd559658f/namecheap-synology-ddns.php
chmod a+x /usr/syno/bin/ddns/namecheap.php
cat >> /etc.defaults/ddns_provider.conf

text to enter with cat:

[Custom - Namecheap]
        modulepath=/usr/syno/bin/ddns/namecheap.php
        queryurl=dynamicdns.park-your-domain.com

press [Ctrl]-[D] once done to send EOF marker

Useful Links

RAID related info

LetsEncrypt info

docker run -it --rm --name certbot -v "/volume1/srv/cert/letsencrypt/etc:/etc/letsencrypt" -v "/volume1/srv/cert/letsencrypt/lib:/var/lib/letsencrypt" certbot/certbot -d your.domain --manual --preferred-challenges dns certonly

Synology moments

https://forum.synology.com/enu/viewtopic.php?t=136691&start=90

Hiding #recycle folder

https://community.synology.com/enu/forum/17/post/57831

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment