Skip to content

Commit 00edc95

Browse files
author
Dean Troyer
committed
Create new swift data store filesystem every time
The Swift data store was not cleaned out between stack.sh runs; although the contents were not visible they were still taking up space. Create a new XFS filesystem on every stack.sh run. Fixes bug 1000827 Change-Id: Ieab6b5f65b7964906f244975cbcdf2cf50344ca5
1 parent 461203b commit 00edc95

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

stack.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1347,16 +1347,20 @@ if is_service_enabled swift; then
13471347
sudo chown -R $USER:${USER_GROUP} ${SWIFT_DATA_DIR}
13481348

13491349
# We then create a loopback disk and format it to XFS.
1350-
# TODO: Reset disks on new pass.
1351-
if [[ ! -e ${SWIFT_DATA_DIR}/drives/images/swift.img ]]; then
1350+
if [[ -e ${SWIFT_DATA_DIR}/drives/images/swift.img ]]; then
1351+
if egrep -q ${SWIFT_DATA_DIR}/drives/sdb1 /proc/mounts; then
1352+
sudo umount ${SWIFT_DATA_DIR}/drives/sdb1
1353+
fi
1354+
else
13521355
mkdir -p ${SWIFT_DATA_DIR}/drives/images
13531356
sudo touch ${SWIFT_DATA_DIR}/drives/images/swift.img
13541357
sudo chown $USER: ${SWIFT_DATA_DIR}/drives/images/swift.img
13551358

13561359
dd if=/dev/zero of=${SWIFT_DATA_DIR}/drives/images/swift.img \
13571360
bs=1024 count=0 seek=${SWIFT_LOOPBACK_DISK_SIZE}
1358-
mkfs.xfs -f -i size=1024 ${SWIFT_DATA_DIR}/drives/images/swift.img
13591361
fi
1362+
# Make a fresh XFS filesystem
1363+
mkfs.xfs -f -i size=1024 ${SWIFT_DATA_DIR}/drives/images/swift.img
13601364

13611365
# After the drive being created we mount the disk with a few mount
13621366
# options to make it most efficient as possible for swift.

0 commit comments

Comments
 (0)