Skip to content

Commit 3202c09

Browse files
committed
chore: remove placeholder file before root resize
On the rare occasion when the root vol is completely full, a resize could fail. This change attempts to work around that by removing the placeholder file prior to the resize, and re-creating it afterwards.
1 parent 6648493 commit 3202c09

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

ansible/files/admin_api_scripts/grow_fs.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,13 @@ if [ -b /dev/nvme1n1 ] ; then
99
resize2fs /dev/nvme1n1
1010

1111
elif [[ "${VOLUME_TYPE}" == "root" ]] ; then
12+
PLACEHOLDER_FL=/home/ubuntu/50M_PLACEHOLDER
13+
rm -f "${PLACEHOLDER_FL}" || true
1214
growpart /dev/nvme0n1 2
1315
resize2fs /dev/nvme0n1p2
14-
16+
if [[ ! -f "${PLACEHOLDER_FL}" ]] ; then
17+
fallocate -l50M "${PLACEHOLDER_FL}"
18+
fi
1519
else
1620
echo "Invalid disk specified: ${VOLUME_TYPE}"
1721
exit 1

0 commit comments

Comments
 (0)