gcloud compute disks create dev-postgres-master --size=500GB --type=pd-standard
gcloud compute instances create viet-temp
gcloud compute instances attach-disk viet-temp --disk=dev-postgres-master
gcloud compute ssh viet-temp
- Use this command to list all the disks on this instance:
sudo lsblk
- Assuming your new disk is
/dev/sbd
, use these commands to format it
sudo mkfs.ext4 -m 0 -F -E lazy_itable_init=0,lazy_journal_init=0,discard /dev/sdb
sudo mkdir -p /data
sudo mount /dev/sdb /data
sudo chmod -R 777 /data
sudo umount /data
gcloud compute instances detach-disk viet-temp --disk=dev-postgres-master
gcloud compute instance delete viet-temp