This page provides an overview of the Container-Optimized OS from Google filesystem and describes how to mount and format disks.
The root filesystem is mounted as read-only to protect system integrity.
However, home directories and
/mnt/stateful_partition are persistent and
The following is a list of paths in the Container-Optimized OS node image file system, along with their properties and recommended usage:
||The root filesystem is mounted as read-only to maintain integrity. The kernel verifies integrity root filesystem during boot up, and refuses to boot in case of errors.|
||These paths are meant for storing data that persists for the lifetime of the boot disk. They are mounted from /mnt/stateful_partition.|
||These paths are working directories for Compute Engine packages (for example, the accounts manager service), Docker, and Toolbox respectively.|
||This path is the working directory of the cloud-init package.|
||/etc typically holds your configuration (for example,
||/tmp is typically used as a scratch space and should not be used to store persistent data.|
||You can mount Persistent Disks at directories under /mnt/disks.|
Mounting and formatting disks
You can attach a persistent disk or create an instance with Local SSDs when using Container-Optimized OS from Google. Follow the instructions on Formatting and mounting a persistent disk or Format and mount a local SSD device for the appropriate use-case.
The disks can be mounted by creating a subdirectory under
/etc/ is stateless on Container-Optimized OS from Google, you cannot use
to automatically fsck (file system consistency check) and mount the disks on boot.
But you can achieve the same by doing those operations from the
section in your
#cloud-config bootcmd: - fsck.ext4 -tvy /dev/[DEVICE_ID] - mkdir -p /mnt/disks/[MNT_DIR] - mount -t ext4 -O ... /dev/[DEVICE_ID] /mnt/disks/[MNT_DIR]
- [DEVICE_ID] is the device ID of the disk that you want to format and mount.
- [MNT_DIR] is the directory in which to mount your disk.
For an existing instance, use the
--metadata-from-file flag to update cloud-init
gcloud compute instances add-metadata instance-name \ --metadata-from-file user-data=filename
Replace the following:
- instance-name: the name of your VM instance.
- filename: the name of the metadata file.