'How can I allocate extra disk space of my Google Cloud Platform(GCP) instance to my R server
I would like to know how to allocate extra disk space of my VM to my R server on Google Cloud Platform(GCP)
I established an R server on GCP based on a number of tutorials on the internet. My instance runs on ubuntu 18.04LTS. I succeeded in installing base R and Rstudio. I could run some basic analyses with the server.
tutorial examples: https://towardsdatascience.com/r-studio-server-on-google-cloud-dd69b8bff80b https://yuhuisdatascienceblog.blogspot.com/2017/07/setting-up-r-studio-server-on-google.html
However, I realized that the disk usage of the working directory for my R server was too low after running du -h
#the working directory for my R server
twinring77@instance-1:~$ pwd
/home/twinring77
#the disk usage of my R server
twinring77@instance-1:~$ du -h
...
2.2G ./yard/apps/cellranger-6.1.2
3.0G ./yard/apps
3.0G ./yard
4.2G .
It turns out I cannot remotely download any files bigger than 4.2 GB to my working directory on my R server.
Thus I added an extra 1.1TB disk to GCP instance by adding an extra disk based on a tutorial that Google provided tutorial: https://cloud.google.com/compute/docs/disks/add-persistent-disk
I also expanded the original free trial disk I was using (10GB) to 1.1TB
After that, I ran df –h to check extra disk space.
twinring77@instance-1:~$ df -h
Filesystem Size Used Avail Use% Mounted on
udev 59G 0 59G 0% /dev
tmpfs 12G 748K 12G 1% /run
/dev/sda1 1.1T 11G 1.1T 2% /
tmpfs 59G 0 59G 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 59G 0 59G 0% /sys/fs/cgroup
/dev/sda15 105M 4.4M 100M 5% /boot/efi
/dev/sdb 1.1T 77M 1.1T 1% /mnt/disks/MOUNT_DIR
tmpfs 12G 0 12G 0% /run/user/1001
So essentially my instance has 2.2TB of free disk space
There were some tutorials online about resizing or adding disk space to a VM instance. However I was unable to find out how to precisely allocate it to a server established based on the instance.
In conclusion, I have plenty of free disk space in my instance that I can spare for my R server. I would like to how to allocate this free disk space for my R server so that I can download/process bigger data.
ps. I’m new to this community and this is actually my first question posted. I tried to make all my questions clear after reading many but I’m sorry if I made any mistakes in the process. Please feel free to let me know if I need to correct my questions
Thank you in advance.
Solution 1:[1]
Shutting down my gcp instance solved the issue.
The extra disk space can be allocated after the instance is stopped and will reflect on the next start.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | zhrist |
