· Administer Synology DSM over SSH: volumes, btrfs, packages, snapshots, crash recovery. Triggers: 'synology', 'dsm', 'diskstation', '/volume1', 'synopkg', 'volume crashed'. Not for desktop Linux distros or their btrfs setups.
Operate Synology NAS appliances over SSH: package and service control, storage stack
inspection, snapshots and backups, and recovery of btrfs volumes that will not mount.
DSM is a Linux appliance with a heavily modified btrfs and a userspace that regenerates its own
config. Two facts drive most of this skill: DSM's btrfs on-disk format is newer than the
btrfs-progs DSM ships and diverges from mainline, so stock tools report healthy volumes as
corrupt; and DSM regenerates /etc/fstab and package state at boot, so hand edits do not
survive.
Target versions (September 2026):
DSM 7.4.1-90080 - current release (7.4 GA was 90075, 2026-06-16)
DSM 7.3 (released 2025-10-08) - Long-Term Support line, maintained to October 2027. Patch
floor is 7.3.2-86009-3 or above: -2 carries the SA-26:06 fixes but not SA-26:03
(CVE-2026-32746). Later -4 builds exist
DSM 7.2 - end of maintenance December 2025, yet it still received fixes in SA-26:06 (April
2026). Treat continued patching as unreliable rather than as policy, and plan an upgrade
Userspace btrfs on the appliance is old (v4.0 on DSM 7.1 avoton). Check with btrfs --version
before assuming a subcommand exists
DSM 7.1.x and earlier do not appear in current advisories' fixed-version lists; treat them as
unpatched. That is a reason to plan an upgrade, not to run one on a unit with a broken volume.
Verify the actual build before quoting any of this: cat /etc.defaults/VERSION.
When to use
Any task on a Synology NAS over SSH: shares, packages, services, users, storage pools
A volume that will not mount, shows "Volume Crashed", or has gone read-only
btrfs work on a Synology volume, including snapshots, subvolume flags, and offline recovery
Deciding whether a DSM warning is real damage or a stock-tool false positive
Planning disk replacement, RAID repair, or a migration between Synology units
Generic Linux administration on a normal distro - use debian-ubuntu, arch-btw,
rhel-fedora, nixos-btw
Mainline btrfs on a normal Linux host - Synology's format divergences do not apply there
Docker Compose authoring, image builds, registry work (Container Manager runs stock Docker) -
use docker for the container content, this skill only for DSM-side paths and permissions
Router, VLAN, DNS, or reverse proxy design around the NAS - use networking
OPNsense/pfSense appliances - use firewall-appliance
Kubernetes storage that happens to point at a Synology CSI target - use kubernetes
Application security review or dependency scanning - use security-audit
Localizing a live outage across an unknown stack - use debug-triage first, then come back here
Proxmox, libvirt, or generic hypervisor work - use virtualization
AI Self-Check
Before returning any DSM command, verify. When no SSH session exists yet - the common case when
answering a question - the appliance-state items convert into the first commands the user runs,
in this order, rather than being skipped:
DSM major version confirmed (cat /etc.defaults/VERSION) - DSM 6 and DSM 7 differ in
service control, root login, and available tools
No command from the hard-refusal list below
Destructive storage operations run against a dm-snapshot overlay, not the live device
Any mount, mdadm, dmsetup, or btrfs write path stated with its blast radius
cd / before anything that unmounts /volume1 (SSH sessions land in the home dir on it)
Shell syntax is ash-compatible (/bin/sh is ash - no process substitution, no bashisms)
Long-running jobs wrapped in setsid nohup ... < /dev/null &, not attached to the SSH session
Binaries deployed to /root/ or a package dir, never /tmp (noexec)
Tool presence checked, not assumed - lsof, fuser, mountpoint, modinfo are absent
Config edits target files DSM does not regenerate, or the regeneration is accounted for
Backup or snapshot state verified before any repair, not after
Hidden state identified: DSM version, model, package dependencies, mounted volumes, and prior repair attempts are made explicit before acting
Verification is real: checks exercise the actual mount, service, or filesystem rather than reading a DSM banner
Routing overlap checked: generic Linux, container, and network tasks are routed to the matching skill
Spec claims verified: claims about DSM behavior are checked against the appliance or Synology's GPL kernel source, not recalled
Cross-cutting agent hygiene applied - see references/agent-hygiene.md
Hard refusals
These are rules, not suggestions. Each one has destroyed a real volume.
Never run btrfs check --repair --init-extent-tree on a Synology volume. Observed
behavior: full scan completes, then it writes a zero-entry node into the chunk tree, hits
BUG_ON in btrfs_try_chunk_alloc, and leaves the filesystem permanently unmountable
(open_ctree failed). There is no recovery from this short of restore or a data recovery lab.
Never mount -o clear_cache on a damaged volume. Unconditional, because proving the free
space tree is not the damaged structure is exactly what a damaged filesystem prevents.
Clearing the tree requires freeing its own blocks, which requires the damaged block. The
transaction aborts during mount and the filesystem then fails open_ctree entirely - strictly
worse than before.
No repair of any kind without a dm-snapshot overlay in place. One named exception: when
there is no usable backup, a single read-only mount attempt on the bare origin is permitted
to reach evacuation, accepting that the mount replays the log tree and is therefore a write.
Everything after that attempt goes through the overlay. See references/btrfs-recovery.md.
Never click "Repair" in DSM on a crashed volume before identifying which layer failed.
The banner does not distinguish mdadm degradation from btrfs read-only. Repair at the wrong
layer writes to every disk in the pool.
Never run mdadm --assemble --force or --create as a first move on a suspect array.
Force-assembly with stale event counts silently picks a wrong parity generation.
Never enable Telnet, including as an SSH workaround. CVE-2026-32746 is an unauthenticated
RCE in DSM's telnetd (CVSS 9.8). If SSH is unusable, use the console or DSM's UI.
Confirm with the user before any RAID repair, volume delete, DSM update, disk removal, or
package uninstall. All of these are outward-facing or irreversible. When running unattended with
no one to ask, stop and report what needs approval - never proceed on a default.
Environment facts
Observed on a DS415+ running DSM 7.1.1 (avoton). The mechanisms hold broadly, but re-check any
row that a decision rests on - scp -O, in particular, follows from DSM's SFTP service being
off, which is a toggle rather than a fixed property.
Fact
Consequence
/tmp is noexec
Deploy binaries to /root/ or a package dir
sftp subsystem disabled
scp needs -O (legacy protocol) or it fails with subsystem request failed
User homes live on the data volume (/volume1/homes/<user>)
If the volume is down, key auth breaks (authorized_keys unreadable) and login prints Could not chdir to home directory
Every SSH session lands in the home dir
umount /volume1 fails with "target is busy". Always cd / first
DSM 7 disables direct root SSH. Log in as an admin user and sudo -i
/etc/fstab is regenerated at boot
Hand-edited mount options do not persist
syno_poweroff_task
Exists on DSM 6, not on DSM 7.1+. Stop packages and services individually
Defaults live in /etc.defaults/
Edits there survive DSM updates better than /etc/; both can be overwritten by a major upgrade
Read references/dsm-cli.md for the command reference (packages, services, shares, users,
indexing, logs, SMART, notifications).
Workflow
Step 1: Identify the appliance before anything else
cat /etc.defaults/VERSION # productversion, buildnumber, majorversion
grep unique /etc.defaults/synoinfo.conf # platform, e.g. synology_avoton_415+
uname -a # kernel (3.10.x or 4.4.x on most models)
synopkg list --name # installed packages
Model and build determine which GPL kernel source to read, which btrfs features exist, and
whether DSM 6 or DSM 7 semantics apply. Do not skip this step to save a round trip - almost
every later decision depends on it.
Step 2: Establish the storage picture
cat /proc/mdstat # all md arrays, degraded state, resync progress
sudo vgs; sudo lvs # LVM layer
sudo btrfs filesystem show # filesystems and devices
sudo btrfs filesystem usage /volume1 # data vs metadata allocation
df -h /volume1
mount | grep volume # actual mount options in force
The stack is /dev/sdX3 -> mdN (RAID) -> vgN/volume_N -> cachedev_N (flashcache shim) -> btrfs.
md0 (system, ~8 GB) and md1 (swap, ~2 GB) are RAID1 across all disks and are commonly
found degraded and ignored for months. Check them; repair is a plain mdadm --add and an 8 GB
RAID1 resync finishes in under a minute.
Read references/storage-and-backup.md for SHR, disk replacement, compatibility database,
snapshots, and backup verification.
Step 3: Route on symptom
Symptom
Route
Volume mounts, DSM is healthy, routine task
references/dsm-cli.md
Degraded array, disk replaced, pool repair
references/storage-and-backup.md
Volume read-only, "Volume Crashed", will not mount
references/gotchas.md, then references/storage-and-backup.md section 4 first - the banner does not say which layer failed. Only once the array and LV are confirmed healthy does it become references/btrfs-recovery.md
Stock btrfs reports corruption but the volume mounts and reads fine
Likely a Synology format divergence, not damage. references/btrfs-recovery.md, section on private trees
Package keeps restarting after being disabled
Dependency resurrection - references/dsm-cli.md
Step 4: Change with a stated blast radius
Before any write: state what is affected, whether it is reversible, and what the rollback is.
For storage operations, the rollback is the overlay or a verified backup - nothing else counts.
Step 5: Verify against the runtime, not the UI
DSM's banners lag reality and its health status is derived. Verify the thing itself:
mount | grep /volume1 # actually mounted, and rw or ro?
sudo btrfs filesystem usage /volume1 # metadata headroom
sudo dmesg | tail -100 # kernel truth about the mount
synopkg status <Pkg> # package state as JSON
# damage survey: hours on a large share, so detach it and keep stderr
sudo setsid nohup sh -c 'find /volume1/<share> -size +0 > /dev/null' \
> /root/survey.log 2>&1 < /dev/null &
find <dir> alone performs readdir only and reads no inodes, so it reports a badly damaged
filesystem as clean. -type f does not fix that: find answers -type from the d_type
that readdir already returned and skips the stat entirely. Use a predicate that needs inode
data - -size +0, -printf '%s\n', -newer <ref> - and let stderr through instead of
discarding it, since the EIO lines are the finding.
Recovery first moves
Establish the goal before the sequence. With a verified backup, the goal is repair. Without
one, the goal is evacuation: get the data off a read-only mount first, and treat repair as a
later, optional problem. Buying destination disks is cheaper than a recovery lab. Ask which
situation the user is in; do not assume.
When a volume will not mount, do these in order. Details in references/btrfs-recovery.md;
read references/gotchas.md before the first write of any kind.
The branch that decides the order: with a verified backup, build the overlay first and run
every mount attempt against it. Without one, take the named exception in hard refusal 3 - one
read-only mount attempt on the bare origin, accepting the log-replay write, because evacuation
beats purity. After that attempt, everything goes through the overlay.
Stop writing. Do not repair, do not reboot repeatedly, do not let DSM auto-repair. Do not
update DSM on a unit with a broken volume.
Identify version and platform (Step 1 above), and confirm the failure is above the RAID
layer (references/storage-and-backup.md section 4).
Try the cheap read-only mount options, cheapest first, reading dmesg after each failure.
-o ro,no_quota_tree alone recovers a common class of Synology mount failure. Note that a
read-only mount still replays the log tree, which is a write - the reference explains when
that forces the overlay first.
If a read-only mount succeeds and there is no backup, evacuate now. Repair decisions get
easier once the data is elsewhere.
Build a dm-snapshot overlay and fingerprint the origin before any write attempt. The
overlay and a mounted origin are mutually exclusive, so this is a branch point, not a step
that stacks on top of step 3.
Read the GPL kernel source for the nearest published release family when the cheap options
fail (the archive carries families such as 7.3-86009, 7.2-72806, 7.1.1-42962, not every
build; 7.4 has no drop yet):
https://archive.synology.com/download/ToolChain/Synology%20NAS%20GPL%20Source/<VER>-<BUILD>/
Extract fs/btrfs/ and read ctree.h, disk-io.c, super.c, usrquota.c. It converts a
black box into a documented system, and twenty minutes there beats hours of probing.
Only then consider offline tools, and only a patched btrfs-progs build, against the overlay.
Packages and services
synopkg list --name # installed packages (no --started on 7.1)
synopkg status <Pkg> # JSON status
synopkg stop|start <Pkg>
synopkg enable|disable <Pkg> # autostart marker in /var/packages/<Pkg>/enabled
systemctl stop pkgctl-<Pkg>.service # the underlying unit
Package dependencies resurrect packages.synopkg disable is not enough if another
installed package declares the target in install_dep_packages:
grep -h install_dep_packages /var/packages/*/INFO
Synology Drive declares SynoFinder, so SynoFinder restarts within a minute of being disabled.
When the goal is "stop indexing this share", use the indexer's own control tool rather than
fighting the package manager - see references/dsm-cli.md.
Disable the default admin account; use a named admin with 2FA
Move SSH off 22 only as noise reduction, not as a control; restrict by firewall rule instead
Do not expose DSM's web UI directly to the internet. QuickConnect and DDNS both widen exposure;
prefer a VPN into the LAN
Patch level matters more than version line: 7.3 LTS with current patches is a supported
posture, 7.2.1 without them is not
Snapshots are not backups until they are replicated off the unit. Immutable (WORM) snapshots,
introduced in DSM 7.2, resist an admin-account compromise; ordinary snapshots do not
Package exposure is the real attack surface: MailPlus, Photos, and Drive carry most advisories.
Uninstall what is unused
Performance
Check btrfs filesystem usage metadata headroom before blaming disks. A metadata-full btrfs
behaves like a failing filesystem while every disk is healthy
Indexing (synoindexd, synoelasticd) and Photos face-recognition dominate CPU on small units;
pause per share rather than disabling packages
synoindexd and snapshot deletion both spike I/O; do not benchmark during either
SHR/RAID5 resync and btrfs balance are both throughput killers - check /proc/mdstat before
investigating "slow NAS" complaints
references/storage-and-backup.md - SHR and the RAID/LVM/btrfs stack, disk replacement,
drive compatibility database, snapshots, Hyper Backup, restore verification. Read when the
task touches disks, pools, snapshots, or backups.
references/btrfs-recovery.md - Synology's btrfs divergences (private root flags, private
trees, private mount options, the usrquota mount trap), dm-snapshot overlay procedure, mount
escalation ladder, tool matrix, btrfs-progs bugs, subvolume flag ioctls. Read when a volume
will not mount or when stock tools report corruption.
references/gotchas.md - footguns, diagnostic hygiene, ash shell traps, behavior of a
damaged volume. Read before any repair attempt.
Output Contract
See references/output-contract.md for the full contract.
Skill name: SYNOLOGY-DSM
Deliverable bucket:audits
Mode: conditional. When invoked to analyze, review, audit, or improve an existing
system (health review, recovery post-mortem, hardening audit), emit the full contract and
write the deliverable to docs/local/audits/synology-dsm/<YYYY-MM-DD>-<slug>.md. When invoked
to answer a question, run a routine command, or explain behavior, respond freely.
Severity scale:P0 | P1 | P2 | P3 | info (see shared contract).
Related Skills
docker - Container Manager on DSM is stock Docker plus a GUI. That skill owns the compose
file and image; this one owns /volume1 paths, DSM permissions, and package lifecycle.
networking - DNS, VPN, reverse proxy, and VLAN work around the NAS. This skill stops at
the appliance's own interfaces.
debug-triage - localizes an unknown failing layer during a live incident. Use it first when
"the NAS is down" could be network, power, or storage; this skill takes over once it is DSM.
debian-ubuntu - DSM 7 is Debian-derived, so some package intuitions carry over, but DSM's
own package manager and config regeneration do not behave like apt.
security-audit - reviews application code and dependencies. This skill covers appliance
hardening and DSM-specific exposure.
virtualization - Virtual Machine Manager on DSM runs QEMU/KVM underneath; that skill covers
the guest and hypervisor concepts, this one the DSM package around them.
Rules
Identify the DSM version and platform before advising anything. Behavior differs across
DSM 6, 7.1, 7.2, and 7.4.
No repair without an overlay. Any operation that can write to a damaged volume runs
against a dm-snapshot overlay first.
Never --init-extent-tree, never clear_cache on a damaged volume. Both destroy volumes,
and the clear_cache ban is unconditional.
Read Synology's GPL kernel source for the exact build before deep recovery work. It is
authoritative documentation of the on-disk format and nothing else is.
Treat mainline-tool corruption reports as unverified. Synology's private root flags and
trees are rejected by mainline's tree-checker. Confirm damage against the DSM kernel's own
behavior before acting on a stock-tool verdict.
Damage surveys need an inode-reading predicate.find bare or with -type f reads no
inodes and reports a corrupt volume as clean. Use -size +0 or -printf '%s\n'.
Confirm before destructive or outward-facing actions: RAID repair, volume delete, disk
removal, package uninstall, DSM update, reboot of a production unit.
Detach long-running jobs.setsid nohup ... < /dev/null &, with the logic in a script
file so pkill -f patterns cannot match your own command line.
Suspect the diagnostic first when it returns nothing. Empty output on a damaged system is
usually a broken check, not a clean result.
Snapshots are not backups. Verify a restore path off the unit before touching storage.
1---2name: synology-dsm3description: >4 · Administer Synology DSM over SSH: volumes, btrfs, packages, snapshots, crash recovery. Triggers: 'synology', 'dsm', 'diskstation', '/volume1', 'synopkg', 'volume crashed'. Not for desktop Linux distros or their btrfs setups.5license: MIT6compatibility: "Requires SSH access to a Synology NAS running DSM 7, with an admin account for sudo. DSM 6 differences are noted but not covered in depth"7metadata:8 source: iuliandita/skills9 date_added: "2026-07-27"10 effort: high11 argument_hint: "[task-or-host-or-volume]"12---1314# Synology DSM: Administration and btrfs Recovery1516Operate Synology NAS appliances over SSH: package and service control, storage stack17inspection, snapshots and backups, and recovery of btrfs volumes that will not mount.1819DSM is a Linux appliance with a heavily modified btrfs and a userspace that regenerates its own20config. Two facts drive most of this skill: **DSM's btrfs on-disk format is newer than the21btrfs-progs DSM ships and diverges from mainline**, so stock tools report healthy volumes as22corrupt; and **DSM regenerates `/etc/fstab` and package state at boot**, so hand edits do not23survive.2425**Target versions** (September 2026):26- DSM 7.4.1-90080 - current release (7.4 GA was 90075, 2026-06-16)27- DSM 7.3 (released 2025-10-08) - Long-Term Support line, maintained to October 2027. Patch28 floor is **7.3.2-86009-3 or above**: `-2` carries the SA-26:06 fixes but not SA-26:0329 (CVE-2026-32746). Later `-4` builds exist30- DSM 7.2 - end of maintenance December 2025, yet it still received fixes in SA-26:06 (April31 2026). Treat continued patching as unreliable rather than as policy, and plan an upgrade32- Advisories: Synology-SA-26:03 (CVE-2026-32746, telnetd buffer overflow, CVSS 9.8, unauthenticated33 RCE - keep Telnet off), Synology-SA-26:06 (nine DSM CVEs, 2026-04-15), Synology-SA-26:11 (MailPlus Server)34- Userspace `btrfs` on the appliance is old (v4.0 on DSM 7.1 avoton). Check with `btrfs --version`35 before assuming a subcommand exists3637DSM 7.1.x and earlier do not appear in current advisories' fixed-version lists; treat them as38unpatched. That is a reason to plan an upgrade, not to run one on a unit with a broken volume.3940Verify the actual build before quoting any of this: `cat /etc.defaults/VERSION`.4142## When to use4344- Any task on a Synology NAS over SSH: shares, packages, services, users, storage pools45- A volume that will not mount, shows "Volume Crashed", or has gone read-only46- btrfs work on a Synology volume, including snapshots, subvolume flags, and offline recovery47- Deciding whether a DSM warning is real damage or a stock-tool false positive48- Planning disk replacement, RAID repair, or a migration between Synology units49- Hardening DSM: SSH, admin accounts, firewall, package exposure5051## When NOT to use5253- Generic Linux administration on a normal distro - use **debian-ubuntu**, **arch-btw**,54 **rhel-fedora**, **nixos-btw**55- Mainline btrfs on a normal Linux host - Synology's format divergences do not apply there56- Docker Compose authoring, image builds, registry work (Container Manager runs stock Docker) -57 use **docker** for the container content, this skill only for DSM-side paths and permissions58- Router, VLAN, DNS, or reverse proxy design around the NAS - use **networking**59- OPNsense/pfSense appliances - use **firewall-appliance**60- Kubernetes storage that happens to point at a Synology CSI target - use **kubernetes**61- Application security review or dependency scanning - use **security-audit**62- Localizing a live outage across an unknown stack - use **debug-triage** first, then come back here63- Proxmox, libvirt, or generic hypervisor work - use **virtualization**6465## AI Self-Check6667Before returning any DSM command, verify. When no SSH session exists yet - the common case when68answering a question - the appliance-state items convert into the first commands the user runs,69in this order, rather than being skipped:7071- [ ] DSM major version confirmed (`cat /etc.defaults/VERSION`) - DSM 6 and DSM 7 differ in72 service control, root login, and available tools73- [ ] No command from the hard-refusal list below74- [ ] Destructive storage operations run against a dm-snapshot overlay, not the live device75- [ ] Any `mount`, `mdadm`, `dmsetup`, or `btrfs` write path stated with its blast radius76- [ ] `cd /` before anything that unmounts `/volume1` (SSH sessions land in the home dir on it)77- [ ] Shell syntax is ash-compatible (`/bin/sh` is ash - no process substitution, no bashisms)78- [ ] Long-running jobs wrapped in `setsid nohup ... < /dev/null &`, not attached to the SSH session79- [ ] Binaries deployed to `/root/` or a package dir, never `/tmp` (`noexec`)80- [ ] Tool presence checked, not assumed - `lsof`, `fuser`, `mountpoint`, `modinfo` are absent81- [ ] Config edits target files DSM does not regenerate, or the regeneration is accounted for82- [ ] Backup or snapshot state verified before any repair, not after83- [ ] **Hidden state identified**: DSM version, model, package dependencies, mounted volumes, and prior repair attempts are made explicit before acting84- [ ] **Verification is real**: checks exercise the actual mount, service, or filesystem rather than reading a DSM banner85- [ ] **Routing overlap checked**: generic Linux, container, and network tasks are routed to the matching skill86- [ ] **Spec claims verified**: claims about DSM behavior are checked against the appliance or Synology's GPL kernel source, not recalled87- [ ] Cross-cutting agent hygiene applied - see `references/agent-hygiene.md`8889---9091## Hard refusals9293These are rules, not suggestions. Each one has destroyed a real volume.94951. **Never run `btrfs check --repair --init-extent-tree` on a Synology volume.** Observed96 behavior: full scan completes, then it writes a zero-entry node into the chunk tree, hits97 `BUG_ON` in `btrfs_try_chunk_alloc`, and leaves the filesystem permanently unmountable98 (`open_ctree failed`). There is no recovery from this short of restore or a data recovery lab.992. **Never `mount -o clear_cache` on a damaged volume.** Unconditional, because proving the free100 space tree is *not* the damaged structure is exactly what a damaged filesystem prevents.101 Clearing the tree requires freeing its own blocks, which requires the damaged block. The102 transaction aborts during mount and the filesystem then fails `open_ctree` entirely - strictly103 worse than before.1043. **No repair of any kind without a dm-snapshot overlay in place.** One named exception: when105 there is no usable backup, a single read-only mount attempt on the bare origin is permitted106 to reach evacuation, accepting that the mount replays the log tree and is therefore a write.107 Everything after that attempt goes through the overlay. See `references/btrfs-recovery.md`.1084. **Never click "Repair" in DSM on a crashed volume before identifying which layer failed.**109 The banner does not distinguish mdadm degradation from btrfs read-only. Repair at the wrong110 layer writes to every disk in the pool.1115. **Never run `mdadm --assemble --force` or `--create` as a first move on a suspect array.**112 Force-assembly with stale event counts silently picks a wrong parity generation.1136. **Never enable Telnet, including as an SSH workaround.** CVE-2026-32746 is an unauthenticated114 RCE in DSM's telnetd (CVSS 9.8). If SSH is unusable, use the console or DSM's UI.115116Confirm with the user before any RAID repair, volume delete, DSM update, disk removal, or117package uninstall. All of these are outward-facing or irreversible. When running unattended with118no one to ask, stop and report what needs approval - never proceed on a default.119120---121122## Environment facts123124Observed on a DS415+ running DSM 7.1.1 (avoton). The mechanisms hold broadly, but re-check any125row that a decision rests on - `scp -O`, in particular, follows from DSM's SFTP service being126off, which is a toggle rather than a fixed property.127128| Fact | Consequence |129|---|---|130| `/tmp` is `noexec` | Deploy binaries to `/root/` or a package dir |131| sftp subsystem disabled | `scp` needs `-O` (legacy protocol) or it fails with `subsystem request failed` |132| User homes live on the data volume (`/volume1/homes/<user>`) | If the volume is down, key auth breaks (`authorized_keys` unreadable) and login prints `Could not chdir to home directory` |133| Every SSH session lands in the home dir | `umount /volume1` fails with "target is busy". Always `cd /` first |134| `/bin/sh` is ash | No bashisms, no process substitution `<(...)` |135| Missing tools | `fuser`, `mountpoint`, `modinfo`, `lsof` absent - read `/proc` directly |136| Present tools | `python3`, `mdadm`, `dmsetup`, `losetup`, `truncate`, `blockdev`, `btrfs`, `systemctl`, `smartctl` |137| Root login | DSM 7 disables direct root SSH. Log in as an admin user and `sudo -i` |138| `/etc/fstab` is regenerated at boot | Hand-edited mount options do not persist |139| `syno_poweroff_task` | Exists on DSM 6, **not** on DSM 7.1+. Stop packages and services individually |140| Defaults live in `/etc.defaults/` | Edits there survive DSM updates better than `/etc/`; both can be overwritten by a major upgrade |141142Read `references/dsm-cli.md` for the command reference (packages, services, shares, users,143indexing, logs, SMART, notifications).144145---146147## Workflow148149### Step 1: Identify the appliance before anything else150151```sh152cat /etc.defaults/VERSION # productversion, buildnumber, majorversion153grep unique /etc.defaults/synoinfo.conf # platform, e.g. synology_avoton_415+154uname -a # kernel (3.10.x or 4.4.x on most models)155synopkg list --name # installed packages156```157158Model and build determine which GPL kernel source to read, which btrfs features exist, and159whether DSM 6 or DSM 7 semantics apply. Do not skip this step to save a round trip - almost160every later decision depends on it.161162### Step 2: Establish the storage picture163164```sh165cat /proc/mdstat # all md arrays, degraded state, resync progress166sudo vgs; sudo lvs # LVM layer167sudo btrfs filesystem show # filesystems and devices168sudo btrfs filesystem usage /volume1 # data vs metadata allocation169df -h /volume1170mount | grep volume # actual mount options in force171```172173The stack is `/dev/sdX3 -> mdN (RAID) -> vgN/volume_N -> cachedev_N (flashcache shim) -> btrfs`.174`md0` (system, ~8 GB) and `md1` (swap, ~2 GB) are RAID1 across **all** disks and are commonly175found degraded and ignored for months. Check them; repair is a plain `mdadm --add` and an 8 GB176RAID1 resync finishes in under a minute.177178Read `references/storage-and-backup.md` for SHR, disk replacement, compatibility database,179snapshots, and backup verification.180181### Step 3: Route on symptom182183| Symptom | Route |184|---|---|185| Volume mounts, DSM is healthy, routine task | `references/dsm-cli.md` |186| Degraded array, disk replaced, pool repair | `references/storage-and-backup.md` |187| Volume read-only, "Volume Crashed", will not mount | `references/gotchas.md`, then `references/storage-and-backup.md` section 4 **first** - the banner does not say which layer failed. Only once the array and LV are confirmed healthy does it become `references/btrfs-recovery.md` |188| Stock `btrfs` reports corruption but the volume mounts and reads fine | Likely a Synology format divergence, not damage. `references/btrfs-recovery.md`, section on private trees |189| Package keeps restarting after being disabled | Dependency resurrection - `references/dsm-cli.md` |190191### Step 4: Change with a stated blast radius192193Before any write: state what is affected, whether it is reversible, and what the rollback is.194For storage operations, the rollback is the overlay or a verified backup - nothing else counts.195196### Step 5: Verify against the runtime, not the UI197198DSM's banners lag reality and its health status is derived. Verify the thing itself:199200```sh201mount | grep /volume1 # actually mounted, and rw or ro?202sudo btrfs filesystem usage /volume1 # metadata headroom203sudo dmesg | tail -100 # kernel truth about the mount204synopkg status <Pkg> # package state as JSON205# damage survey: hours on a large share, so detach it and keep stderr206sudo setsid nohup sh -c 'find /volume1/<share> -size +0 > /dev/null' \207 > /root/survey.log 2>&1 < /dev/null &208```209210`find <dir>` alone performs readdir only and reads no inodes, so it reports a badly damaged211filesystem as clean. **`-type f` does not fix that**: `find` answers `-type` from the `d_type`212that `readdir` already returned and skips the `stat` entirely. Use a predicate that needs inode213data - `-size +0`, `-printf '%s\n'`, `-newer <ref>` - and let stderr through instead of214discarding it, since the EIO lines are the finding.215216---217218## Recovery first moves219220**Establish the goal before the sequence.** With a verified backup, the goal is repair. Without221one, the goal is **evacuation**: get the data off a read-only mount first, and treat repair as a222later, optional problem. Buying destination disks is cheaper than a recovery lab. Ask which223situation the user is in; do not assume.224225When a volume will not mount, do these in order. Details in `references/btrfs-recovery.md`;226read `references/gotchas.md` before the first write of any kind.227228**The branch that decides the order:** with a verified backup, build the overlay first and run229every mount attempt against it. Without one, take the named exception in hard refusal 3 - one230read-only mount attempt on the bare origin, accepting the log-replay write, because evacuation231beats purity. After that attempt, everything goes through the overlay.2322331. **Stop writing.** Do not repair, do not reboot repeatedly, do not let DSM auto-repair. Do not234 update DSM on a unit with a broken volume.2352. **Identify version and platform** (Step 1 above), and confirm the failure is above the RAID236 layer (`references/storage-and-backup.md` section 4).2373. **Try the cheap read-only mount options**, cheapest first, reading `dmesg` after each failure.238 `-o ro,no_quota_tree` alone recovers a common class of Synology mount failure. Note that a239 read-only mount still replays the log tree, which is a write - the reference explains when240 that forces the overlay first.2414. **If a read-only mount succeeds and there is no backup, evacuate now.** Repair decisions get242 easier once the data is elsewhere.2435. **Build a dm-snapshot overlay and fingerprint the origin** before any write attempt. The244 overlay and a mounted origin are mutually exclusive, so this is a branch point, not a step245 that stacks on top of step 3.2466. **Read the GPL kernel source** for the nearest published release family when the cheap options247 fail (the archive carries families such as `7.3-86009`, `7.2-72806`, `7.1.1-42962`, not every248 build; 7.4 has no drop yet):249 `https://archive.synology.com/download/ToolChain/Synology%20NAS%20GPL%20Source/<VER>-<BUILD>/`250 Extract `fs/btrfs/` and read `ctree.h`, `disk-io.c`, `super.c`, `usrquota.c`. It converts a251 black box into a documented system, and twenty minutes there beats hours of probing.2527. **Only then** consider offline tools, and only a patched btrfs-progs build, against the overlay.253254---255256## Packages and services257258```sh259synopkg list --name # installed packages (no --started on 7.1)260synopkg status <Pkg> # JSON status261synopkg stop|start <Pkg>262synopkg enable|disable <Pkg> # autostart marker in /var/packages/<Pkg>/enabled263systemctl stop pkgctl-<Pkg>.service # the underlying unit264```265266**Package dependencies resurrect packages.** `synopkg disable` is not enough if another267installed package declares the target in `install_dep_packages`:268269```sh270grep -h install_dep_packages /var/packages/*/INFO271```272273Synology Drive declares SynoFinder, so SynoFinder restarts within a minute of being disabled.274When the goal is "stop indexing this share", use the indexer's own control tool rather than275fighting the package manager - see `references/dsm-cli.md`.276277---278279## Security280281- Keep Telnet disabled (CVE-2026-32746, CVSS 9.8, unauthenticated RCE in DSM's telnetd)282- Disable the default `admin` account; use a named admin with 2FA283- Move SSH off 22 only as noise reduction, not as a control; restrict by firewall rule instead284- Do not expose DSM's web UI directly to the internet. QuickConnect and DDNS both widen exposure;285 prefer a VPN into the LAN286- Patch level matters more than version line: 7.3 LTS with current patches is a supported287 posture, 7.2.1 without them is not288- Snapshots are not backups until they are replicated off the unit. Immutable (WORM) snapshots,289 introduced in DSM 7.2, resist an admin-account compromise; ordinary snapshots do not290- Package exposure is the real attack surface: MailPlus, Photos, and Drive carry most advisories.291 Uninstall what is unused292293## Performance294295- Check `btrfs filesystem usage` metadata headroom before blaming disks. A metadata-full btrfs296 behaves like a failing filesystem while every disk is healthy297- Indexing (`synoindexd`, `synoelasticd`) and Photos face-recognition dominate CPU on small units;298 pause per share rather than disabling packages299- `synoindexd` and snapshot deletion both spike I/O; do not benchmark during either300- SHR/RAID5 resync and btrfs balance are both throughput killers - check `/proc/mdstat` before301 investigating "slow NAS" complaints302303---304305## Reference Files306307- `references/dsm-cli.md` - DSM command surface: packages, services, shares, users, network,308 indexing, logs, notifications, SMART, DSM API. Read for any routine administration task.309- `references/storage-and-backup.md` - SHR and the RAID/LVM/btrfs stack, disk replacement,310 drive compatibility database, snapshots, Hyper Backup, restore verification. Read when the311 task touches disks, pools, snapshots, or backups.312- `references/btrfs-recovery.md` - Synology's btrfs divergences (private root flags, private313 trees, private mount options, the usrquota mount trap), dm-snapshot overlay procedure, mount314 escalation ladder, tool matrix, btrfs-progs bugs, subvolume flag ioctls. Read when a volume315 will not mount or when stock tools report corruption.316- `references/gotchas.md` - footguns, diagnostic hygiene, ash shell traps, behavior of a317 damaged volume. Read before any repair attempt.318319## Output Contract320321See `references/output-contract.md` for the full contract.322323- **Skill name:** SYNOLOGY-DSM324- **Deliverable bucket:** `audits`325- **Mode:** conditional. When invoked to **analyze, review, audit, or improve** an existing326 system (health review, recovery post-mortem, hardening audit), emit the full contract and327 write the deliverable to `docs/local/audits/synology-dsm/<YYYY-MM-DD>-<slug>.md`. When invoked328 to answer a question, run a routine command, or explain behavior, respond freely.329- **Severity scale:** `P0 | P1 | P2 | P3 | info` (see shared contract).330331## Related Skills332333- **docker** - Container Manager on DSM is stock Docker plus a GUI. That skill owns the compose334 file and image; this one owns `/volume1` paths, DSM permissions, and package lifecycle.335- **networking** - DNS, VPN, reverse proxy, and VLAN work around the NAS. This skill stops at336 the appliance's own interfaces.337- **debug-triage** - localizes an unknown failing layer during a live incident. Use it first when338 "the NAS is down" could be network, power, or storage; this skill takes over once it is DSM.339- **debian-ubuntu** - DSM 7 is Debian-derived, so some package intuitions carry over, but DSM's340 own package manager and config regeneration do not behave like apt.341- **security-audit** - reviews application code and dependencies. This skill covers appliance342 hardening and DSM-specific exposure.343- **virtualization** - Virtual Machine Manager on DSM runs QEMU/KVM underneath; that skill covers344 the guest and hypervisor concepts, this one the DSM package around them.345346## Rules3473481. **Identify the DSM version and platform before advising anything.** Behavior differs across349 DSM 6, 7.1, 7.2, and 7.4.3502. **No repair without an overlay.** Any operation that can write to a damaged volume runs351 against a dm-snapshot overlay first.3523. **Never `--init-extent-tree`, never `clear_cache` on a damaged volume.** Both destroy volumes,353 and the `clear_cache` ban is unconditional.3544. **Read Synology's GPL kernel source for the exact build before deep recovery work.** It is355 authoritative documentation of the on-disk format and nothing else is.3565. **Treat mainline-tool corruption reports as unverified.** Synology's private root flags and357 trees are rejected by mainline's tree-checker. Confirm damage against the DSM kernel's own358 behavior before acting on a stock-tool verdict.3596. **Damage surveys need an inode-reading predicate.** `find` bare or with `-type f` reads no360 inodes and reports a corrupt volume as clean. Use `-size +0` or `-printf '%s\n'`.3617. **Confirm before destructive or outward-facing actions**: RAID repair, volume delete, disk362 removal, package uninstall, DSM update, reboot of a production unit.3638. **Detach long-running jobs.** `setsid nohup ... < /dev/null &`, with the logic in a script364 file so `pkill -f` patterns cannot match your own command line.3659. **Suspect the diagnostic first when it returns nothing.** Empty output on a damaged system is366 usually a broken check, not a clean result.36710. **Snapshots are not backups.** Verify a restore path off the unit before touching storage.
Run npx skillmds@latest add iuliandita/synology-dsm in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
· Administer Synology DSM over SSH: volumes, btrfs, packages, snapshots, crash recovery. Triggers: 'synology', 'dsm', 'diskstation', '/volume1', 'synopkg', 'volume crashed'. Not for desktop Linux distros or their btrfs setups. It is listed under Coding & Dev Tools on SkillMD.
This skill has not completed SkillMD's automated safety review yet. Independent scanners report: SkillSpector: CAUTION, Skill Scanner: WARNING. Capability flags: makes network calls. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free. This skill is licensed under MIT.
iuliandita (@iuliandita) published this skill. Their other Agent Skills are listed on their SkillMD profile.