Three body

From joelhooks/joelclaw · View interactive version

Three body is an AI agent skill from the GitHub repository joelhooks/joelclaw. Verify and troubleshoot ASUSTOR NAS access, SMB/NFS mounts, and filesystem health. Use the private operator map for host, share, and account names.

How to use this skill

Skill file

Three Body

For private addresses, accounts, ports, and host roles, see .brain/resources/operator-network-context.svx in the private dark-wizard repo and the tailnet-topology skill. Replace angle-bracket placeholders with the configured values before running commands.

Use this for ASUSTOR NAS operations. Use system-architecture for Central service changes and tailnet-topology for SSH and route verification.

Access

Default non-interactive SSH check:

ssh -o BatchMode=yes -o ConnectTimeout=8 <ssh-user>@<nas> 'hostname && whoami && pwd && uptime'

Use the SSH target and administration URL from private configuration. Verify the LAN and tailnet addresses independently; a working SSH alias is not evidence of a valid NFS route.

Do not print SSH identity paths, private keys, tokens, raw serial numbers, or host IDs.

Host Facts

Verified from /etc/nas.conf and live SSH on 2026-06-17:

Remote ADM is not a normal full Linux distro. Expect missing tools like rg, hostnamectl, findmnt, and sometimes lsblk. Prefer grep, awk, sed, ps w, netstat, df, mount, /proc/mdstat, and ASUSTOR's /usr/builtin/* paths.

Storage Map

Current storage receipt from 2026-06-17:

Healthy mdstat shape observed:

md1 ... raid5 ... [8/8] [UUUUUUUU]
md2 ... raid1 ... [2/2] [UU]
md0 ... raid1 ... [8/8] [UUUUUUUU]

Use these read-only checks before blaming ASUSTOR itself:

ssh <ssh-user>@<nas> 'uptime; cat /proc/mdstat; df -hT; mount | grep -Ei "volume|share|btrfs|nfs|smb|cifs"'
ssh <ssh-user>@<nas> 'dmesg 2>/dev/null | tail -n 250 | grep -Ei "error|fail|reset|timeout|btrfs|md[0-9]|raid|sata|nvme|nfs|smb|cifs|eth|link" | tail -n 80'

For SMART checks, smartctl exists at /usr/builtin/sbin/smartctl, but disk-level inspection likely needs root.

Shares And Services

SMB and NFS were both running on 2026-06-17:

Important config paths:

/usr/builtin/etc/samba/smb.conf
/usr/builtin/etc/samba/asustorsmb.conf
/etc/exports
/etc/default/exports
/usr/builtin/etc/init.d/S41nfs
/usr/builtin/etc/init.d/S47smbd

Read current protocol state:

ssh <ssh-user>@<nas> 'ps w | grep -Ei "[s]mb|[n]mb|[n]fs|[t]ailscale|[d]ocker" || true'
ssh <ssh-user>@<nas> 'netstat -tulpn 2>/dev/null | grep -E ":(22|111|139|445|2049)[[:space:]]" || true'
showmount -e <nas>

Look up the actual share names and permitted accounts in the private operator map and Samba config. Do not assume the SMB share and the NFS export use the same path.

NFS Gotchas

Current NFS exports are mostly LAN-scoped, not tailnet-scoped. If a client mounts via MagicDNS/Tailscale IP, the server may see the client as a 100.x tailnet source that does not match exports like <private-cidr>.

Current exports include:

Historical helper scripts in ~joel/flagg-nfs-*.sh encode an important ASUSTOR/NFS gotcha: broad subnet entries can effectively win over later host-specific entries. Those scripts remove/reinsert the host rule before the broad rule, back up /etc/exports, run /usr/builtin/sbin/exportfs -ra, and sometimes restart NFS with an ASUSTOR-safe PATH.

Useful identity facts from those scripts:

Do not run the helper scripts or edit /etc/exports without explicit authorization. If asked to change NFS exports:

  1. Inspect /etc/exports and exportfs -v.
  2. Copy /etc/exports to a timestamped backup.
  3. Make the smallest change.
  4. Run /usr/builtin/sbin/exportfs -ra.
  5. Verify with showmount -e NAS from the client.
  6. If restarting NFS, use:
PATH=/usr/builtin/sbin:/usr/builtin/bin:/usr/sbin:/usr/bin:/sbin:/bin /usr/builtin/etc/init.d/S41nfs restart

central host LAN Mount Contract

Shelf-local rule: for devices physically on the same shelf/LAN, mounted storage should be LAN-shaped by default. Use Tailscale/MagicDNS for remote access, admin/control-plane access, and emergency reachability; do not use it as the default data path for stable high-throughput NAS mounts unless explicitly configured and tested that way.

For central host Central, the repo-managed NFS mount contract is:

Media locality rule: central host is physically adjacent to <nas> on proved 10GbE. Media transcription, analysis, and editing jobs should read source audio/video directly from <media-mount> and write derived artifacts there. Do not stage/copy large media through SSH, /tmp, or local SSD merely because a tool accepts only local-looking paths. Fix or mount the media export instead. Small claim-check metadata may remain local; raw media stays authoritative on NAS.

Do not use <nas>:/volume... for persistent NFS mounts on central host. On 2026-06-17, <nas> resolved to the Tailscale IP:

<nas> -> <tailnet-host> -> <tailnet-ip>
route to <tailnet-ip> -> utun1
route to <private-ip> -> en0

The previous LaunchDaemon logs showed repeated NFS Permission denied while mounting <nas>:<nas-nvme-export>; that is consistent with accidentally mounting over Tailscale while the NFS exports allow LAN clients.

Mount scripts live in infra/central/scripts/:

./infra/central/scripts/mount-nas.sh status
sudo ./infra/central/scripts/mount-nas.sh mount
./infra/central/scripts/verify-nas.sh --write-probe --benchmark-mib 64

A healthy live mount does not prove boot durability. Regression receipt 2026-07-09: both mounts were live and tuned on central host while /Library/LaunchDaemons/com.joelclaw.central.nas-mounts.plist was missing and launchctl print system/com.joelclaw.central.nas-mounts returned "Could not find service" — a reboot would have silently dropped both mounts. Check durability explicitly:

ls -l /Library/LaunchDaemons/com.joelclaw.central.nas-mounts.plist
sudo launchctl print system/com.joelclaw.central.nas-mounts | head -5

If the plist is missing, reinstall idempotently from the service checkout:

sudo /Users/Shared/joelclaw/src/joelclaw/infra/central/scripts/install-nas-mounts.sh --bootstrap

verify-nas.sh hard-fails on a missing plist; preflight.sh warns.

No sudo is needed to verify any of this. verify-nas.sh runs fully green unprivileged: the plist is world-readable, and daemon liveness is proved by log freshness — the daemon fires every 300s and emits one healthy-run receipt to /Users/Shared/joelclaw/logs/central/nas-mounts.out.log, so a recent mtime means loaded without launchctl print on the root-only system domain. Reserve sudo for install/reinstall, manual mount-nas.sh mount|unmount (resvport needs root), and sync-service-checkout.sh; see infra/central/README.md "Sudo discipline" for the full split and the optional read-only sudoers line.

If the LAN IP path says No route to host, do not fall back to Tailscale silently. Fix LAN reachability or the ASUSTOR/network rule first.

On macOS, No route to host for a same-subnet LAN service can be Local Network privacy for the invoking app, even when ARP and routing look correct. On 2026-06-17, accepting the GUI Local Network prompt let nc -vz -G 3 <private-ip> 2049 and showmount -e <private-ip> succeed. If an agent shell is blocked but Terminal works, use Terminal for the privileged repair or grant Local Network permission to the app hosting the agent.

Allow-list path on macOS:

open "x-apple.systempreferences:com.apple.preference.security?Privacy_LocalNetwork"

Then enable the app that runs the LAN probe, such as Terminal, iTerm, or Codex. tccutil can reset privacy decisions, but it does not grant Local Network permission from the CLI. Treat the GUI toggle/prompt as the durable allow-list.

Successful central host repair receipt from 2026-06-17:

MTU/NFS tuning receipt from 2026-06-17:

satellite host NAS mount receipt from 2026-06-22 pre-install:

Next MTU steps:

  1. Keep central host Ethernet at MTU 8192 unless new errors appear; this is the proved practical jumbo ceiling for the current path.
  2. Confirm the ASUSTOR eth2 interface still reports MTU 9000 and 10000Mb/s full duplex.
  3. Inspect the switch path if full 9000-byte jumbo is still desired; something between central host and <nas> appears capped around 8192-byte IP packets.
  4. If full 9000 passes later, update NAS_EXPECTED_MTU to 9000, remount, run verify-nas.sh --write-probe --benchmark-mib 1024, then hard-reboot central host and prove no-login restore.
  5. If full 9000 still fails, keep MTU 8192 and treat the 512K NFS transfer tuning as the current 10GbE-safe performance posture.

Mount Debugging

Do not treat Finder sidebar mounts or macOS Login Items as reliable infrastructure.

When Joel reports disappearing drives, split the problem:

  1. NAS health: uptime, /proc/mdstat, df, dmesg, SMART, ADM logs.
  2. Network path: wired vs Wi-Fi, DHCP/IP drift, Tailscale vs LAN source address, 10G link state.
  3. Protocol: SMB vs NFS, export/client allowlist, UID mapping, stale mount options.
  4. macOS mount mechanism: Finder/manual mount vs autofs or launchd.

Local checks:

tailscale status | grep -i <nas> || true
mount | grep -Ei '<nas>|smbfs|nfs|100\.67\.156\.41|192\.168\.1\.163'
showmount -e <nas>
showmount -e <private-ip>
smbutil view //<ssh-user>@<nas>

If NFS is being used from macOS, verify whether <nas> resolves to a LAN IP or a Tailscale IP. If the export only allows <private-cidr>, a tailnet-sourced NFS mount is suspect even when showmount lists exports.

For stable mounted access, prefer one deterministic path while debugging:

Safety

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.