A new VM comes with one disk, the boot disk, which holds the operating system. When you need more room for data, you can add a second disk. A Compute Engine persistent disk is network storage that you create separately and attach to a VM, and it can outlive the VM it was first attached to.
Attaching a new disk is only half the job. The VM sees a blank, unformatted device, and until you format it with a file system and mount it, it cannot hold files. Google’s guide says that for a new, blank disk you must format and mount it. This guide covers every step, including the careful part, making sure you format the new disk and not another one.
This walks through creating and attaching a disk in the console, formatting it, mounting it, and keeping it mounted after a reboot.
Prerequisites:
Open the console, then Click Menu > Compute Engine > VM instances.

Click the instance you want to add the disk to.


In the Additional disks section, click Add new disk.

Give the disk a name and choose the disk type.

Enter the size you want for the disk.

Click Done. The disk is defined, but it is not attached yet.

Click Save. Only then is the disk created and attached to the instance.

Open the Disks tab. It lists the disks attached to the VM, including the new one.

Back on VM instances, click SSH next to the machine you added the disk to.

lsblk
This lists the disks the VM can see. Find the new one by its size, which should match what you entered, and read its device name from the output. On many VMs it is sdb, but do not assume. Some newer machine series show disks with different names, and with several disks attached, the new one may not be sdb. Everything below uses DEVICE_NAME for this name, so replace it with what lsblk shows, and check it twice, because formatting the wrong disk destroys its data.

Google’s guide formats the whole disk without partitioning it, which is simpler, and you can skip to the formatting step and use the device name directly. The original page partitions the disk first, which is also valid. If you want a partition, start the partition tool on the disk you identified:
sudo fdisk /dev/DEVICE_NAME
Type m to list the available commands.

Type n to create a new partition, and p for a primary partition if you are asked, then a partition number, such as 1. When asked for sizes, pressing Enter accepts the defaults, which use the whole disk. Type w to write the changes.

Run lsblk again. It should show the new partition under the disk, which is then called DEVICE_NAME followed by 1.
lsblk

If the partition does not show up, tell the kernel to re read the partition table with the partprobe command, and check again.
sudo partprobe
Create a folder for the disk under mnt, not under dev. The original page created it inside dev, which is a system directory that is rebuilt at every boot:
sudo mkdir -p /mnt/disks/MOUNT_DIR

This step erases everything on the device you name, so be certain it is the new, blank disk. If you made a partition, use the partition name. If you did not, use the disk name. Google’s approach uses these options:
sudo mkfs.ext4 -m 0 -E lazy_itable_init=0,lazy_journal_init=0,discard /dev/DEVICE_NAME
The original page used a plain mkfs.ext4 command on the partition, which also works. Either way, this creates an ext4 file system. Do not run it on a disk that already holds data you want to keep. The Adding an Existing Disk Into a New VM guide in this series covers mounting a disk that already has data.

A mount made by hand is lost on reboot. To make it permanent, add the disk to fstab. First make a backup, then find the disk’s UUID:
sudo cp /etc/fstab /etc/fstab.backup
sudo blkid /dev/DEVICE_NAME
If you made a partition, use the partition name in the blkid command, since the UUID belongs to the file system you formatted. Then open the file in an editor. The original page uses vi:
sudo vi /etc/fstab

In vi, press i to switch to editing mode.

Add one line, using the UUID that blkid showed and the folder you made. The original line used the device name and a folder under dev. This version uses the UUID, a folder under mnt, and nofail:
UUID=UUID_VALUE /mnt/disks/MOUNT_DIR ext4 discard,defaults,nofail 0 2
Press escape, then type a colon, then wq, then press Enter to save and quit.

Mount everything listed in fstab, which also tests that your new line is valid. The original page wrote the flag with an en dash, which fails. It needs a real hyphen:
sudo mount -a
lsblk
The disk now shows a mount folder in the lsblk output. If it does not, check the line you added to fstab. If you only want a mount right now, without waiting for fstab, you can mount it directly:
sudo mount -o discard,defaults /dev/DEVICE_NAME /mnt/disks/MOUNT_DIR

A new file system is usually writable only by the root user. Set the folder’s permissions to suit the people who need it, and avoid opening it to everyone unless that is what you intend.
Because you added an fstab entry, remember to remove it before you detach the disk. The Removing Disks From Instances guide in this series covers that.
That covers adding a new disk to a Google Cloud VM, formatting it, and mounting it safely. To go further, explore Prwatech’s Google Cloud training program, which includes placement assistance.