Last active
August 30, 2024 10:59
-
-
Save w1ndy/806495fcb1c4ea51bdf8acd08a8ea906 to your computer and use it in GitHub Desktop.
Enable fast du for an existing ceph image
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IMAGE=pool_name/image_name | |
rbd feature enable $IMAGE exclusive-lock | |
rbd feature enable $IMAGE object-map | |
rbd object-map rebuild $IMAGE | |
rbd du $IMAGE | |
# Enabling for all images in a pool | |
POOL=pool_name | |
for IMAGE in $(rbd ls $POOL); do if rbd info $POOL/$IMAGE | grep -q object-map; then echo "$POOL/$IMAGE has been processed"; else echo "processing $POOL/$IMAGE" && rbd feature enable $POOL/$IMAGE exclusive-lock && rbd feature enable $POOL/$IMAGE object-map && rbd object-map rebuild $POOL/$IMAGE; fi ; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment