For When You Can't Have The Real Thing
[ start | index | login ]
start > Google Cloud Compute > Grow Linux Filesystem

Grow Linux Filesystem

Created by dave. Last edited by dave, 2 years and 33 days ago. Viewed 531 times. #1
[edit] [rdf]
labels
attachments
(2022-02-14)

Problem

I need to make a disk bigger

Solution

Resize the disk:

$ gcloud compute disks list | grep home
home                           us-central1-f  zone            500      pd-ssd       READY
home-ssh-keys                  us-central1-f  zone            400      pd-standard  READY
$ gcloud compute disks resize home --size 750 --zone us-central1-f

This command increases disk size. This change is not reversible. [lots of noise]

$ gcloud compute disks list | grep home home us-central1-f zone 750 pd-ssd READY home-ssh-keys us-central1-f zone 400 pd-standard READY

On the system mounting the filesystem, resize the partition (if applicable -- this isn't necessary if the entire disk is mounted ie is not partitioned):

# growpart /dev/sda 1

Resize the filesystem:

# resize2fs /home2
resize2fs 1.45.6 (20-Mar-2020)
open: Is a directory while opening /home2
[root@fs-06 sbin]# resize2fs /dev/sdb
resize2fs 1.45.6 (20-Mar-2020)
Filesystem at /dev/sdb is mounted on /home2; on-line resizing required
old_desc_blocks = 32, new_desc_blocks = 47
The filesystem on /dev/sdb is now 196608000 (4k) blocks long.

#

xfs users will prefer to use xfs_growfs instead of resize2fs.

no comments | post comment
This is a collection of techical information, much of it learned the hard way. Consider it a lab book or a /info directory. I doubt much of it will be of use to anyone else.

Useful:


snipsnap.org | Copyright 2000-2002 Matthias L. Jugel and Stephan J. Schmidt