Commit b9a53090 authored by Nikos Skalkotos's avatar Nikos Skalkotos
Browse files

Support enlarging xfs file systems

Resizing of a xfs file system is performed in FilesystemResizeMounted
configuration task.
parent a8618600
......@@ -37,9 +37,10 @@ DUMPFS_OPENBSD=dumpfs.openbsd
DATE="date -u" # Time in UTC
EATMYDATA=eatmydata
MOUNT="mount -n"
HIVEXGET="hivexget"
HIVEXREGEDIT="hivexregedit"
BTRFS="btrfs"
HIVEXGET=hivexget
HIVEXREGEDIT=hivexregedit
BTRFS=btrfs
XFS_GROWFS=xfs_growfs
CLEANUP=( )
ERRORS=( )
......
......@@ -61,19 +61,23 @@ select volume $id
extend filesystem
exit
EOF
elif [ "$ptype" = "btrfs" ]; then
elif [[ "$ptype" =~ ^(btrfs|xfs)$ ]]; then
target=$(find_mount_target "$device")
if [ -z "$target" ]; then
warn "Can't enlarge btrfs file system in device: \`$device'. File system not mounted"
warn "Can't enlarge $ptype file system in device: \`$device'. File system not mounted."
exit 0
fi
set $($BTRFS filesystem show "$device" | grep "$device")
if [ "$ptype" = btrfs ]; then
set $($BTRFS filesystem show "$device" | grep "$device")
$BTRFS filesystem resize "$2":max "$target"
$BTRFS filesystem resize "$2":max "$target"
else # "$ptype" = xfs
$XFS_GROWFS "$target"
fi
else
warn "Don't know how to resize \`$device'"
warn "Don't know how to resize mounted device: \`$device'"
fi
exit 0
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment