diff options
Diffstat (limited to 'packages/gce-disk-expand/src/usr/share/dracut/modules.d/50expand_rootfs/xfs_growfs.sh')
-rwxr-xr-x | packages/gce-disk-expand/src/usr/share/dracut/modules.d/50expand_rootfs/xfs_growfs.sh | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/packages/gce-disk-expand/src/usr/share/dracut/modules.d/50expand_rootfs/xfs_growfs.sh b/packages/gce-disk-expand/src/usr/share/dracut/modules.d/50expand_rootfs/xfs_growfs.sh index af8d05d..0e77185 100755 --- a/packages/gce-disk-expand/src/usr/share/dracut/modules.d/50expand_rootfs/xfs_growfs.sh +++ b/packages/gce-disk-expand/src/usr/share/dracut/modules.d/50expand_rootfs/xfs_growfs.sh @@ -14,7 +14,7 @@ # limitations under the License. main() { - if [ -z "$expand_xfs" ]; then + if [ ! -e /tmp/xfs_resize ]; then return fi @@ -23,11 +23,18 @@ main() { return fi if xfs_growfs -d -n /sysroot; then + echo "Mounting filesystem rw." + if ! $(mount -o rw,remount /sysroot); then + echo "Remount failed." + return + fi echo "Resizing XFS filesystem" if ! out=$(xfs_growfs -d /sysroot); then echo "Failed to resize: ${out}" + mount -o ro,remount /sysroot return fi + mount -o ro,remount /sysroot fi } |