You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Make remote wipe script work on NixOS hostsΒ #56443
Web browser and operating system: N/A (affects NixOS hosts)
π₯ Actual behavior
Linux remote wipe (ee/server/service/embedded_scripts/linux_wipe.sh) deletes the traditional FHS system directories (/bin, /sbin, /usr, /lib, /opt, /etc, /var, /srv). NixOS doesn't follow FHS: system software and configuration live in /nix/store, which the wipe script never touches. On NixOS hosts, the store is left intact after a wipe. /nix/store is also typically a read-only bind mount, so a plain rm -rf would fail even if it were included.
π οΈ Expected behavior
On hosts where /nix/store exists, the wipe script also deletes it (last, after the other system directories). If /nix/store is a read-only mount, the script remounts it read-write first, and skips it with an error if the remount fails or can't be confirmed. The Linux wipe section in articles/lock-wipe-hosts.md documents this behavior and its limitations.
π§βπ» Steps to reproduce
These steps:
Have been confirmed to consistently lead to reproduction in multiple Fleet instances.
Describe the workflow that led to the error, but have not yet been reproduced in multiple Fleet instances.
Enroll a NixOS host in Fleet (Premium).
Wipe the host from the host details page.
Inspect the disk after the host halts: /nix/store contents remain.
Test plan
Test wiping a NixOS VM/host.
Test wiping a non-NixOS host (e.g. Ubuntu) still works.
changed the title [-]Linux remote wipe doesn't delete the Nix store on NixOS hosts[/-][+]Make remote wipe script work on NixOS hosts[/+]on Oct 23, 2026
QA Fail β 2/4 checks on rc-minor-fleet-v4.95.0 (b86f946). Wiped a NixOS 26.05 host and an Ubuntu 24.04 host from Fleet, then booted them again to see what was left.
#
Type
Case
Result
1
Core
Wipe a NixOS host (/nix/store read-only bind mount)
β Host halts and Fleet shows Wiped, but nothing was deleted: after a power cycle it boots normally with /home, /etc and /nix/store intact and comes back Online
2
Core
/nix/store remount + delete
β awk: command not found β "could not inspect /nix/store mount options; skipping Nix store deletion"
3
Regression
Wipe an Ubuntu 24.04 host
β halts, doesn't come back after a power cycle
4
Halo
Linux wipe section in lock-wipe-hosts.md
β matches the script's order and branches
On NixOS the detached fleet-wipe.service (systemd-run) gets the systemd manager's PATH, which has no coreutils or awk. Every rm fails silently (safe_rm sends errors to /dev/null), and the sysrq halt still runs. The new prepare_nix_store works when the unit gets the login PATH (systemd-run --setenv=PATH=$PATH β¦ remounts /nix/store rw and returns 0). This also means NixOS wipes have deleted nothing since NixOS support shipped in 4.94.0.
04:35:35 systemd[1]: Started [systemd-run] /bin/sh /run/fleet_wipe.sh wipe.
04:35:35 sh: /run/fleet_wipe.sh: line 253: sleep: command not found
04:35:35 sh: Wiping /home/qa
04:35:35 sh: Wiping /etc
04:35:35 sh: /run/fleet_wipe.sh: line 195: awk: command not found
04:35:35 sh: Error: could not inspect /nix/store mount options; skipping Nix store deletion
04:35:35 sh: /run/fleet_wipe.sh: line 247: /sync_bin: No such file or directory
QA Pass with 1 finding: 5/6 checks on PR #58165 (head 3e0b079), on a scratch Fleet server built from the PR. The wipe now deletes everything on a real NixOS 26.05 host, including /nix/store. One new problem: the wiped host shows as Unlocked in Fleet instead of Wiped. Before the fix (same server, linux_wipe.sh from main), the NixOS wipe still deleted nothing and the host booted again.
#
Type
Case
Result
1
Core
Wipe a NixOS host (/nix/store read-only bind mount)
β /home, /etc, /bin, /usr and /var deleted; /nix/store remounted rw and deleted last, then the host halts
2
Core
Power-cycle the wiped NixOS host
β doesn't boot (no network, no guest agent), offline in Fleet
3
Core
Fleet status after the NixOS wipe
β host shows Unlocked, no Wiped badge, and Wipe can be sent again
4
Halo
Network/shared mount on the NixOS host (9p)
β unmounted, not deleted (awk is found now, so the network-mount check works)
5
Regression
Wipe an Ubuntu 24.04 host
β Fleet shows Wiped, host halts and doesn't come back
6
Halo
Wipe with awk/rm missing
β not run on a real host (covered by the PR's container test)
Row 3: once the wipe deletes /var/lib/orbit, orbit (still running from memory) loses its node key. It re-enrolls, because on NixOS the enroll secret comes from /run/credentials, a tmpfs the wipe doesn't touch. Orbit enroll clears host_mdm_actions (server/datastore/mysql/hosts.go), so the wipe record is gone. Before this fix nothing was deleted, so this couldn't happen.
QA Pass with 1 finding: 5/6 checks on PR #58165 (head 3e0b079), on a scratch Fleet server built from the PR. The wipe now deletes everything on a real NixOS 26.05 host, including /nix/store. One new problem: the wiped host shows as Unlocked in Fleet instead of Wiped. Before the fix (same server, linux_wipe.sh from main), the NixOS wipe still deleted nothing and the host booted again.
#
Type
Case
Result
1
Core
Wipe a NixOS host (/nix/store read-only bind mount)
β /home, /etc, /bin, /usr and /var deleted; /nix/store remounted rw and deleted last, then the host halts
2
Core
Power-cycle the wiped NixOS host
β doesn't boot (no network, no guest agent), offline in Fleet
3
Core
Fleet status after the NixOS wipe
β host shows Unlocked, no Wiped badge, and Wipe can be sent again
4
Halo
Network/shared mount on the NixOS host (9p)
β unmounted, not deleted (awk is found now, so the network-mount check works)
5
Regression
Wipe an Ubuntu 24.04 host
β Fleet shows Wiped, host halts and doesn't come back
6
Halo
Wipe with awk/rm missing
β not run on a real host (covered by the PR's container test)
Row 3: once the wipe deletes /var/lib/orbit, orbit (still running from memory) loses its node key. It re-enrolls, because on NixOS the enroll secret comes from /run/credentials, a tmpfs the wipe doesn't touch. Orbit enroll clears host_mdm_actions (server/datastore/mysql/hosts.go), so the wipe record is gone. Before this fix nothing was deleted, so this couldn't happen.
Activity
[-]Linux remote wipe doesn't delete the Nix store on NixOS hosts[/-][+]Make remote wipe script work on NixOS hosts[/+]Include Nix store in Linux remote wipe (#55492)
xpkoala commentedon Nov 9, 2026
QA Fail β 2/4 checks on
rc-minor-fleet-v4.95.0(b86f946). Wiped a NixOS 26.05 host and an Ubuntu 24.04 host from Fleet, then booted them again to see what was left./nix/storeread-only bind mount)/home,/etcand/nix/storeintact and comes back Online/nix/storeremount + deleteawk: command not foundβ "could not inspect /nix/store mount options; skipping Nix store deletion"lock-wipe-hosts.mdOn NixOS the detached
fleet-wipe.service(systemd-run) gets the systemd manager's PATH, which has no coreutils or awk. Everyrmfails silently (safe_rmsends errors to/dev/null), and the sysrq halt still runs. The newprepare_nix_storeworks when the unit gets the login PATH (systemd-run --setenv=PATH=$PATH β¦remounts/nix/storerw and returns 0). This also means NixOS wipes have deleted nothing since NixOS support shipped in 4.94.0.Fix Linux remote wipe deleting nothing on NixOS (#58165)
xpkoala commentedon Nov 11, 2026
QA Pass with 1 finding: 5/6 checks on PR #58165 (head 3e0b079), on a scratch Fleet server built from the PR. The wipe now deletes everything on a real NixOS 26.05 host, including
/nix/store. One new problem: the wiped host shows as Unlocked in Fleet instead of Wiped. Before the fix (same server,linux_wipe.shfrom main), the NixOS wipe still deleted nothing and the host booted again./nix/storeread-only bind mount)/home,/etc,/bin,/usrand/vardeleted;/nix/storeremounted rw and deleted last, then the host haltsawkis found now, so the network-mount check works)awk/rmmissingRow 3: once the wipe deletes
/var/lib/orbit, orbit (still running from memory) loses its node key. It re-enrolls, because on NixOS the enroll secret comes from/run/credentials, a tmpfs the wipe doesn't touch. Orbit enroll clearshost_mdm_actions(server/datastore/mysql/hosts.go), so the wipe record is gone. Before this fix nothing was deleted, so this couldn't happen.The finding is a small edge case that will be addressed later.
xpkoala commentedon Nov 11, 2026
QA Pass with 1 finding: 5/6 checks on PR #58165 (head 3e0b079), on a scratch Fleet server built from the PR. The wipe now deletes everything on a real NixOS 26.05 host, including
/nix/store. One new problem: the wiped host shows as Unlocked in Fleet instead of Wiped. Before the fix (same server,linux_wipe.shfrom main), the NixOS wipe still deleted nothing and the host booted again./nix/storeread-only bind mount)/home,/etc,/bin,/usrand/vardeleted;/nix/storeremounted rw and deleted last, then the host haltsawkis found now, so the network-mount check works)awk/rmmissingRow 3: once the wipe deletes
/var/lib/orbit, orbit (still running from memory) loses its node key. It re-enrolls, because on NixOS the enroll secret comes from/run/credentials, a tmpfs the wipe doesn't touch. Orbit enroll clearshost_mdm_actions(server/datastore/mysql/hosts.go), so the wipe record is gone. Before this fix nothing was deleted, so this couldn't happen.The finding is going to be addressed in another ticket.
fleet-release commentedon Nov 17, 2026
Nix store gleams bright
wipe script now reaches it all
systems fully cleared