3
votes

I have just set up my first Google Cloud Compute Engine instance so I can run some Python scripts on large files. As part of the setup I added a 1TB persistent disk:

Screenshot of GCE showing persistent disk 1TB

When I SSH into the the virtual machine I don't see the storage added. This means I can't download my dataset.

Screenshot of SSH into vm and running <code>df</code> command

How do I access the persistent disk?

Thanks.

1

1 Answers

4
votes

When you add an additional persistent disk that makes the disk available to your compute engine but you must then format it and mount it before use. This is similar to the notion of adding an additional physical disk to your desktop. Just adding a disk means it is there from a hardware perspective but it must still be defined to the operating system.

There is documentation on the recipe here (Adding or resizing zonal persistent disks)

In summary:

  1. Use sudo lslbk to find the device id.
  2. Format the disk using sudo mkfs.ext4.
  3. Use sudo mkdir to create a mount point.
  4. Use sudo mount to mount the file system.

You can also edit /etc/fstab to mount the file system at boot time.