Reputation: 2146
I am doing large data processing on Google Cloud Platform (GCP) but have run into disk storage issues overnight.
1) My disk size has hit the limit of 2TB:
df -h
Filesystem Size Used Avail Use% Mounted on
udev 16G 0 16G 0% /dev
tmpfs 3.1G 11M 3.1G 1% /run
/dev/sda1 2.0T 1.9T 0 100% /
tmpfs 16G 0 16G 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 16G 0 16G 0% /sys/fs/cgroup
2) I increased (naively) the disk size to 3TB
sudo lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 3T 0 disk
└─sda1 8:1 0 2T 0 part /
3) and tried to grow the disk size
sudo growpart /dev/sda 1
NOCHANGE: partition 1 could only be grown by 1 [fudge=2048]
but I cannot grow it.
Question:
How can I use the extra 1TB from the 3TB disk? Any better ways to make use of the extra 1TB for my project are much appreciated.
Note: I am a newbie to GCP and do not understand it yet.
Upvotes: 0
Views: 1824
Reputation: 75735
Do you have mount the new persistent disk? You should see it with lsblk command. [This page)(https://cloud.google.com/compute/docs/disks/add-persistent-disk) can help you to perform the required steps
Create a partition and format it
sudo mkfs.ext4 -m 0 -F -E lazy_itable_init=0,lazy_journal_init=0,discard /dev/sdb
Create your directory where to mount the partition
mkdir -p /path/to/mount/
Mount the partition
sudo mount -o discard,defaults /dev/sdb /path/to/mount
Don't forget to update the right on the directory with a chmod
according with your security policy
Then, use standard linux command to copy/move files/directory in the new directory where your persistent disk is mounted I recommend you to let the app running on the boot disk and to store the data on the persistent disk.
Don't forget to follow the tutorial until the fstab update for an automatic disk mount at VM startup
Upvotes: 0
Reputation: 75735
You can attach additional disk. 2 solutions: local SSD and persistent disk.
Local SSD are ephemeral storage. The disk are empty when the instance start but the performance are incredible. You can attach up to 8 disk of 375go.
The other solution is to attach persistent disk. Slower but with high resiliency and backup. Max 64to per disk. And, in beta, you can attach up to 128 disks to a 8vCPU (or more) instance. Else Max 16 disks in GA
Here how to attach a persistent disk: https://cloud.google.com/compute/docs/disks/add-persistent-disk?hl=fr
You should have enough!!!👍
Upvotes: 1