· 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: · 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.4license: MIT5---67# Synology DSM: Administration and btrfs Recovery89Operate Synology NAS appliances over SSH: package and service control, storage stack10inspection, snapshots and backups, and recovery of btrfs volumes that will not mount.1112DSM is a Linux appliance with a heavily modified btrfs and a userspace that regenerates its own13config. Two facts drive most of this skill: **DSM's btrfs on-disk format is newer than the14btrfs-progs DSM ships and diverges from mainline**, so stock tools report healthy volumes as15corrupt; and **DSM regenerates `/etc/fstab` and package state at boot**, so hand edits do not16survive.1718**Target versions** (September 2026):19- DSM 7.4.1-90080 - current release (7.4 GA was 90075, 2026-06-16)20- DSM 7.3 (released 2025-10-08) - Long-Term Support line, maintained to October 2027. Patch21 floor is **7.3.2-86009-3 or above**: `-2` carries the SA-26:06 fixes but not SA-26:0322 (CVE-2026-32746). Later `-4` builds exist23- DSM 7.2 - end of maintenance December 2025, yet it still received fixes in SA-26:06 (April24 2026). Treat continued patching as unreliable rather than as policy, and plan an upgrade25- Advisories: Synology-SA-26:03 (CVE-2026-32746, telnetd buffer overflow, CVSS 9.8, unauthenticated26 RCE - keep Telnet off), Synology-SA-26:06 (nine DSM CVEs, 2026-04-15), Synology-SA-26:11 (MailPlus Server)27- Userspace `btrfs` on the appliance is old (v4.0 on DSM 7.1 avoton). Check with `btrfs --version`28 before assuming a subcommand exists2930DSM 7.1.x and earlier do not appear in current advisories' fixed-version lists; treat them as31unpatched. That is a reason to plan an upgrade, not to run one on a unit with a broken volume.3233Verify the actual build before quoting any of this: `cat /etc.defaults/VERSION`.3435## When to use3637- Any task on a Synology NAS over SSH: shares, packages, services, users, storage pools38- A volume that will not mount, shows "Volume Crashed", or has gone read-only39- btrfs work on a Synology volume, including snapshots, subvolume flags, and offline recovery40- Deciding whether a DSM warning is real damage or a stock-tool false positive41- Planning disk replacement, RAID repair, or a migration between Synology units42- Hardening DSM: SSH, admin accounts, firewall, package exposure4344## When NOT to use4546- Generic Linux administration on a normal distro - use **debian-ubuntu**, **arch-btw**,47 **rhel-fedora**, **nixos-btw**48- Mainline btrfs on a normal Linux host - Synology's format divergences do not apply there49- Docker Compose authoring, image builds, registry work (Container Manager runs stock Docker) -50 use **docker** for the container content, this skill only for DSM-side paths and permissions51- Router, VLAN, DNS, or reverse proxy design around the NAS - use **networking**52- OPNsense/pfSense appliances - use **firewall-appliance**53- Kubernetes storage that happens to point at a Synology CSI target - use **kubernetes**54- Application security review or dependency scanning - use **security-audit**55- Localizing a live outage across an unknown stack - use **debug-triage** first, then come back here56- Proxmox, libvirt, or generic hypervisor work - use **virtualization**5758## AI Self-Check5960Before returning any DSM command, verify. When no SSH session exists yet - the common case when61answering a question - the appliance-state items convert into the first commands the user runs,62in this order, rather than being skipped:6364- [ ] DSM major version confirmed (`cat /etc.defaults/VERSION`) - DSM 6 and DSM 7 differ in65 service control, root login, and available tools66- [ ] No command from the hard-refusal list below67- [ ] Destructive storage operations run against a dm-snapshot overlay, not the live device68- [ ] Any `mount`, `mdadm`, `dmsetup`, or `btrfs` write path stated with its blast radius69- [ ] `cd /` before anything that unmounts `/volume1` (SSH sessions land in the home dir on it)70- [ ] Shell syntax is ash-compatible (`/bin/sh` is ash - no process substitution, no bashisms)71- [ ] Long-running jobs wrapped in `setsid nohup ... < /dev/null &`, not attached to the SSH session72- [ ] Binaries deployed to `/root/` or a package dir, never `/tmp` (`noexec`)73- [ ] Tool presence checked, not assumed - `lsof`, `fuser`, `mountpoint`, `modinfo` are absent74- [ ] Config edits target files DSM does not regenerate, or the regeneration is accounted for75- [ ] Backup or snapshot state verified before any repair, not after76- [ ] **Hidden state identified**: DSM version, model, package dependencies, mounted volumes, and prior repair attempts are made explicit before acting77- [ ] **Verification is real**: checks exercise the actual mount, service, or filesystem rather than reading a DSM banner78- [ ] **Routing overlap checked**: generic Linux, container, and network tasks are routed to the matching skill79- [ ] **Spec claims verified**: claims about DSM behavior are checked against the appliance or Synology's GPL kernel source, not recalled80- [ ] Cross-cutting agent hygiene applied - see `references/agent-hygiene.md`8182---8384## Hard refusals8586These are rules, not suggestions. Each one has destroyed a real volume.87881. **Never run `btrfs check --repair --init-extent-tree` on a Synology volume.** Observed89 behavior: full scan completes, then it writes a zero-entry node into the chunk tree, hits90 `BUG_ON` in `btrfs_try_chunk_alloc`, and leaves the filesystem permanently unmountable91 (`open_ctree failed`). There is no recovery from this short of restore or a data recovery lab.922. **Never `mount -o clear_cache` on a damaged volume.** Unconditional, because proving the free93 space tree is *not* the damaged structure is exactly what a damaged filesystem prevents.94 Clearing the tree requires freeing its own blocks, which requires the damaged block. The95 transaction aborts during mount and the filesystem then fails `open_ctree` entirely - strictly96 worse than before.973. **No repair of any kind without a dm-snapshot overlay in place.** One named exception: when98 there is no usable backup, a single read-only mount attempt on the bare origin is permitted99 to reach evacuation, accepting that the mount replays the log tree and is therefore a write.100 Everything after that attempt goes through the overlay. See `references/btrfs-recovery.md`.1014. **Never click "Repair" in DSM on a crashed volume before identifying which layer failed.**102 The banner does not distinguish mdadm degradation from btrfs read-only. Repair at the wrong103 layer writes to every disk in the pool.1045. **Never run `mdadm --assemble --force` or `--create` as a first move on a suspect array.**105 Force-assembly with stale event counts silently picks a wrong parity generation.1066. **Never enable Telnet, including as an SSH workaround.** CVE-2026-32746 is an unauthenticated107 RCE in DSM's telnetd (CVSS 9.8). If SSH is unusable, use the console or DSM's UI.108109Confirm with the user before any RAID repair, volume delete, DSM update, disk removal, or110package uninstall. All of these are outward-facing or irreversible. When running unattended with111no one to ask, stop and report what needs approval - never proceed on a default.112113---114115## Environment facts116117Observed on a DS415+ running DSM 7.1.1 (avoton). The mechanisms hold broadly, but re-check any118row that a decision rests on - `scp -O`, in particular, follows from DSM's SFTP service being119off, which is a toggle rather than a fixed property.120121| Fact | Consequence |122|---|---|123| `/tmp` is `noexec` | Deploy binaries to `/root/` or a package dir |124| sftp subsystem disabled | `scp` needs `-O` (legacy protocol) or it fails with `subsystem request failed` |125| 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` |126| Every SSH session lands in the home dir | `umount /volume1` fails with "target is busy". Always `cd /` first |127| `/bin/sh` is ash | No bashisms, no process substitution `<(...)` |128| Missing tools | `fuser`, `mountpoint`, `modinfo`, `lsof` absent - read `/proc` directly |129| Present tools | `python3`, `mdadm`, `dmsetup`, `losetup`, `truncate`, `blockdev`, `btrfs`, `systemctl`, `smartctl` |130| Root login | DSM 7 disables direct root SSH. Log in as an admin user and `sudo -i` |131| `/etc/fstab` is regenerated at boot | Hand-edited mount options do not persist |132| `syno_poweroff_task` | Exists on DSM 6, **not** on DSM 7.1+. Stop packages and services individually |133| Defaults live in `/etc.defaults/` | Edits there survive DSM updates better than `/etc/`; both can be overwritten by a major upgrade |134135Read `references/dsm-cli.md` for the command reference (packages, services, shares, users,136indexing, logs, SMART, notifications).137138---139140## Workflow141142### Step 1: Identify the appliance before anything else143144```sh145cat /etc.defaults/VERSION # productversion, buildnumber, majorversion146grep unique /etc.defaults/synoinfo.conf # platform, e.g. synology_avoton_415+147uname -a # kernel (3.10.x or 4.4.x on most models)148synopkg list --name # installed packages149```150151Model and build determine which GPL kernel source to read, which btrfs features exist, and152whether DSM 6 or DSM 7 semantics apply. Do not skip this step to save a round trip - almost153every later decision depends on it.154155### Step 2: Establish the storage picture156157```sh158cat /proc/mdstat # all md arrays, degraded state, resync progress159sudo vgs; sudo lvs # LVM layer160sudo btrfs filesystem show # filesystems and devices161sudo btrfs filesystem usage /volume1 # data vs metadata allocation162df -h /volume1163mount | grep volume # actual mount options in force164```165166The stack is `/dev/sdX3 -> mdN (RAID) -> vgN/volume_N -> cachedev_N (flashcache shim) -> btrfs`.167`md0` (system, ~8 GB) and `md1` (swap, ~2 GB) are RAID1 across **all** disks and are commonly168found degraded and ignored for months. Check them; repair is a plain `mdadm --add` and an 8 GB169RAID1 resync finishes in under a minute.170171Read `references/storage-and-backup.md` for SHR, disk replacement, compatibility database,172snapshots, and backup verification.173174### Step 3: Route on symptom175176| Symptom | Route |177|---|---|178| Volume mounts, DSM is healthy, routine task | `references/dsm-cli.md` |179| Degraded array, disk replaced, pool repair | `references/storage-and-backup.md` |180| 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` |181| 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 |182| Package keeps restarting after being disabled | Dependency resurrection - `references/dsm-cli.md` |183184### Step 4: Change with a stated blast radius185186Before any write: state what is affected, whether it is reversible, and what the rollback is.187For storage operations, the rollback is the overlay or a verified backup - nothing else counts.188189### Step 5: Verify against the runtime, not the UI190191DSM's banners lag reality and its health status is derived. Verify the thing itself:192193```sh194mount | grep /volume1 # actually mounted, and rw or ro?195sudo btrfs filesystem usage /volume1 # metadata headroom196sudo dmesg | tail -100 # kernel truth about the mount197synopkg status <Pkg> # package state as JSON198# damage survey: hours on a large share, so detach it and keep stderr199sudo setsid nohup sh -c 'find /volume1/<share> -size +0 > /dev/null' \200 > /root/survey.log 2>&1 < /dev/null &201```202203`find <dir>` alone performs readdir only and reads no inodes, so it reports a badly damaged204filesystem as clean. **`-type f` does not fix that**: `find` answers `-type` from the `d_type`205that `readdir` already returned and skips the `stat` entirely. Use a predicate that needs inode206data - `-size +0`, `-printf '%s\n'`, `-newer <ref>` - and let stderr through instead of207discarding it, since the EIO lines are the finding.208209---210211## Recovery first moves212213**Establish the goal before the sequence.** With a verified backup, the goal is repair. Without214one, the goal is **evacuation**: get the data off a read-only mount first, and treat repair as a215later, optional problem. Buying destination disks is cheaper than a recovery lab. Ask which216situation the user is in; do not assume.217218When a volume will not mount, do these in order. Details in `references/btrfs-recovery.md`;219read `references/gotchas.md` before the first write of any kind.220221**The branch that decides the order:** with a verified backup, build the overlay first and run222every mount attempt against it. Without one, take the named exception in hard refusal 3 - one223read-only mount attempt on the bare origin, accepting the log-replay write, because evacuation224beats purity. After that attempt, everything goes through the overlay.2252261. **Stop writing.** Do not repair, do not reboot repeatedly, do not let DSM auto-repair. Do not227 update DSM on a unit with a broken volume.2282. **Identify version and platform** (Step 1 above), and confirm the failure is above the RAID229 layer (`references/storage-and-backup.md` section 4).2303. **Try the cheap read-only mount options**, cheapest first, reading `dmesg` after each failure.231 `-o ro,no_quota_tree` alone recovers a common class of Synology mount failure. Note that a232 read-only mount still replays the log tree, which is a write - the reference explains when233 that forces the overlay first.2344. **If a read-only mount succeeds and there is no backup, evacuate now.** Repair decisions get235 easier once the data is elsewhere.2365. **Build a dm-snapshot overlay and fingerprint the origin** before any write attempt. The237 overlay and a mounted origin are mutually exclusive, so this is a branch point, not a step238 that stacks on top of step 3.2396. **Read the GPL kernel source** for the nearest published release family when the cheap options240 fail (the archive carries families such as `7.3-86009`, `7.2-72806`, `7.1.1-42962`, not every241 build; 7.4 has no drop yet):242 `https://archive.synology.com/download/ToolChain/Synology%20NAS%20GPL%20Source/<VER>-<BUILD>/`243 Extract `fs/btrfs/` and read `ctree.h`, `disk-io.c`, `super.c`, `usrquota.c`. It converts a244 black box into a documented system, and twenty minutes there beats hours of probing.2457. **Only then** consider offline tools, and only a patched btrfs-progs build, against the overlay.246247---248249## Packages and services250251```sh252synopkg list --name # installed packages (no --started on 7.1)253synopkg status <Pkg> # JSON status254synopkg stop|start <Pkg>255synopkg enable|disable <Pkg> # autostart marker in /var/packages/<Pkg>/enabled256systemctl stop pkgctl-<Pkg>.service # the underlying unit257```258259**Package dependencies resurrect packages.** `synopkg disable` is not enough if another260installed package declares the target in `install_dep_packages`:261262```sh263grep -h install_dep_packages /var/packages/*/INFO264```265266Synology Drive declares SynoFinder, so SynoFinder restarts within a minute of being disabled.267When the goal is "stop indexing this share", use the indexer's own control tool rather than268fighting the package manager - see `references/dsm-cli.md`.269270---271272## Security273274- Keep Telnet disabled (CVE-2026-32746, CVSS 9.8, unauthenticated RCE in DSM's telnetd)275- Disable the default `admin` account; use a named admin with 2FA276- Move SSH off 22 only as noise reduction, not as a control; restrict by firewall rule instead277- Do not expose DSM's web UI directly to the internet. QuickConnect and DDNS both widen exposure;278 prefer a VPN into the LAN279- Patch level matters more than version line: 7.3 LTS with current patches is a supported280 posture, 7.2.1 without them is not281- Snapshots are not backups until they are replicated off the unit. Immutable (WORM) snapshots,282 introduced in DSM 7.2, resist an admin-account compromise; ordinary snapshots do not283- Package exposure is the real attack surface: MailPlus, Photos, and Drive carry most advisories.284 Uninstall what is unused285286## Performance287288- Check `btrfs filesystem usage` metadata headroom before blaming disks. A metadata-full btrfs289 behaves like a failing filesystem while every disk is healthy290- Indexing (`synoindexd`, `synoelasticd`) and Photos face-recognition dominate CPU on small units;291 pause per share rather than disabling packages292- `synoindexd` and snapshot deletion both spike I/O; do not benchmark during either293- SHR/RAID5 resync and btrfs balance are both throughput killers - check `/proc/mdstat` before294 investigating "slow NAS" complaints295296---297298## Reference Files299300- `references/dsm-cli.md` - DSM command surface: packages, services, shares, users, network,301 indexing, logs, notifications, SMART, DSM API. Read for any routine administration task.302- `references/storage-and-backup.md` - SHR and the RAID/LVM/btrfs stack, disk replacement,303 drive compatibility database, snapshots, Hyper Backup, restore verification. Read when the304 task touches disks, pools, snapshots, or backups.305- `references/btrfs-recovery.md` - Synology's btrfs divergences (private root flags, private306 trees, private mount options, the usrquota mount trap), dm-snapshot overlay procedure, mount307 escalation ladder, tool matrix, btrfs-progs bugs, subvolume flag ioctls. Read when a volume308 will not mount or when stock tools report corruption.309- `references/gotchas.md` - footguns, diagnostic hygiene, ash shell traps, behavior of a310 damaged volume. Read before any repair attempt.311312## Output Contract313314See `references/output-contract.md` for the full contract.315316- **Skill name:** SYNOLOGY-DSM317- **Deliverable bucket:** `audits`318- **Mode:** conditional. When invoked to **analyze, review, audit, or improve** an existing319 system (health review, recovery post-mortem, hardening audit), emit the full contract and320 write the deliverable to `docs/local/audits/synology-dsm/<YYYY-MM-DD>-<slug>.md`. When invoked321 to answer a question, run a routine command, or explain behavior, respond freely.322- **Severity scale:** `P0 | P1 | P2 | P3 | info` (see shared contract).323324## Related Skills325326- **docker** - Container Manager on DSM is stock Docker plus a GUI. That skill owns the compose327 file and image; this one owns `/volume1` paths, DSM permissions, and package lifecycle.328- **networking** - DNS, VPN, reverse proxy, and VLAN work around the NAS. This skill stops at329 the appliance's own interfaces.330- **debug-triage** - localizes an unknown failing layer during a live incident. Use it first when331 "the NAS is down" could be network, power, or storage; this skill takes over once it is DSM.332- **debian-ubuntu** - DSM 7 is Debian-derived, so some package intuitions carry over, but DSM's333 own package manager and config regeneration do not behave like apt.334- **security-audit** - reviews application code and dependencies. This skill covers appliance335 hardening and DSM-specific exposure.336- **virtualization** - Virtual Machine Manager on DSM runs QEMU/KVM underneath; that skill covers337 the guest and hypervisor concepts, this one the DSM package around them.338339## Rules3403411. **Identify the DSM version and platform before advising anything.** Behavior differs across342 DSM 6, 7.1, 7.2, and 7.4.3432. **No repair without an overlay.** Any operation that can write to a damaged volume runs344 against a dm-snapshot overlay first.3453. **Never `--init-extent-tree`, never `clear_cache` on a damaged volume.** Both destroy volumes,346 and the `clear_cache` ban is unconditional.3474. **Read Synology's GPL kernel source for the exact build before deep recovery work.** It is348 authoritative documentation of the on-disk format and nothing else is.3495. **Treat mainline-tool corruption reports as unverified.** Synology's private root flags and350 trees are rejected by mainline's tree-checker. Confirm damage against the DSM kernel's own351 behavior before acting on a stock-tool verdict.3526. **Damage surveys need an inode-reading predicate.** `find` bare or with `-type f` reads no353 inodes and reports a corrupt volume as clean. Use `-size +0` or `-printf '%s\n'`.3547. **Confirm before destructive or outward-facing actions**: RAID repair, volume delete, disk355 removal, package uninstall, DSM update, reboot of a production unit.3568. **Detach long-running jobs.** `setsid nohup ... < /dev/null &`, with the logic in a script357 file so `pkill -f` patterns cannot match your own command line.3589. **Suspect the diagnostic first when it returns nothing.** Empty output on a damaged system is359 usually a broken check, not a clean result.36010. **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. 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.