diff --git a/seaweed-block/docs/operations-manual.md b/seaweed-block/docs/operations-manual.md index e36aaf0441..83929f2495 100644 --- a/seaweed-block/docs/operations-manual.md +++ b/seaweed-block/docs/operations-manual.md @@ -953,12 +953,16 @@ two hosts, follow the host-by-host order there. Where SeaweedFS was already runn 3. **Remove sw-block.** The removal runs only after the same check succeeds in the same command. A failed query removes nothing. If section 1 put blockmaster's state on its own filesystem, empty and unmount it first, then delete its persistent mount configuration (its `/etc/fstab` line): `rm -rf` cannot remove a mount point, so - the removal below would stop there. Unmount any other filesystem mounted below these directories first: - `-xdev` and `--one-file-system` make the removal stop at such a mount instead of deleting its contents. + 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. ```sh units=$(systemctl list-units 'sw-blockvolume*' 'sw-blockmaster*' --state=active,activating,deactivating --no-legend) && - test -z "$units" && mountpoint -q /var/lib/sw-block-master && + test -z "$units" && mounts=$(findmnt -rno TARGET) && + ! printf '%s\n' "$mounts" | grep -E '^/(var/lib/sw-block-(volume|master)|etc/sw-block)/' && + mountpoint -q /var/lib/sw-block-master && sudo find /var/lib/sw-block-master -xdev -mindepth 1 -delete && sudo umount /var/lib/sw-block-master ``` @@ -966,7 +970,8 @@ 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" && + test -z "$units" && mounts=$(findmnt -rno TARGET) && + ! 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 \