Hardware field notes · Synology DiskStation

Yes, my DS916+ Synology will run another OS

The firmware checks two things and nothing else. Pass them, raise four GPIO lines, and the DiskStation is an ordinary Linux box that will take whatever OS you choose. Here is how — and why, in this case, that OS became TrueNAS.

Tested on · DS916+ (Pentium N3710) Installed here · TrueNAS SCALE 25.10 Also fits · any EFI Linux Status · working, in daily use

In 2016, I bought a Synology DiskStation. It worked well, and for a long time, that was enough. Over the years, however, I started working more and more with TrueNAS, and eventually I found myself asking a very simple question: why couldn’t TrueNAS run directly on Synology hardware?

Although almost everything I read suggested that it could not be done, I knew that a DiskStation was not some mysterious black box. At its core, it is simply a compact Intel-based computer. The real question was not whether it could run another operating system, but how to get into it.

That turned out to be the interesting part. Synology controls the way the machine starts, yet behind that front door there is no elaborate signed-boot chain, no proprietary SATA architecture and no exotic firmware system standing between the hardware and Linux. Instead, there is primarily a bootloader check, together with a handful of hardware-specific details that DSM normally takes care of for you.

Those details include things such as the drive bays, LEDs, fans, disk power and sleep behaviour. A normal Linux kernel does not automatically understand how all of these components are controlled on Synology hardware, but once you teach it how the hardware works, the situation changes considerably.

The DiskStation stops behaving like a closed appliance and becomes a computer again.

That means it can run Debian, Proxmox, OpenMediaVault and, yes, TrueNAS directly on the hardware, while still making use of the features that make the DiskStation useful in the first place, including its drive bays, LEDs, fan control, disk power management and sleep behaviour.

That is what this page is about: not replacing Synology hardware, but unlocking it.

Most of what follows is not specific to TrueNAS. The same principles apply to other Linux-based operating systems as well, and wherever TrueNAS requires something different, I will point it out explicitly.

There is, however, one important thing to understand before we begin. We are going to make changes involving the boot process, GPIO, disk power and firmware. Before changing anything, therefore, please read the disclaimer.

And then we can open the door.

Summary

Quick implementation

For a Synology DS916+, the minimum required path is:

  1. Prepare a boot device that enumerates as f400:f400.→ Get past the boot check
    Use a USB device or SATA-to-USB bridge whose VID:PID can be rewritten. A JMS578 bridge is known to work.
  2. Install the target OS to the boot SSD and duplicate its EFI loader:
    $ mount /dev/sdX2 /mnt/esp
    $ cp /mnt/esp/EFI/boot/bootx64.efi /mnt/esp/EFI/boot/SynoBootLoader.efi
    $ umount /mnt/esp
  3. For installation, keep the EFI loader and installer on the same physical USB device. Recommended layout:→ One device, two partitions
    p1  FAT16   16 MB     EFI loader
    p3  FAT32   ~4 GB     extracted installer ISO
    Do not write the installer ISO raw; extract its contents to FAT32.
  4. Boot and install the OS.
    TrueNAS can be installed headlessly over the network; other Linux distributions may require serial access or installation on another machine first.
  5. Assign unique MAC addresses to both Intel i210 interfaces.→ Two ports. Two addresses.
    Read the original addresses from the eDOM vender file or use unique locally administered addresses. Apply them with per-interface systemd .link files matched by PCI path.
  6. Power the four internal drive bays before storage services start:→ Turn the drive bays on
    # for line in 615 614 631 612; do
        echo "$line" > /sys/class/gpio/export
        echo high > /sys/class/gpio/gpio$line/direction
        sleep 3
    done
    Run this from a systemd unit before ZFS, LVM, mdadm, or equivalent storage discovery/import.
  7. Make all hardware-specific configuration persistent.→ Make it persistent
    Persist GPIO power control, .link files, LED/fan configuration, and related scripts. On TrueNAS, store them outside /etc and restore them during POST-INIT, because updates can replace local /etc modifications.

Minimum functional configuration

The system only needs two hardware-specific modifications to become operational:

Boot device → USB VID:PID f400:f400
Drive bays  → GPIO 615, 614, 631, 612 = HIGH

Everything else — MAC restoration, LEDs, fan control, disk sleep and update persistence — is integration work.

→ Becoming f400:f400→ Turn the drive bays on→ Lights, fan and sleep

Tested configuration: DS916+ / Intel Pentium N3710 / TrueNAS SCALE 25.10.

Caveat

Do not reuse GPIO numbers, PCI paths or firmware offsets on another DiskStation model without verifying them against that system’s own eDOM, kernel command line and hardware layout.


1

Get past the boot check

The DiskStation boots from a small internal USB module, the eDOM, connected to header J2. The firmware will start a USB device provided that two conditions are met: the device identifies itself as USB f400:f400, and it contains a file named \EFI\boot\SynoBootLoader.efi.

That file is, however, simply an unsigned GRUB EFI executable; there is no cryptographic verification of its contents. As a result, any compatible EFI loader placed under that filename is executed. The practical approach is therefore to install the operating system of choice onto an SSD in a USB enclosure whose VID:PID can be changed to f400:f400 — a JMicron JMS578 bridge is suitable for this — after which the operating system's own EFI loader can be copied to the filename expected by the Synology firmware:

$ mount /dev/sdX2 /mnt/esp
$ cp /mnt/esp/EFI/boot/bootx64.efi /mnt/esp/EFI/boot/SynoBootLoader.efi
$ umount /mnt/esp

There is no local display output, which leaves two conventional installation paths: install the operating system onto the SSD using another machine and subsequently move the SSD to the DiskStation, or operate the installer through the serial header JP1, using 3.3 V TTL at 115200 8N1.

TrueNAS provides an additional option. Its installer exposes JSON-RPC on port 8080, allowing the installation process to be controlled over the network rather than through a local console.


In practice

Becoming f400:f400

The VID:PID is not stored in the USB controller itself but in a small configuration area that the controller reads at power-up: on a flash stick, a block written by the manufacturer’s production tool; on a SATA bridge, an external SPI NVRAM chip on the board. Both can be rewritten. Two devices were given the Synology identity in this project, by two different routes.

A flash stick, with Phison’s production tool

The stick used here (a Kingston DataTraveler) has a Phison PS2251-50 controller. Phison’s mass-production tool, MPALL, writes the controller’s configuration including VID, PID and the product strings. Three things must be matched before it will run:

  • the exact controller and firmware version, read out with ChipGenius — here PS2251-50, F/W 03.03.24, MLC-4K;
  • the MPALL release whose bundled firmware file carries that same version — FW50FF01V30324M-2@4k.BIN in MPALL 3.18.00;
  • a Windows environment with a USB 2.0 controller, since a tool of that age does not recognise xHCI.

In MP.ini, a copy of the original with only four lines changed:

USB VID=0xF400
USB PID=0xF400
String Product Name=DiskStation
Volume Label=DiskStation

MPALL then reports Test Finished (PASS), and lsusb on another machine shows f400:f400 DiskStation. This stick is what made the first boot possible: it carried the loader and the extracted installer described in the next section.

The SSD enclosure, with jms578flash

The SSD sits in a USB 3.0 enclosure with a JMicron JMS578 bridge (152d:0578). JMicron’s own production tool did not recognise the enclosure’s flash chip (an XTX XT25F01D, too recent for the tool’s tables), so the open-source jms578flash was used instead.

  1. Add the flash chip to the tool’s table (spiflash/types.go) using the parameters from flashrom’s chip database — one added line, nothing else changed — and rebuild.
  2. Read the full 50,688-byte firmware image out and keep it:
    $ jms578flash -dev 152d:0578 -extract -firmware original.bin
  3. Locate the NVRAM block. It starts with the marker 55 AA AA 55; the VID and PID follow as little-endian words at offsets 0xC400 and 0xC402 (2D 15 78 05 for 152d:0578), found exactly once in the image.
  4. In a copy, change those four bytes to 00 F4 00 F4; cmp -l must show exactly four differences.
  5. Write the copy back:
    $ jms578flash -dev 152d:0578 -flash -firmware f400.bin -unsafe
    The tool recalculates the block’s checksum on its own — the eight bytes preceding the VID changed after the write.
  6. Power-cycle the enclosure physically. The controller reads its NVRAM only at power-up; a software re-enumeration is not enough. It then reports f400:f400.

The SSD itself is not involved at any point; bridge and drive are separate chips.

Caveat

Both procedures are specific to the controllers involved. A stick with a different controller needs that vendor’s production tool and a matching firmware release; a bridge without external NVRAM has nothing to rewrite and cannot be given a new identity. Keep an unmodified read-out of every device before writing to it.


2

One device, two partitions

During the initial UEFI stage, the firmware exposes effectively one relevant device to the loader: the f400:f400 device from which it booted. From GRUB's perspective, a second USB stick or a SATA disk is therefore not available at the point where the EFI program starts.

This distinction matters because an installer placed on another device may consequently remain invisible to GRUB. A loader that subsequently searches for files on such a device can end up at its rescue prompt; on a headless system without video output, that behaviour is externally indistinguishable from a machine that has simply stopped booting.

The loader and installer are therefore placed on the same physical device, while remaining separated into their own partitions:

partition 1   FAT16, 16 MB, active     \EFI\boot\SynoBootLoader.efi   # the OS's own GRUB, renamed
partition 3   FAT32, ~4 GB             the installer ISO, extracted       # not written raw

The installer ISO is extracted onto FAT rather than written to the partition as a raw image. There are two relevant reasons for doing so. FAT is the filesystem that UEFI implementations can be expected to understand directly, while extraction also places the files GRUB needs to locate — including /.disk/<uuid>, the kernel, the initrd and live/filesystem.squashfs — on the same device from which GRUB is already running.

Nothing in either the loader or the installer itself needs to be modified; only the location from which the existing components are presented changes.

Once started, the installer runs in RAM and becomes reachable over the network. In the case of TrueNAS, this provides a web installer on port 80 together with a JSON-RPC API over WebSocket on port 8080, through which the complete installation sequence — including target selection, password configuration, installation and reboot — can be controlled remotely.

The installation target can be any disk visible to the installer. In this case, that target was an SSD in a USB enclosure, which subsequently became the f400:f400 boot device itself.

Caveat

This configuration was verified on a DS916+ running TrueNAS SCALE 25.10. Other DiskStation models may expose additional devices during the UEFI stage, while other installers may use different mechanisms to locate their installation media. It is therefore advisable to inspect the loader's embedded grub.cfg before assuming that the partition layout above is required unchanged.


Network identity

Two ports. Two addresses.

Outside DSM, both Intel i210 controllers on a DS916+ can fall back to the same unprogrammed MAC:

12:34:56:78:9A:BC

DSM avoids this by reading both real MAC addresses from /vender on the eDOM and passing them through GRUB:

vender /vender -s
sn=XXXXXXXXXXXX macs=001132aabbc1,001132aabbc2

DSM applies them before the network interfaces are created. Other operating systems do not.

On Linux — including TrueNAS SCALE — the same result can be achieved with systemd .link files matched to each controller’s PCI path. udev applies them while the interface is being created, so no active port is ever taken down.

The original MAC addresses are stored in vender on eDOM partition 2, starting at offset 0xD0:

$ xxd -s 0xD0 -l 16 /path/to/vender

Example:

0011 32aa bbc1 ff00 1132 aabb c2

becomes:

00:11:32:aa:bb:c1
00:11:32:aa:bb:c2

You do not have to use the original addresses. You can choose your own unique locally administered unicast MAC addresses; the second hex digit of the first octet must be 2, 6, A or E:

02:00:00:00:00:01
02:00:00:00:00:02

Find each interface’s PCI path:

$ for i in /sys/class/net/en*; do
    echo "$(basename $i) $(readlink -f $i/device)"
done

Then create one file per controller:

# /etc/systemd/network/10-lan1-mac.link

[Match]
Path=pci-0000:0a:00.0

[Link]
NamePolicy=path
MACAddress=00:11:32:aa:bb:c1

and:

# /etc/systemd/network/10-lan2-mac.link

[Match]
Path=pci-0000:0b:00.0

[Link]
NamePolicy=path
MACAddress=00:11:32:aa:bb:c2

Reboot and verify:

$ ip -br link

Make sure the MAC used by your DHCP reservation lands on the port with the cable; a static management IP avoids that dependency entirely.

On TrueNAS SCALE, keep the .link files on persistent storage and restore them to /etc/systemd/network/ during boot, because changes under /etc may not survive updates.

Verified on a DS916+ with two Intel i210 controllers. Other models may use different PCI paths or a different vender layout, so determine those values on the actual machine rather than copying them.

No kernel patch. No DSM emulation. Just give each port its own identity before the network comes up.


3

Turn the drive bays on

At this stage the operating system itself can boot successfully, but the internal drive bays may still appear to contain no disks. The underlying issue is not SATA detection but power: the bays are switched through four SoC GPIO lines which the BIOS leaves low and which DSM normally raises during its own boot sequence.

The required pin numbers can be found in DSM's kernel command line on the eDOM:

syno_hdd_enable=61,60,71,58

On a mainline kernel, these correspond to the following lines on gpiochip1, labelled INT33FF:01:

BaySynology GPIOMainline GPIO line
161615
260614
371631
458612

The bays can then be powered as follows:

# for line in 615 614 631 612; do
    echo $line > /sys/class/gpio/export
    echo high > /sys/class/gpio/gpio$line/direction   # one write; "out" then "1" dips the rail
    sleep 3                                            # stagger the spin-up
  done

The use of high in a single write is deliberate. Writing out first and subsequently writing 1 briefly changes the state of the line, causing the corresponding power rail to dip.

This sequence should be placed in a systemd unit and executed before any service that expects the storage devices to be present, including mdadm, LVM or ZFS pool import. On TrueNAS, the relevant ordering is:

Before=ix-wait-on-disks.service zfs-import.target middlewared.service

With that dependency in place, the drives are powered and available during every normal boot.

Minimum working configuration

At this point the essential hardware dependencies have been addressed. Satisfying the boot check and enabling power to the drive bays is sufficient to obtain a functional system independently of the operating system being used; the remaining work concerns integration features such as LEDs, fan control, disk sleep and persistence across updates.


4

Lights, fan and sleep

The remaining hardware is accessible through standard interfaces, although DSM normally hides most of the relevant implementation details.

  • Tray LEDs are controlled by a TI LP3943 at I²C address 0x60 on i2c-1, with access gated by GPIO line 661. The logic on this board is inverted: register value 00 means on, while 01 means off. For bay N, the green LED is channel 2(N−1) and the orange LED is channel 2(N−1)+1.
  • The fan, status LED and buzzer are controlled by a microcontroller connected to /dev/ttyS1 at 9600 8N1. It accepts single ASCII commands, including Vnn for fan duty and 7, 8 and 9 for status LED off, on and blink respectively. Commands 1 and C must not be sent: they trigger power-off and reset immediately.
  • DSM-like disk sleep can be approximated by enabling EPC on the drives with sg_sat_set_features --feature=0x4a, providing a low-RPM idle state, followed by hdparm -y when the entire group has remained inactive for a longer period. One dependency needs particular attention: any ATA command, including a seemingly harmless hdparm -C issued by monitoring software, restarts the relevant timers. Monitoring should therefore avoid polling disks that have not already generated I/O.

5

Make it persistent

On a conventional Linux distribution, persistence is relatively straightforward because scripts and systemd units stored in /etc remain in place. Appliance-style operating systems introduce an additional dependency, however: on TrueNAS, /etc is writable during normal operation but is reset as part of an update.

The required files can therefore be retained on a small ZFS dataset and restored during POST-INIT:

# zfs create -o mountpoint=legacy boot-pool/syno-hdd-power
# TrueNAS → System → Advanced → Init/Shutdown Scripts, POSTINIT:
mount -t zfs boot-pool/syno-hdd-power /run/shp && bash /run/shp/install.sh; umount /run/shp

The same persistence requirement applies to the .link files used to restore the DiskStation’s network identity. On TrueNAS, these files should therefore be retained alongside the other Synology-specific configuration and restored during POST-INIT after an update.


In this case

Why the operating system became TrueNAS

Any of the usual Linux-based candidates could have been used once the hardware-specific dependencies above were addressed. TrueNAS was selected because three characteristics were particularly relevant for a system intended to remain permanently headless.

The first is ZFS throughout the storage stack, providing checksumming, snapshots and, importantly, a pool that can be moved to another system and imported with a conventional zpool import. The second is the combination of a web interface and API, which makes both the initial headless installation and virtually all subsequent administration possible over the network. The third is the appliance model itself, in which updates are represented as boot environments and can therefore be rolled back when required.

The corresponding trade-off is the persistence mechanism described above, because local changes outside the supported configuration model need to be restored after an update. In practice, that dependency is relatively small.

With Debian or Proxmox, the same hardware approach becomes somewhat simpler: the dataset and POST-INIT restoration step can be omitted, while the remaining boot, GPIO, MAC-address and hardware-control requirements remain essentially the same.


6

Do not reconfigure the network without a recovery path

On a headless DiskStation, the Ethernet connection is effectively the only management interface available during normal operation. Any change to interface naming, addressing, bridging or MAC configuration should therefore be made only when a recovery path already exists.