Sometimes you write local logs and it’s just too much. SSH doesn’t even work anymore.
This feels like a common issue and I expected a simple step-by-step guide, but resolving it was mildly aggravating. The documentation provided by Google, and others who have dealt with this before, feel like they skipped over some small details.
Here’s what I did:
Turn off VM
Detach disk from the “Edit” menu
Attach disk to a similar VM (same OS) as an “additional disk”
See disk with
ls /dev/disk/by-id
lsblk -f
Mount the disk
Grow the partition if we’ve decided to increase the disk size (see lsblk
)
sudo apt -y install cloud-guest-utils
sudo growpart /dev/sdb 1
Delete any unnecessary large files
du -Sm --max-depth=7 2> >(grep -v 'Permission denied') | sort -n -r | head -n 30
Another option is to move large files to a cloud storage bucket
gsutil mv <...>
Detach the additional disk, reattach as the boot disk in the original instance
It should now SSH fine!