From 13c19663d947769d521602f5ddc0cca76f8a2a8b Mon Sep 17 00:00:00 2001 From: pingqiu Date: Sat, 5 Dec 2026 17:31:34 -0800 Subject: [PATCH] docs(block): refuse mounts at removal operand roots --- seaweed-block/docs/operations-manual.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/seaweed-block/docs/operations-manual.md b/seaweed-block/docs/operations-manual.md index b04426fb74..ac31654205 100644 --- a/seaweed-block/docs/operations-manual.md +++ b/seaweed-block/docs/operations-manual.md @@ -963,7 +963,9 @@ two hosts, follow the host-by-host order there. Where SeaweedFS was already runn the removal below would stop there. Unmount anything else mounted below these directories first, bind mounts included. `-xdev` and `--one-file-system` stop only at another filesystem: a bind mount from the same filesystem looks like a plain directory to them, and its source's contents would be deleted. Both commands - below print any such mount and remove nothing while one remains; `findmnt` lists the mounts. + below print nested mounts and remove nothing while one remains; `findmnt` lists the mounts. The final + removal also refuses mounts at the operand roots themselves. The empty-and-unmount step intentionally + allows blockmaster's state mount itself so it can empty and unmount that filesystem first. ```sh units=$(systemctl list-units 'sw-blockvolume*' 'sw-blockmaster*' --state=active,activating,deactivating --no-legend) && @@ -978,7 +980,7 @@ two hosts, follow the host-by-host order there. Where SeaweedFS was already runn ```sh units=$(systemctl list-units 'sw-blockvolume*' 'sw-blockmaster*' --state=active,activating,deactivating --no-legend) && test -z "$units" && mounts=$(findmnt -rno TARGET) && - ! printf '%s\n' "$mounts" | grep -E '^/(var/lib/sw-block-(volume|master)|etc/sw-block)/' && + ! printf '%s\n' "$mounts" | grep -E '^/(var/lib/sw-block-(volume|master)|etc/sw-block)(/|$)' && sudo rm -rf --one-file-system /var/lib/sw-block-volume /var/lib/sw-block-master /etc/sw-block && sudo rm -f /etc/systemd/system/sw-blockmaster.service /etc/systemd/system/sw-blockvolume.service \ /etc/systemd/system/sw-blockvolume@.service /etc/systemd/system/sw-blockvolume-ublk.service \