I am trying to set up a "scratch" local SSD on Google Cloud Platform / Google Compute Engine in a start script for a preemptable instance to be run on VM creation. No valuable data is on the VM when this script is run.
After creating a VM with a local SSD from gcloud
or the web console, there is some setup to do on the VM.
Local SSD Documentation says I should:
- identify the ssd block device with
lsblk
- format it with
mkfs.ext4 -F /dev/[block-dev-from-part1]
- mount it somewhere && enjoy
But in step 2 I get an error that /dev/sdb1
is not found.
fdisk
reveals that /dev/sdb
exists but has no partition table.
I could use fdisk manually and that works, but how can I partition the SSD and setup in a start script?