An Associate Cloud Engineer needs to add an additional non-boot persistent disk to an existing Compute Engine Linux VM instance and prepare it for application data storage. What is the correct sequence of steps to provision, attach, and configure this storage resource?
- 1Create a new Persistent Disk resource using `gcloud compute disks create` in the same zone as the VM instance.
- 2Attach the Persistent Disk to the running VM instance using `gcloud compute instances attach-disk`.
- 3SSH into the VM instance and format the raw block device with an ext4 filesystem using `sudo mkfs.ext4`.
- 4Create a mount target directory and mount the formatted disk device using `sudo mount`.
Answer
The correct operational sequence is: 1) Create the Persistent Disk via gcloud compute disks create, 2) Attach the disk to the VM instance via gcloud compute instances attach-disk, 3) SSH into the VM and format the raw device using sudo mkfs.ext4, and 4) Create a target directory and mount the formatted disk using sudo mount.
The correct workflow follows a standard infrastructure provisioning and operating system administration pattern. First, the cloud resource must be provisioned in GCP using the `gcloud compute disks create` command. Second, the newly created disk resource is attached to the VM instance via `gcloud compute instances attach-disk`. Third, within the VM's SSH session, the Linux operating system formats the newly recognized raw block device with an `ext4` filesystem using `sudo mkfs.ext4`. Finally, the formatted filesystem is mounted to a designated local directory using `sudo mount`.
Step-by-Step Solution
Key Concept
Compute Engine Persistent Disk provisioning, attachment, formatting, and mounting lifecycle.
Estimated Time:1m 30s