Skip to content

Commit

Permalink
server: grow the xfs filesystem
Browse files Browse the repository at this point in the history
Fixes: kadalu#970
Signed-off-by: Shree Vatsa N <[email protected]>
  • Loading branch information
vatsa287 committed Mar 21, 2023
1 parent f1bc7e0 commit 7773a8e
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions server/glusterfsd.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
VOLFILES_DIR = "/var/lib/kadalu/volfiles"
VOLINFO_DIR = "/var/lib/gluster"
MKFS_XFS_CMD = "/sbin/mkfs.xfs"
XFS_GROWFS_CMD = "/sbin/xfs_growfs"


def create_brickdir(brick_path):
Expand Down Expand Up @@ -185,6 +186,26 @@ def create_and_mount_brick(brick_device, brick_path, brickfs):
else:
pass

# Expand the device file-system to match the current device size,
# When a underlying device is expanded, grow the filesystem.
try:
execute(XFS_GROWFS_CMD, "-d", mountdir)
logging.info(logf(
"Successfully expanded device on path",
fstype=brickfs,
device=brick_device,
mountdir=mountdir,
))
except CommandException as err:
logging.error(logf(
"Failed to expand export brick (after mkfs and mount)",
fstype=brickfs,
device=brick_device,
mountdir=mountdir,
error=err,
))
sys.exit(1)


def start_args():
"""
Expand Down

0 comments on commit 7773a8e

Please sign in to comment.