Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Can't connect to VM due to full disk, after resizing, same error occurs in Google Cloud CLI

So i've had this problem for 3 days at this point. 
To start with, I wanted to run a Minecraft server on google cloud, and I used a mod to preload 3.5million chunks which should've taken about a few days in real life. I assumed that my 10GB boot disk got full and for some reason my VM didn't use the other 50GB disk. When I made a snapshot of both to trouble shoot, the disk was empty and the bootdisk only had 6.7GB / 10GB. 

Because of this weird error, I couldn't connect to SSH after fixing my firewall connections, serial console  would not start login service because of a full boot disk. 
So i downloaded google cloud CLI and tried connecting from my terminal, didn't work. Then it mentioned I had a full disk and it needed resizing. Which i have done multiple times while troubleshooting. 
I resized from 10GB to 50, then to 200, now at 202GB, and it still required more space. Is there some way to fix this error?
the google cloud CLIthe google cloud CLIthe spammed message on my serial consolethe spammed message on my serial console

I had also tried resizing manually
making my boot disk into a snapshot, and then switching it into a disk and into the new bootdisk of my vm
recreated the VM and repeated the step above, still to no avail. 

Solved Solved
1 3 421
1 ACCEPTED SOLUTION

@hidrostix ,

Yep. SSH will not going to work due to full disk. What I've mentioned is using serial console, which is slightly different method of connecting with VM. So as I've mentioned in my previous post, you can either do following steps:

"1. Create similar VM, at the same region and zone as you broken one.
2. Shut down your broken one, once done, detach boot disk ( or disk which is broken ).
3. Attach broken disk to new VM and boot it. Disk should be attached as additional one, not boot one. 
4. Mount your broken disk as normal disk by mount /DISK_PATH/ /mountPOINT
5. As root, you should be able to check what is going on with this disk, make some cleanup or resize it. 
6. Once done, shut down New VM. Detach disk , attach to old VM. Start Old VM."

 

OR 

Reconfigure your VM to enable serial-console

https://cloud.google.com/compute/docs/troubleshooting/troubleshooting-using-serial-console 

Please see this tutorial:

I’ve intentionally filled out disk space.

DamianS_0-1733985252034.png

That caused following error:

DamianS_1-1733985252035.png

So I’ve stopped VM. Expanded BOOT disk from 10 GB to 50GB And started VM again. Still the same

DamianS_2-1733985252039.png

DamianS_3-1733985252042.png

In theory I should be able to resize it from terminal in my case. But I want to simulate your case, so imagine that I’m not able to use terminal at broken VM.

1. I’ve stopped broken one.

  1. Once done, I’ve detach boot disk.

DamianS_4-1733985252045.png

  1. then I’ve picked clean VM and attached EXISTING DISK ( boot disk from broken one)
    DamianS_5-1733985252046.png
  2. Next, I’ve logged to clean VM.
    DamianS_6-1733985252049.png

     

  3. fdisk -l presented that broken disk is being visible from OS perspective
    DamianS_7-1733985252052.png

     

  4. As root, I’ve created mountpoint named “broken” and mounted device with type Linux filesystem

    DamianS_8-1733985252055.png

     

  5. As you can see, we have all files from broken VM ( now you can clean FS or do anything).
    DamianS_9-1733985252063.png

     

  6. Lets’ resize disk.

We will going to use two commands

growparth DEVICE PARTITION_NUMBER
resize2fs /FS

DamianS_10-1733985252068.png

  1. Umount /broken mountpoint. Shutdown VM

DamianS_11-1733985252072.png

  1. Detach disk
    DamianS_12-1733985252076.png
  2. Configure new disk on broken VM

DamianS_13-1733985252104.png

  1. save config and start VM.

Boot disk has been fixed

DamianS_14-1733985252108.png

--
cheers,
Damian Sztankowski
LinkedIn medium.com Cloudskillsboost Sessionize Youtube

View solution in original post

3 REPLIES 3

Hello @hidrostix  ,Welcome on Google Cloud Community.

Do you have only one disk and storing data on that one disk ? If you want to debug, you can follow this approach:

1. Create similar VM, at the same region and zone as you broken one.
2. Shut down your broken one, once done, detach boot disk ( or disk which is broken ).
3. Attach broken disk to new VM and boot it. Disk should be attached as additional one, not boot one. 
4. Mount your broken disk as normal disk by mount /DISK_PATH/ /mountPOINT
5. As root, you should be able to check what is going on with this disk, make some cleanup or resize it. 
6. Once done, shut down New VM. Detach disk , attach to old VM. Start Old VM.

You can use also serial console to debug this state:

https://cloud.google.com/compute/docs/troubleshooting/troubleshooting-using-serial-console 

If you have any question, 


@hidrostix wrote:

I resized from 10GB to 50, then to 200, now at 202GB, and it still required more space. Is there some way to fix this error?


 

One question here: Did you've resized it from GC UI AND then from VM terminal, or only resized via GC UI ? 

--
cheers,
Damian Sztankowski
LinkedIn medium.com Cloudskillsboost Sessionize Youtube

So I only resized it from the GC UI, I am unable to access the VM terminal since I can't access SSH and serial console. This is because the bootdisk hasn't been resized in both GC UI and the terminal. But I need the terminal to resize it. So it's like a loop I can't break. 
The only solution I've thought of is to resize it through the startup script, but I don't know how to do that. 
And accessing or resizing with ssh through GC CLI is also not possible.
GC CLI errorGC CLI error
I've tried using --troubleshoot --tunnel-through-iap. It gave the same error, saying that the VM needed more disk space.

It gave 2 links to resizing and trouble shooting with serial console. Both required ssh and serial console which I can't access.

I have also made sure my firewalls worked with checking the firewall and the SSH and TCP configurations in IAP (I don't remember the name but I think that was it)

But my ssh still gave the same error:
Screenshot 2024-12-11 at 17.13.13.png

@hidrostix ,

Yep. SSH will not going to work due to full disk. What I've mentioned is using serial console, which is slightly different method of connecting with VM. So as I've mentioned in my previous post, you can either do following steps:

"1. Create similar VM, at the same region and zone as you broken one.
2. Shut down your broken one, once done, detach boot disk ( or disk which is broken ).
3. Attach broken disk to new VM and boot it. Disk should be attached as additional one, not boot one. 
4. Mount your broken disk as normal disk by mount /DISK_PATH/ /mountPOINT
5. As root, you should be able to check what is going on with this disk, make some cleanup or resize it. 
6. Once done, shut down New VM. Detach disk , attach to old VM. Start Old VM."

 

OR 

Reconfigure your VM to enable serial-console

https://cloud.google.com/compute/docs/troubleshooting/troubleshooting-using-serial-console 

Please see this tutorial:

I’ve intentionally filled out disk space.

DamianS_0-1733985252034.png

That caused following error:

DamianS_1-1733985252035.png

So I’ve stopped VM. Expanded BOOT disk from 10 GB to 50GB And started VM again. Still the same

DamianS_2-1733985252039.png

DamianS_3-1733985252042.png

In theory I should be able to resize it from terminal in my case. But I want to simulate your case, so imagine that I’m not able to use terminal at broken VM.

1. I’ve stopped broken one.

  1. Once done, I’ve detach boot disk.

DamianS_4-1733985252045.png

  1. then I’ve picked clean VM and attached EXISTING DISK ( boot disk from broken one)
    DamianS_5-1733985252046.png
  2. Next, I’ve logged to clean VM.
    DamianS_6-1733985252049.png

     

  3. fdisk -l presented that broken disk is being visible from OS perspective
    DamianS_7-1733985252052.png

     

  4. As root, I’ve created mountpoint named “broken” and mounted device with type Linux filesystem

    DamianS_8-1733985252055.png

     

  5. As you can see, we have all files from broken VM ( now you can clean FS or do anything).
    DamianS_9-1733985252063.png

     

  6. Lets’ resize disk.

We will going to use two commands

growparth DEVICE PARTITION_NUMBER
resize2fs /FS

DamianS_10-1733985252068.png

  1. Umount /broken mountpoint. Shutdown VM

DamianS_11-1733985252072.png

  1. Detach disk
    DamianS_12-1733985252076.png
  2. Configure new disk on broken VM

DamianS_13-1733985252104.png

  1. save config and start VM.

Boot disk has been fixed

DamianS_14-1733985252108.png

--
cheers,
Damian Sztankowski
LinkedIn medium.com Cloudskillsboost Sessionize Youtube