0

I am running a JupyterHub server on a Google Cloud Compute instance and recently had an issue where I ran out of hard drive space, which caused the JupyterHub server to seize up with 500 errors etc. I should mention that I am using The Littlest JupyterHub to run the JupyterHub server. I had a look at options to expand the hard drive space of my instance and the recommended action seemed to be to attach a zonal persistent disk. I followed Google's instructions and it looks to be attached as expected. See output of df -h below, which suggests that it has been mounted as expected.

Output of df -h suggests that it has been mounted as expected

However, I can't work out if this new hard drive is actually being used for storage by the VM / JupyterHub server. I'm worried that as I continue to use the JupyterHub server it will just fill up the original 20GB /dev/sda1 disk again, without using the new 200GB /dev/sdb for overfill. How can I check to see if the zonal persistent disk will be used as expected, to avoid JupyterHub seising up because there is no hard disk space left?

I really am not an expert at this, so apologies in advance if this is a dumb question.

Thanks in advance!

Jack Power
  • 303
  • 1
  • 3
  • 14

2 Answers2

0

You can check this link to change the directory that is being used by your JupyterHub server.

Another workaround will be increasing your default disk size (sda1). You can do this by stopping your instance first, then go to Compute Engine > Disks. Click the disk of your instance, then click Edit at the top of the page. Put in the new size of the disk you want then click Save.

Alex G
  • 1,179
  • 3
  • 15
0

I think the easiest way to resolve this issue is to resize your filesystem /dev/sda1 You can check this document for more information.

  1. Go to the VM instances page.
  2. Stop your instance.
  3. Go to the Disks page to see a list of zonal persistent disks in your project.
  4. Click the name of the disk that you want to resize.
  5. On the disk details page, click Edit.
  6. In the Size field, enter the new size for your disk.
  7. Click Save to apply your changes to the disk.
  8. Start again your instance.

I reproduce it in my own instance This is my the Filesystem before the change enter image description here

After resize the my disk:

enter image description here

Another option for your case is to Resizing the file system and partitions on a zonal persistent disk in order that the operating system can access the additional space.

Jose Luis Delgadillo
  • 2,348
  • 1
  • 6
  • 16
  • Thanks Jose. One question, I followed your method and then tried to resize the system so that the operating system could access the new space. I followed the link you provided. I understand, because it is a boot disk, I had to follow step 4 and use growpart to grow the partition. However, when I do this, by running "sudo growpart /dev/sda 1". I get the following error "NOCHANGE: partition 1 is size 83658719. it cannot be grown". Then when I skip to the next step 5 and try "sudo resize2fs /dev/sda", I get "The filesystem is already 10457339 (4k) blocks long. Nothing to do!". Any ideas? – Jack Power Oct 01 '20 at 21:00
  • I think you should to unmount the secondary disk that you already mounted, and just follow the steps for the first option to resize the boot disk. In this way you will be able to see the changes immediately. On the other hand if you want to continue adding this disk I found [this post](https://unix.stackexchange.com/questions/441789/resize2fs-fail-to-resize-partition-to-full-capacity/441934#441934) where this error is solved. – Jose Luis Delgadillo Oct 01 '20 at 22:06