I am new to Google Cloud. I was downloaded a few text files into the VM instance. I then suddenly started getting messages like

bash: cannot create temp file for here-document: No space left on device

I ran the df -h and found that my disk was being used 100%

/dev/sdb        9.8G  9.3G     0 100% /

I searched about it and figured that I might need to add more persistence storage.

I followed the instructions here -> https://cloud.google.com/compute/docs/disks/add-persistent-disk

Now when I run the df -h I see that the new storage is added (usage is 1%)

/dev/sdc         20G   45M   20G   1% /mnt/disks/disk2

When I run lsblk, I get:

sda      8:0    0  10G  0 disk 
└─sda1   8:1    0  10G  0 part /
sdc      8:32   0  20G  0 disk /mnt/disks/disk2

However, I am still getting the same error with No space left on device. I have restarted the VM. Kindly help.

P.S. VM -> Debian 4.9.65-3+deb9u2 (2018-01-04) x86_64

  • 4
    You've added a new disk rather than increasing the size of your existing one, so your root partition is still full. – roaima Jul 2 '18 at 22:22

I agreed with roaima, you need to increase the size of your existing boot disk to solve this issue. After you resize the disk, you must resize the file system so that the operating system can access the additional space. Boot disks use MBR partitions, which are limited to 2 TB in size. Do not resize boot disks beyond 2 TB.


When creating a new instance (and new attached boot disk), you need to change the --boot-disk-size option, e.g. gcloud compute --project "seekwell-scheduler-183021" instances create "myapp" --boot-disk-size "500GB".

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.