Tag: Synology

  • synogear install

    This is running on a Synology DMS home NAS. Having been running Unix and Linux for forty years, I’m rather used to overseeing my own systems. Not so much with the NAS.

    Today I discovered that if you run the command synogear install as root, it’ll install a hidden package full of diagnostics commands.

    I found it because I needed iotop.

    My next NAS will be home-spun with a standard Debian based system, so I can do what I want without jumping through useless burning hoops.

  • Synology DS720+ and NVME drives – followup

    Synology DS720+ and NVME drives – followup

    Update

    The current solution to using NVME drives for a storage pool on Synology hardware where Synology doesn’t think you should, is this:

    https://github.com/007revad/Synology_HDD_db

    It is a script that will fiddle with the compatibility database on the system to make it accept the drives you have. It will have to be run after each system upgrade, and probably after each reboot.

    I ran the script, rebooted, had to rerun the script after which I could create a Storage Pool, and then a Volume within the Storage Manager app.

    This kind of stuff really, really shouldn’t be necessary.

    — August 26th, 2023


    Initial grievance

    A while ago I managed to use the NVME drives on a Synology DS720+ NAS as drives, which has worked fine — until today.

    I wrote about it earlier here.

    What I’ve noticed so far:

    1. The DSM7 interface will not recreate the “Storage Pool”.
    2. Logging in as root, I noticed that the raid drive was missing. It should have been ‘md3‘ in my case, by I only had ‘md0‘ to ‘md2‘.
    3. I can reassemble the drive, and the data on ‘md3‘ is still there.
    4. However, a reboot later, and the raid drive disappears, and the error persists.
    5. I can mount ‘/dev/md3‘ manually and use the raid disk, but it doesn’t appear as a volume in Synology’s system. If I mount it under ‘/volume1/‘ I can access the files through the file manager and also create a shared folder in there.

    I guess Synology doesn’t want us to use the NVME slots as drives, even if their NVME cache is all but useless.

    I have tried with NVME drives certified by Synology, and the system still refuses to use the drives for a storage pool.

  • Nextcloud on Synology NAS

    Nextcloud on Synology NAS

    My four years old Synology DS216 couldn’t run Nextcloud, but the new DS720+ can, and happily so.

    The basics are straightforward. Download the ZIP file from nextcloud.org, unzip it under the web shared folder, and configure it in the Web Station app, and run the Nextcloud installer.

    I only had two problems.

    Memcache

    Nextcloud prefers having a memory cache configured, and apparently the apcu module isn’t available in the Synology PHP package. It is not in the list of modules in the Web Station interface.

    It is there, though.

    To activate it, create the file /usr/local/etc/php74/cli/conf.d/nextcloud.ini with this content:

    extension = apcu.so
    
    [apc]
    apc.shm_size = 512M
    apc.enable_cli = 1

    and then enable the memcache normally in the Nextcloud config.php.

    That’ll make the warning go away.

    Cron-jobs

    I kept getting complaints about Nextcloud cron jobs non being run, and I fixed that my creating a normal system crontab for Nextcloud.

    Create the file /etc/cron.d/nextcloud with content:

    PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/syno/sbin:/usr/syno/bin:/usr/local/sbin:/usr/local/bin
    
    0,10,20,30,40,50 * * * * http php74 /volume1/web/nextcloud/cron.php

    Adjust the path to you nextcloud installation directory.

    The cron daemon should pick up the new file automatically. If it doesn’t reload the cron daemon with systemctl reload crond.

    You could probably do the same just as easily using the DSM Task Scheduler.

  • Synology DS720+ and NVME drives

    Synology DS720+ and NVME drives

    This website is partially run off a Synology DS720+ NAS unit which has two M.2 NVME slots available.

    Too bad Synology only wants you to use those slots for a SSD cache on the main HDD volume which in my use case only caused more disk activity, not less. Actually, when I disabled the SSD cache, disk activity lowered substantially.

    That left me with two unsued 500Gb M.2 NVME cards in the NAS.

    The Synology DSM won’t allow you to setup the two NVME drives as a storage volume, but it can be done. I found the recipe on Reddit.

    The storage volume has to be setup by hand, logging in as root over ssh or through sudo.

    Once the M.2 NVME cards are installed, there should be two devices named /dev/nvme0n1 and /dev/nvme1n1.

    They need to be partitioned specifically for Synology with the commands:

    # synopartition --part /dev/nvme0n1 12
    # synopartition --part /dev/nvme1n1 12

    The output of each command should look like this:

            Device   Sectors (Version7: SupportRaid)
     /dev/nvme0n11   4980480 (2431 MB)
     /dev/nvme0n12   4194304 (2048 MB)
    Reserved size:    262144 ( 128 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.

    Running fdisk afterwards should give a result like this:

    # fdisk -l /dev/nvme0n1
    Disk /dev/nvme0n1: 465.8 GiB, 500107862016 bytes, 976773168 sectors
    Disk model: CT500P2SSD8                             
    Units: sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disklabel type: dos
    Disk identifier: 0xf78da1a4
    
    Device         Boot   Start       End   Sectors   Size Id Type
    /dev/nvme0n1p1          256   4980735   4980480   2.4G fd Linux raid autodetect
    /dev/nvme0n1p2      4980736   9175039   4194304     2G fd Linux raid autodetect
    /dev/nvme0n1p3      9437184 976768064 967330881 461.3G fd Linux raid autodetect

    The two first are Synology system partitions and can be ignored.

    Next step is to create a RAID1 unit on the two main data partitions. First check what is already there.

    # cat /proc/mdstat
    Personalities : [raid1] 
    md2 : active raid1 sata1p3[0] sata2p3[1]
          5855700544 blocks super 1.2 [2/2] [UU]
          
    md1 : active raid1 sata1p2[0] sata2p2[1]
          2097088 blocks [2/2] [UU]
          
    md0 : active raid1 sata1p1[0] sata2p1[1]
          2490176 blocks [2/2] [UU]

    These are the three partitions on the two main disks.

    Create the new RAID1 unit with the next available number, in this case /dev/md3:

    mdadm --create /dev/md3 --level=1 --raid-devices=2 --force /dev/nvme0n1p3 /dev/nvme1n1p3

    Check the contents of /proc/mdstat repeatedly until there is no mention of “resync” in the output. If you get output like this you need to wait for it to finish:

    md3 : active raid1 nvme1n1p3[1] nvme0n1p3[0]
          483664384 blocks super 1.2 [2/2] [UU]
          [===========>.........]  resync = 56.2% (272194304/483664384) finish=9.7min speed=360766K/sec

    When it’s done you’ll get output like this:

    md3 : active raid1 nvme1n1p3[1] nvme0n1p3[0]
          483664384 blocks super 1.2 [2/2] [UU]

    Create a file system on the newly created RAID1 disk:

    # mkfs.btrfs -f /dev/md3
    btrfs-progs v4.0
    See http://btrfs.wiki.kernel.org for more information.
    
    Performing full device TRIM (461.26GiB) ...
    Label:              (null)
    UUID:               d51a732b-fc02-4388-ad40-8a0a8d814574
    Node size:          16384
    Sector size:        4096
    Filesystem size:    461.26GiB
    Block group profiles:
      Data:             single            8.00MiB
      Metadata:         DUP               1.01GiB
      System:           DUP              12.00MiB
    SSD detected:       no
    Incompat features:  extref, skinny-metadata
    Number of devices:  1
    Devices:
       ID        SIZE  PATH
        1   461.26GiB  /dev/md3

    Now we’re almost there. Reboot the NAS and wait for it come come back up.

    In the Synology DSM

    Log in to the web GUI and open the “Storage Manager” app. In the upper left there should be an “Available Pool 1”. Click on that, and then on the three dot menu symbol on the right hand side. Select “Online Assembly” from the menu and the DSM should create a new Storage Pool and a new Volume for you.

    The new volume will appear in the Storage Manager, but it doesn’t appear in the File Manager.

    Open the Control Panel, select “Shared Folder” and create a new shared folder. On the “Location” menu you can select the new volume. Afterwards the new shared folder will appear in the File Manager and you can use it as any other folder on the NAS.