Hello
This morning, I was trying to SSH into my instance but it seems that it is too full. I received the following message:
Could not update /home/Name/.ssh/authorized_keys due to Disk is too full
Last night I used screen command to create some files which are expected to be large.
I have seen some answers for such a problem, but I am so worried since most of my phd research documents are stored on the disk. So I need to make sure that I am following the right instructions.
Snapshot
One of the solutions was to take a snapshot of the disk. However, in the documentations I found "If you take a snapshot of your persistent disk in a state where application data is cached without actually being written to disk, it might force a disk check or cause data loss”.
Since the ssh session was running all night, would it be inappropriate to take snapshot?
Increase disk size
I was also considering editing the instance to increase the
disk size from 10G to 15G. But I am not sure if this will cause any data loss
too. I don’t think there is a need for repartitioning the disk since I am using
Ubuntu 14.
Startup script
Someone suggested deleting some files using a startup script. From what I understand, I can only create it at the instance creation time or by adding it to the storage unit which currently inaccessible.
Please recommend the safest solution
Hello Khalid,
As of 31 Mar 2016, you can resize a persistent disk online without stopping or rebooting the VM, without taking snapshots, and without having to restore it to a larger disk.
The blog post announcing the feature has the details, and you can see the docs for how to do this via the console:
Resize the persistent disk in the Google Cloud Platform Console:
- Go to the VM instances page.
- Click the name of the disk that you want to resize.
- At the top of the disk details page, click Edit.
- In the Size field, enter the new size for your disk.
- At the bottom of the disk details page, click Save to apply your changes to the disk.
- After you resize the disk, you must resize the disk partitions so that the operating system can access the additional space.
Or via CLI:
gcloud compute disks resize example-disk --size 250ubuntu supports automatic resizing, so I have not resized the disk partitions manually