NewGuyInJava
NewGuyInJava

Reputation: 216

Resizing /Dev/SDA1 : Google Cloud

I am a total noob on this one. I have a google cloud SUSE instance which is running a VM image. I am trying to install a package but I think it's running out of space. What I want to do is to assign some of the 120G space to my /dev/sda1 partition. I have read the google's guide but I am not sure which section should I be following.

>df -h
Filesystem      Size  Used Avail Use% Mounted on
devtmpfs         13G     0   13G   0% /dev
tmpfs            13G     0   13G   0% /dev/shm
tmpfs            13G  9.7M   13G   1% /run
tmpfs            13G     0   13G   0% /sys/fs/cgroup
/dev/sda1        36G   34G     0 100% /
tmpfs           2.6G     0  2.6G   0% /run/user/490
tmpfs           2.6G     0  2.6G   0% /run/user/1004
tmpfs           2.6G     0  2.6G   0% /run/user/1006

>sudo lsblk
NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda      8:0    0  120G  0 disk 
└─sda1   8:1    0   36G  0 part /

enter image description here

Upvotes: 3

Views: 6219

Answers (4)

Harsh Manvar
Harsh Manvar

Reputation: 30083

Without reboot increase boot size in GCP cloud VM

Check first disk usage using df -h if usage of /dev/sda1 more than 80% it's dangerous.

Update disk size on the fly

  1. Increase disk size from console first
  2. SSH inside VM : sudo growpart /dev/sda 1
  3. Resize your file system : sudo resize2fs /dev/sda1
  4. Verify : df -h

Upvotes: 10

Super late to the party but using sudo growpart /dev/sda 1 worked for me

Upvotes: 2

Maciek
Maciek

Reputation: 1972

This is just an addition to Prateeks answer. After changing the size, you need to run (linux only) to reboot:

sudo reboot

Give it some time, close your console if you get no response. Then run df again to see the new size.

Upvotes: 2

Prateek Gupta
Prateek Gupta

Reputation: 538

Increase the size of existing persistent disk:

  1. Login to Google Cloud Platform
  2. Goto Compute Engine -> Disks
  3. Locate your VM's boot disk(default disk), open it
  4. Click Edit
  5. Enter a new size, please note that you won't be able to decrease this size later.
  6. Reboot your VM, you should be able to see new size of disk.

Upvotes: 6

Related Questions