Your operations team manages a critical stateful log processing database on an Ubuntu Linux Compute Engine virtual machine instance. Due to rapid data growth, the mounted ext4 data disk reached capacity. An administrator resized the persistent disk from 200 GB to 500 GB using the Google Cloud Console; however, running `df -h` inside the instance shows that the file system is still limited to 200 GB. Which set of actions must you perform to make the newly allocated 300 GB available to the operating system with minimal service disruption?
- Connect to the instance using SSH, run `growpart` to expand the target disk partition, and execute `resize2fs` to extend the ext4 file system online.Answer
- BUpdate the Compute Engine Managed Instance Group (MIG) autoscaling policy metric to monitor disk utilization percentage, expecting the MIG to automatically enlarge the existing disk partitions.
- CUnmount the persistent disk, change the disk provisioning model to a Spot persistent disk, and remount it to trigger automatic OS-level file system expansion.
- DStop the VM instance and grant your user account the primitive Owner role on the GCP project to authorize the operating system to automatically resize mounted volumes upon reboot.
Answer
Connect to the instance via SSH, use `growpart` to expand the partition table, and use `resize2fs` to resize the ext4 file system online.
When a Compute Engine persistent disk size is increased in GCP, the hypervisor provides larger block storage, but the operating system's partition table and file system remain at their original sizes. To utilize the space online, administrators must connect to the VM via SSH, run `growpart` to expand the partition containing the file system, and then run `resize2fs` (for ext4 file systems) to grow the file system live.
Step-by-Step Solution
Key Concept
Compute Engine Persistent Disk Resizing and File System Extension