0

On GCP, is there a way to trigger a filesystem resize (possibly by running a systemd unit) when the size of the disk backing a mounted filesystem is changed?

I was hoping these kind of events would be possible through udev but by running udevadm monitor --environment I only see events for attach/detach rather than disk resize.

I'm thinking my only option is to run resize periodically or force the instance to be restarted when the disk size changes.

dippynark
  • 2,743
  • 20
  • 58
  • Google Compute Engine VMs, for most Linux operating systems, include startup code that checks if a boot disk resize is required. The correct procedure is: resize the disk and then reboot the instance. You could automate checking for free disk space, resizing the disk and rebooting via the Cloud SDK and another service like Cloud Run + Cloud Scheduler. – John Hanley Aug 01 '19 at 15:42

1 Answers1

0

That's correct, the only way of re-size your VM filesystem is by doing it manually.

You can take a look here to follow the steps to resize your filesystem for Windows or Linux Instances.

Jujosiga
  • 409
  • 2
  • 7