diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-21 11:54:28 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-21 11:54:28 +0000 |
commit | e6918187568dbd01842d8d1d2c808ce16a894239 (patch) | |
tree | 64f88b554b444a49f656b6c656111a145cbbaa28 /src/tools/rbd_nbd/rbd-nbd_quiesce | |
parent | Initial commit. (diff) | |
download | ceph-e6918187568dbd01842d8d1d2c808ce16a894239.tar.xz ceph-e6918187568dbd01842d8d1d2c808ce16a894239.zip |
Adding upstream version 18.2.2.upstream/18.2.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/tools/rbd_nbd/rbd-nbd_quiesce')
-rwxr-xr-x | src/tools/rbd_nbd/rbd-nbd_quiesce | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/tools/rbd_nbd/rbd-nbd_quiesce b/src/tools/rbd_nbd/rbd-nbd_quiesce new file mode 100755 index 000000000..a62a12b15 --- /dev/null +++ b/src/tools/rbd_nbd/rbd-nbd_quiesce @@ -0,0 +1,31 @@ +#!/bin/sh + +echo "$0 $@" >&2 + +if [ $# -lt 2 ]; then + echo "usage: $0 <dev> <cmd>" >&2 + exit 1 +fi + +dev=$1 +cmd=$2 + +export PATH=/usr/sbin:/usr/bin:/sbin:/bin + +findmnt -S "${dev}" -fno TARGET | +while read mnt; do + case "${cmd}" in + quiesce) + echo "freezing ${mnt}" >&2 + fsfreeze -f "${mnt}" + ;; + unquiesce) + echo "unfreezing ${mnt}" >&2 + fsfreeze -u "${mnt}" + ;; + *) + echo "unknown command ${cmd}" >&2 + exit 1 + ;; + esac +done |