Skip to content

Installing MergerFS on a Synology NAS

Marco edited this page Jan 1, 2022 · 4 revisions

Originally from Reddit. Copied and edited with permission.

A different version to overcome some problems with the method below, can her found here

Install Entware

  1. Create a folder on your hdd (outside rootfs) SSH into your nas and enter "sudo su" , enter in your password. Then run the following command:
mkdir -p /volume1/@Entware/opt
  1. Remove /opt and mount optware folder. Make sure that /opt folder is empty (Optware is not installed), command will remove /opt folder with its contents at this step. Run each command.
rm -rf /opt
mkdir /opt
mount -o bind "/volume1/@Entware/opt" /opt
  1. Run install script depending on the processor. Use command 'uname -m' to find out. Then run the corresponding command.

armv8 (aarch64) - Realtek RTD129x

wget -O - http://bin.entware.net/aarch64-k3.10/installer/generic.sh | /bin/sh

armv5

wget -O - http://bin.entware.net/armv5sf-k3.2/installer/generic.sh | /bin/sh

armv7

wget -O - http://bin.entware.net/armv7sf-k3.2/installer/generic.sh | /bin/sh

x64

wget -O - http://bin.entware.net/x64-k3.2/installer/generic.sh | /bin/sh
  1. Create an Autostart Task On Synology

Create a triggered user-defined task in Task Scheduler.

  • Go to: DSM > Control Panel > Task Scheduler
  • Create > Triggered Task > User Defined Script
    • General
    • Task: Entware
    • User: root
    • Event: Boot-up
    • Pretask: none
  • Task Settings
    • Run Command: Paste the below script in.
#!/bin/sh

# Mount/Start Entware
mkdir -p /opt
mount -o bind "/volume1/@Entware/opt" /opt
/opt/etc/init.d/rc.unslung start

# Add Entware Profile in Global Profile
if grep  -qF  '/opt/etc/profile' /etc/profile; then
	echo "Confirmed: Entware Profile in Global Profile"
else
	echo "Adding: Entware Profile in Global Profile"
cat >> /etc/profile <<"EOF"

# Load Entware Profile
. /opt/etc/profile
EOF
fi

# Update Entware List
/opt/bin/opkg update
  1. Reboot your NAS.

  2. SSH back into your nas and "sudo su", enter in your password. Then run the following command.

opkg update
  1. Install mergerfs by the following command.
opkg install mergerfs
  1. Make sure it's installed by running the following command. Should list mergerfs somewhere in the list.
ls /volume1/@Entware/opt/sbin 

This will list the version number.

mergerfs --version
  1. Configure mergerfs. Note: Change the file paths to your setup.

*MY CONFIG IS (Don't know if it is the perfect setting, but works in my testing) *

mergerfs -o rw,use_ino,allow_other,func.getattr=newest,category.action=all,category.create=ff,dropcacheonclose=true /volume1/Media/TempMedia:/volume1/Media/GMedia /volume1/Media/FinalMedia 
  1. Profit

If you want more info check out animosity22 github: https://github.com/animosity22/homescripts

Clone this wiki locally