GCE instance not using all the disk space

1,477 views
Skip to first unread message

Shambu Pujar

unread,
Feb 25, 2018, 12:00:54 PM2/25/18
to gce-discussion
Hi

I have a compute instance that was originally 10GB and then extended to 20GB. The extension doesn't seem to come in place . As seen in below , the OS is complaining about diskspace, while df -h comand shows more space

cp: cannot create directory '/app/node_modules/webpack-dev-server/lib': No space left on device

cp: cannot create directory '/app/node_modules/webpack-dev-server/bin': No space left on device

ERROR: Service 'ui' failed to build: The command '/bin/sh -c mkdir -p /app && cp -a /tmp/node_modules /app/' returned a non-zero code: 1

shambu@jenkins-1-vm-1:$ df -h

Filesystem      Size  Used Avail Use% Mounted on

/dev/sda1        20G   11G  7.8G  59% /

udev             10M     0   10M   0% /dev

tmpfs           1.5G  8.5M  1.5G   1% /run

tmpfs           3.7G     0  3.7G   0% /dev/shm

tmpfs           5.0M     0  5.0M   0% /run/lock

tmpfs           3.7G     0  3.7G   0% /sys/fs/cgroup

tmpfs           750M     0  750M   0% /run/user/999

tmpfs           750M     0  750M   0% /run/user/1003


Not sure why remaining 7.8G is not used, or do i need to something to make it avaliable


Thanks

Shambu

Fady (Google Cloud Platform)

unread,
Feb 25, 2018, 3:20:15 PM2/25/18
to gce-discussion

Hello Shambu,


When you resize a disk that is attached to an instance with the latest public images, and  according to this document, restarting the instance should be enough to automatically resize it’s partitions and file-systems with the exception of SUSE Linux Enterprise Server. Alternatively, to resize the partition and filesystem without rebooting, you can execute these commands:


sudo growpart /dev/sda 1   (space between disk ID and partition number)

sudo resize2fs /dev/sda1

Checking the output you provided, it seems that the disk is successfully resized, and it is rather a different file-system issue with your OS like running out of inodes. I found these community questions that could be helpful for your case [1] [2]. For further help, I encourage you to post your question at serverfault with the right Linux file-system tags, where you have access to a large community of enthusiasts and experts to share ideas with and get support from.


Reply all
Reply to author
Forward
0 new messages