[Steps] - How to extend the root (/) disk of a VM in Google Cloud Platform (GCP)

Steps to extend the root file system in GCP:

1) connect to the instance, and check the size with
lsblk and df-h.
2) Navigate to the instance in gcloud console, and to the boot disk and edit the same change size from 20G to 30G
3) Now check in lsbk in the VM : it reflects 30 Gb in sda but on its partition
4) Now use growpart to extend the partition using the below command
growpart /dev/sda 1
and then use lsblk and see that it reflects.
5) But still df -h still does not reflect it :
6) To make the filesystem report the actual size use below:
sudo xfs_growfs /
7) Now it reflects in df -h also as shown below:
df -kh

In Short:

1) edit the boot disk size in gcloud console
2) growpart /dev/sda 1
3) sudo xfs_growfs /

💚 HAPPY LEARNING! 💚

DISCLAIMER

The purpose of sharing the content on this website is to Educate. The author/owner of the content does not warrant that the information provided on this website is fully complete and shall not be responsible for any errors or omissions. The author/owner shall have neither liability nor responsibility to any person or entity with respect to any loss or damage caused or alleged to be caused directly or indirectly by the contents of this website. So, use the content of this website at your own risk.

This content has been shared under Educational And Non-Profit Purposes Only. No Copyright Infringement Intended, All Rights Reserved to the Actual Owner.

For Copyright Content Removal Please Contact us by Email at besttechreads[at]gmail.com

Post a Comment

Previous Post Next Post