Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

server: grow the xfs filesystem #971

Draft
wants to merge 1 commit into
base: devel
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will this be a no-op when there's no space to extend?

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