Skip to content

Commit 62fc903

Browse files
Jenkinsopenstack-gerrit
authored andcommitted
Merge "Create new swift data store filesystem every time"
2 parents d0e55c8 + 00edc95 commit 62fc903

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
@@ -1362,16 +1362,20 @@ if is_service_enabled swift; then
13621362
sudo chown -R $USER:${USER_GROUP} ${SWIFT_DATA_DIR}
13631363

13641364
# We then create a loopback disk and format it to XFS.
1365-
# TODO: Reset disks on new pass.
1366-
if [[ ! -e ${SWIFT_DATA_DIR}/drives/images/swift.img ]]; then
1365+
if [[ -e ${SWIFT_DATA_DIR}/drives/images/swift.img ]]; then
1366+
if egrep -q ${SWIFT_DATA_DIR}/drives/sdb1 /proc/mounts; then
1367+
sudo umount ${SWIFT_DATA_DIR}/drives/sdb1
1368+
fi
1369+
else
13671370
mkdir -p ${SWIFT_DATA_DIR}/drives/images
13681371
sudo touch ${SWIFT_DATA_DIR}/drives/images/swift.img
13691372
sudo chown $USER: ${SWIFT_DATA_DIR}/drives/images/swift.img
13701373

13711374
dd if=/dev/zero of=${SWIFT_DATA_DIR}/drives/images/swift.img \
13721375
bs=1024 count=0 seek=${SWIFT_LOOPBACK_DISK_SIZE}
1373-
mkfs.xfs -f -i size=1024 ${SWIFT_DATA_DIR}/drives/images/swift.img
13741376
fi
1377+
# Make a fresh XFS filesystem
1378+
mkfs.xfs -f -i size=1024 ${SWIFT_DATA_DIR}/drives/images/swift.img
13751379

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

0 commit comments

Comments
 (0)