Reputation: 1154
I have an Ubuntu 16.04.3 LTS GCE instance. I increased system disk space (from 20 GB to 30 GB) but after GCE restart, if I run
df -h
I still get 20GB on disk size.
In the past, on Ubuntu GCE Instances, after the instance restart, the System automatically saw new disk space.
Also in the documentation I read:
"Alternatively, instances that use most recent versions of Public Images can automatically resize their partitions and file systems after a system reboot. The SUSE Linux Enterprise Server (SLES) public images are the only images that do not support this feature."
So, what is the problem? What can I do to get the new space?
Upvotes: 1
Views: 438
Reputation: 1301
You can execute:
$ sudo lsblk
$ sudo resize2fs /dev/sda1 30G
If you receive the message:
The filesystem is already 5242619 (4k) blocks long. Nothing to do!
Sorry, I believe that you can't resize the disk using resize2fs.
So, I know two alternatives that you can follow.
Alternative 1 - Attach another one disk in the VM.
Alternative 2 - Create a new disk from a snapshot of the original disk. Steps to create a disk from a snapshot:
gcloud beta compute disks snapshot <disk_name> --project=<project_id> --snapshot-names=snapshot-1 --zone=<zone> --storage-location=us
Upvotes: 2