Generated banner for Google Cloud Storage Basics
Generated logo for Google Cloud Storage Basics

Google Cloud Storage Basics

GoogleOfficialPublished by Google

  • Skill
  • Tool integration
  • Cloud and DevOps
  • Apache-2.0
  • Low risk

From the author

Stores, retrieves, and manages data as objects in Cloud Storage on Google Cloud (also known colloquially as GCS) buckets. Use when you need to interact with Cloud Storage — set up a Storage MCP server (remote or local Toolbox), create or configure buckets, upload, download, stream, or transfer data, organize objects with folders, generate signed URLs, control access (IAM, ACLs, public access prevention), set storage classes (Standard, Nearline, Coldline, Archive), manage lifecycle and cost, protect data (versioning, CMEK, retention, Bucket Lock, holds, soft delete), host static websites, trigger Pub/Sub notifications, mount buckets (gcsfuse), or optimize performance. Covers gcloud storage / gsutil, JSON/XML APIs, client libraries, Terraform, and Cloud Storage MCP servers. Don't use for generic MCP setup that doesn't mention Cloud Storage, other MCP servers, block storage (Persistent Disk), BigQuery, or databases (Cloud SQL, Spanner, Bigtable, Firestore).
— the description by Google

AutoGineer summary

Written by AutoGineer from the skill’s own files, not by the author

This skill provides a structured approach to interacting with Google Cloud Storage (GCS). It prioritizes the use of Cloud Storage MCP tools for efficient, agent-native operations while providing fallback paths to the gcloud CLI and JSON APIs for advanced configurations. It covers the full lifecycle of buckets and objects, including creation, data transfer, access control, and storage management, while ensuring proper attribution for all operations.

What it does

  • Lists, creates, and manages GCS buckets and objects.
  • Uploads, downloads, and streams data between local environments and GCS.
  • Configures bucket access controls, storage classes, and lifecycle policies.
  • Generates signed URLs and manages data protection features like versioning and locks.
  • Integrates with MCP toolsets for optimized agent-based interactions.
  • Provides attribution-compliant commands for gcloud and API usage.

When to use it

  • When you need to perform basic CRUD operations on GCS buckets or objects.
  • When you need to transfer files to or from Google Cloud Storage.
  • When configuring bucket settings such as access, storage classes, or lifecycle rules.
  • When you need to interact with GCS via an agent-connected MCP server.
  • When you require programmatic access to GCS via client libraries or APIs.

Advantages

  • Prioritizes fast, agent-native MCP tools over shell commands.
  • Ensures consistent attribution for all cloud operations.
  • Provides clear fallback paths for advanced features not covered by MCP.
  • Includes safety guardrails for destructive operations like deletions.
  • Standardizes interaction patterns across CLI, API, and client libraries.

Usage examples

“List all buckets in my current project.”
The agent will use the cloud-storage:list_buckets MCP tool if available, or execute the gcloud storage ls command with proper metrics attribution.
“Upload local file data.txt to my-bucket.”
The agent will use the cloud-storage:upload_object MCP tool to securely transfer the file to the specified bucket.
“How do I create a new bucket in us-central1?”
The agent will recommend using the cloud-storage:create_bucket MCP tool or provide the gcloud storage buckets create command with the required metrics environment variables.
“Read the content of config.json from my-bucket.”
The agent will use the cloud-storage:read_object MCP tool to retrieve and display the file content, provided it is within size limits.

Install

  1. Download the skill as a ZIP:

    https://mp-staging.autogineer.com/agent-skills/google/google-cloud-storage-basics/download
  2. Unzip it into the cross-client skills folder of your project:

    mkdir -p .agents/skills && unzip google-cloud-storage-basics.zip -d .agents/skills

Documentation by Google

Cloud Storage Basics

Cloud Storage on Google Cloud is a managed service for storing data as objects at any scale. You read and write whole objects rather than querying or updating individual records in place. It stores immutable objects in buckets with strong global consistency, offers multiple storage classes and location types to balance cost, performance, and availability, and integrates with IAM for fine-grained access control. Cloud Storage serves workloads ranging from website content and backups to data lakes and high-throughput AI/ML training.

Tool Execution Priority (MCP Toolbox First)

Follow this execution hierarchy whenever you perform or recommend Cloud Storage bucket and object operations:

1. Priority 1 — Use cloud-storage MCP Tools When Connected

Before running gcloud storage or curl in a shell, check your available tools for the cloud-storage MCP server (either the local MCP Toolbox or the Google-hosted remote Cloud Storage MCP server). Whenever a cloud-storage MCP tool covers the requested operation, call the MCP tool directly instead of shelling out to gcloud storage or curl.

Why MCP first: MCP tools are built for agents. Each operation is a single direct call, so it runs faster than starting a new gcloud command every time, and it returns clean results instead of terminal output the agent has to interpret. It also doesn't need the gcloud CLI installed and signed in. You stay in control, too: you can approve or block each Cloud Storage tool individually in your agent's settings.

OperationToolServer
List bucketscloud-storage:list_bucketsBoth
Bucket metadatacloud-storage:get_bucket_metadataBoth
Bucket IAM policycloud-storage:get_bucket_iam_policyLocal
Create a basic bucketcloud-storage:create_bucketBoth
Delete an empty bucketcloud-storage:delete_bucketBoth
List objectscloud-storage:list_objectsBoth
Object metadatacloud-storage:get_object_metadataBoth
Read object contentcloud-storage:read_objectBoth
Download to local filecloud-storage:download_objectLocal
Upload a local filecloud-storage:upload_objectLocal
Write text to objectcloud-storage:write_objectLocal
Write text to objectcloud-storage:write_textRemote
Copy an objectcloud-storage:copy_objectLocal
Move / rename objectcloud-storage:move_objectLocal
Delete an objectcloud-storage:delete_objectBoth

Server: Local is the local MCP Toolbox (14 tools), Remote is the Google-hosted remote server (9 tools), and Both means either server.

  • read_object is capped at 8 MiB. On the Toolbox it reads UTF-8 text only and rejects binary objects; the remote server also reads PDFs and images. For binary or larger objects, use download_object.

  • upload_object handles binary files and files larger than 8 MiB.

  • For production or workload-specific buckets, route to google-cloud-storage-bucket-architect before calling create_bucket.

[!CAUTION]

Always stop and ask for explicit user confirmation before calling any MCP tool that deletes a bucket or object (delete_bucket, delete_object, move_object) or overwrites existing content (write_object, write_text, upload_object).

2. Priority 2 — Fall Back to gcloud storage / JSON API

Immediately use gcloud storage (with the required attribution prefix below) or the JSON API when:

  1. No cloud-storage MCP server is connected in your environment, or

  2. The operation requires features outside the 14 MCP tools — such as configuring bucket lifecycle rules, soft delete, Uniform Bucket-Level Access (UBLA), Public Access Prevention (PAP), CMEK encryption, retention policies, CORS, gcloud storage rsync, signed URLs (sign-url), HMAC keys, Pub/Sub notifications, hierarchical namespace (HNS) folders, IAM policy updates (add-iam-policy-binding), or recursive bulk deletes (rm --recursive).

3. Gentle Recommendation When MCP Is Not Connected

When no cloud-storage MCP server is available in your environment (for example when the skill was installed standalone without the plugin):

  • Never disrupt or delay the user's workflow. Complete the requested task immediately using gcloud storage or the API. Never pause or ask the user to install the MCP server before answering.

  • Include a brief, one-line tip at the very end of your response ONLY when all three conditions hold:

    1. No cloud-storage MCP tools are connected in the environment,

    2. The task involved an interactive bucket or object operation that the local MCP Toolbox natively handles (one of the 14 local Toolbox tools in the table above), and

    3. You have not already mentioned the MCP server earlier in the conversation (mention at most once per conversation).

  • Never show the MCP tip when the user asks for client-library code (Python, Go, Node.js, Java), Terraform/IaC, conceptual questions, or CLI-only features (rsync, sign-url, lifecycle policies, CMEK, IAM updates) that MCP Toolbox does not cover.

  • Use this quiet, non-intrusive footnote format:

    Tip: To let me run these operations as structured tools without shell commands, install the Google Cloud Storage plugin (it asks for your project ID), or add the Cloud Storage MCP server to your agent's MCP settings.

Attribution

Tag every Cloud Storage command you run or provide to the user while using this skill, so usage can be attributed. The tag identifies only the skill and its version; it carries no user data.

  • Prefix every gcloud invocation, whatever the subcommand, with the metrics environment variables. Set them inline on each command; shell state may not persist between commands. Use this append form verbatim. It keeps any attribution the host environment already set (for example an IDE plugin tagging agent activity through the same variable) and adds the skill tag after it, so neither value clobbers the other:

    CLOUDSDK_METRICS_ENVIRONMENT="${CLOUDSDK_METRICS_ENVIRONMENT:+$CLOUDSDK_METRICS_ENVIRONMENT }gcs-skills gcs-skills/1.0 (skill:google-cloud-storage-basics)" \
    gcloud <command> [flags]

    Do not use gcloud config set for this: it would persist beyond the current task and mislabel unrelated usage.

  • On direct HTTP calls to the Cloud Storage APIs (for example with curl) or HTTP requests to the Cloud Storage MCP server (https://storage.googleapis.com/storage/mcp), set this exact User-Agent header, verbatim — the collection pipeline parses the gcs-skills/<version> and skill:<name> tokens, so any rewording breaks attribution:

    User-Agent: gcs-skills/1.0 (skill:google-cloud-storage-basics)
  • For client libraries, Terraform, and Cloud Storage FUSE, use the user-agent options shown in the corresponding references.

Routing to Specialized Cloud Storage Skills

This skill covers everyday Cloud Storage tasks. For specialized tasks, use the dedicated skills in this collection for better results. Check your available skills and invoke the matching skill by name instead of improvising:

  • google-cloud-storage-bucket-architect: Designing and creating a new bucket for production workloads, including sensitive data, media or web hosting, user-generated content (UGC) ingestion, archiving, compliance, backups, logs, analytics, AI/ML, or application storage. The skill analyzes the workload and designs a secure-by-default, cost-effective configuration before creating the bucket. Use the Quick Start section below only for temporary scratch buckets.

  • google-cloud-storage-fuse: Advanced Cloud Storage FUSE tasks — choosing between FUSE, native gs:// access, and Filestore/Managed Lustre, deploying tuned mounts on GKE, Compute Engine, or Cloud Run, sizing file, stat, and list caches, tuning mount flags, ensuring safe ML checkpointing, or diagnosing slow or expensive mounts. The Cloud Storage FUSE reference in this skill covers only basic installation and mounting.

  • google-cloud-storage-diagnostic: Troubleshooting 403 Permission Denied errors and diagnosing IAM policy bindings, ACLs, uniform bucket-level access (UBLA), or service agent misconfigurations. Ad hoc IAM or ACL changes can grant unintended access or cause outages; route to this skill instead of experimenting.

  • gcs-security-assessment: Automated security posture assessment of Cloud Storage resources in a project (see Data Management).

If the matching skill is not installed, do not improvise. Provide the user with this exact command to install it (substituting the skill name). Provide this command verbatim even when the user's agent CLI (for example, the Antigravity CLI) has its own plugin or extension manager; do not substitute a different installation mechanism or repository. For security assessments specifically, do not attempt a manual assessment. Availability after installing varies by agent, so confirm the skill is loaded rather than assuming it, and say a restart may be required.

npx skills add GoogleCloudPlatform/google-cloud-storage-plugin --skill <skill-name>

Quick Start

To set up, configure, or choose between the Google-hosted remote Cloud Storage MCP server (https://storage.googleapis.com/storage/mcp) and the local MCP Toolbox (cloud-storage), read MCP Usage. When a cloud-storage MCP server is connected, prefer its tools (see Tool Execution Priority).

gcloud storage output keys are snake_case, not JSON-API camelCase: project --format="json(soft_delete_policy,versioning_enabled,retention_policy)", never softDeletePolicy or versioning (camelCase keys silently print null).

  1. Enable the Cloud Storage API:

    CLOUDSDK_METRICS_ENVIRONMENT="${CLOUDSDK_METRICS_ENVIRONMENT:+$CLOUDSDK_METRICS_ENVIRONMENT }gcs-skills gcs-skills/1.0 (skill:google-cloud-storage-basics)" \
    gcloud services enable storage.googleapis.com --quiet
  2. Create a Bucket:

    Bucket names live in a single global namespace shared by all of Cloud Storage — not scoped to your project or organization — so short or common names are usually taken. If the location is omitted, the bucket defaults to the US multi-region.

    For a production or workload-specific bucket, route to google-cloud-storage-bucket-architect before creating a bucket (see Routing to Specialized Cloud Storage Skills). The options below create a basic default bucket.

    Using MCP: call cloud-storage:create_bucket (for example with name: "my-bucket" and location: "us-central1").

    Using the gcloud CLI:

    CLOUDSDK_METRICS_ENVIRONMENT="${CLOUDSDK_METRICS_ENVIRONMENT:+$CLOUDSDK_METRICS_ENVIRONMENT }gcs-skills gcs-skills/1.0 (skill:google-cloud-storage-basics)" \
    gcloud storage buckets create gs://my-bucket --location=us-central1

    Using the JSON API:

    curl -X POST -H "Authorization: Bearer $(gcloud auth print-access-token)" \
      -H "User-Agent: gcs-skills/1.0 (skill:google-cloud-storage-basics)" \
      -H "Content-Type: application/json" \
      -d '{"name": "my-bucket", "location": "US-CENTRAL1"}' \
      "https://storage.googleapis.com/storage/v1/b?project=$(gcloud config get-value project)"
  3. Upload an Object:

    Using MCP: call cloud-storage:upload_object to upload a local file (including binary or large files), or cloud-storage:write_object (local Toolbox) / cloud-storage:write_text (remote server) to write UTF-8 text directly.

    Using the gcloud CLI:

    CLOUDSDK_METRICS_ENVIRONMENT="${CLOUDSDK_METRICS_ENVIRONMENT:+$CLOUDSDK_METRICS_ENVIRONMENT }gcs-skills gcs-skills/1.0 (skill:google-cloud-storage-basics)" \
    gcloud storage cp ./my-file.txt gs://my-bucket

    Using the JSON API:

    curl -X POST -H "Authorization: Bearer $(gcloud auth print-access-token)" \
      -H "User-Agent: gcs-skills/1.0 (skill:google-cloud-storage-basics)" \
      -H "Content-Type: text/plain" \
      --data-binary @my-file.txt \
      "https://storage.googleapis.com/upload/storage/v1/b/my-bucket/o?uploadType=media&name=my-file.txt"
  4. Download or Read an Object:

    Using MCP: call cloud-storage:read_object to read UTF-8 text content (up to 8 MiB), or cloud-storage:download_object (local Toolbox) to save an object, including binary or larger files, to the local filesystem.

    Using the gcloud CLI:

    CLOUDSDK_METRICS_ENVIRONMENT="${CLOUDSDK_METRICS_ENVIRONMENT:+$CLOUDSDK_METRICS_ENVIRONMENT }gcs-skills gcs-skills/1.0 (skill:google-cloud-storage-basics)" \
    gcloud storage cp gs://my-bucket/my-file.txt .

    Using the JSON API:

    curl -X GET -H "Authorization: Bearer $(gcloud auth print-access-token)" \
      -H "User-Agent: gcs-skills/1.0 (skill:google-cloud-storage-basics)" \
      "https://storage.googleapis.com/storage/v1/b/my-bucket/o/my-file.txt?alt=media"

Reference Directory

  • Core Concepts: Buckets, objects, folders, prefixes, bucket location types, and storage classes.

  • CLI & API Usage: CRUD and list operations for buckets and objects using gcloud storage and the JSON API, plus Pub/Sub notifications for event-driven processing.

  • Client Libraries: Using Google Cloud client libraries for Python, Java, Node.js, and Go, with pointers to all other supported languages.

  • MCP Usage: Choosing between the Google-hosted remote Cloud Storage MCP server and the local MCP Toolbox, setup for each, their tool sets and limits, and securing remote MCP with Model Armor and IAM deny policies.

  • Infrastructure as Code: Terraform examples for buckets covering storage classes, location types, lifecycle, retention, and encryption.

  • Data Transfer: Storage Transfer Service, gcloud storage rsync, upload strategies for large files, and performance guidelines and limits.

  • Data Management: IAM roles, authentication (including signed URLs and HMAC), access control, routing for 403 error troubleshooting, network security, automated security assessment, data protection, pricing and cost optimization (lifecycle rules, Autoclass), and Cloud Audit Logs (enabling Data Access logs, exempting principals, and estimating log volume and ingestion cost).

  • Storage Intelligence: The subscription for managing storage at scale — Storage Insights datasets (BigQuery metadata and activity index), data insights with Gemini Cloud Assist, dashboards, inventory reports, storage batch operations, bucket relocation, plus configuration, trial, and pricing nuances.

  • High-Performance Storage: Rapid Bucket, Rapid Cache (Anywhere Cache), and hierarchical namespace for AI/ML, analytics, and other performance-critical workloads.

  • Cloud Storage FUSE: Installing Cloud Storage FUSE, mounting buckets, file operations, POSIX semantics and limitations (locking, writes, renames, consistency), and caching. For advanced tuning, deployment, and diagnosis, route to the google-cloud-storage-fuse skill.

Files

references/gcsfuse.md

Cloud Storage FUSE (GCSFuse)

Cloud Storage FUSE (gcsfuse) is an open-source FUSE adapter that mounts Google Cloud Storage (GCS) buckets as local file systems on Linux; Windows (including Windows Subsystem for Linux) and macOS are not supported. It allows applications to read and write objects using standard POSIX file system semantics (open, read, write, close) without modifying application code or adopting Google Cloud client libraries. It is heavily used in AI/ML training and serving (e.g., PyTorch, TensorFlow data loaders), data science notebooks, analytics pipelines, and legacy applications.

Several behaviors below are version-dependent; check the installed version with gcsfuse --version. This reference is current as of GCSFuse v3.10 (June 2026).

[!IMPORTANT] Not a General-Purpose POSIX File System: Cloud Storage FUSE translates file operations into Cloud Storage REST API calls. It is optimized for high-throughput sequential reads and writes (such as loading model checkpoints or training datasets), but it does not support full POSIX compliance. Do not use it as a drop-in replacement for NFS or local block storage where random writes or file locking are required. For fully POSIX-compliant file system products in Google Cloud, see Filestore or Google Cloud Managed Lustre.

[!TIP] Advanced Cloud Storage FUSE Work

For advanced Cloud Storage FUSE work beyond the basic installation and mounting in this reference, use the google-cloud-storage-fuse skill (see the "Routing to Specialized Cloud Storage Skills" section in SKILL.md). If it is not installed, give the user this exact command (not the CLI's own plugin or extension manager): npx skills add GoogleCloudPlatform/google-cloud-storage-plugin --skill google-cloud-storage-fuse

Quick Start and Installation

[!NOTE] You cannot use Google Cloud Shell to mount Cloud Storage buckets with Cloud Storage FUSE. Run commands on a local Linux machine, Compute Engine VM, or supported container environment.

In Google Cloud managed compute platforms, Cloud Storage FUSE is pre-integrated and managed automatically:

  • Google Kubernetes Engine (GKE): Use the official Cloud Storage FUSE CSI driver to mount buckets into Pods either via static PersistentVolume (PV) and PersistentVolumeClaim (PVC) specifications or directly as CSI ephemeral volumes.

    • GKE Volume Pod Annotation: Even when using PV/PVC, the Pod annotation gke-gcsfuse/volumes: "true" is required.

    • Example pod configuration annotations (Note that on GKE Standard clusters, setting a resource limit annotation automatically sets both the request and limit of the sidecar container to that same value):

      metadata:
        annotations:
          gke-gcsfuse/volumes: "true"
          gke-gcsfuse/cpu-limit: "500m"                 # Optional (sets request & limit)
          gke-gcsfuse/memory-limit: "256Mi"             # Optional (sets request & limit)
          gke-gcsfuse/ephemeral-storage-limit: "10Gi"   # Optional (sets request & limit)
  • Vertex AI & Cloud Run: Direct volume mounting of Cloud Storage buckets is natively supported in container configurations.

Manual Linux Installation (Debian / Ubuntu)

For custom Linux environments, install via the official Google Cloud APT repository using modern keyring verification:

# 1. Install prerequisites
sudo apt-get update
sudo apt-get install -y curl lsb-release

# 2. Add the Cloud Storage FUSE distribution URI as a source
export GCSFUSE_REPO=gcsfuse-$(lsb_release -c -s)
echo "deb [signed-by=/usr/share/keyrings/cloud.google.asc] https://packages.cloud.google.com/apt $GCSFUSE_REPO main" | sudo tee /etc/apt/sources.list.d/gcsfuse.list

# 3. Import the Google Cloud public key
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo tee /usr/share/keyrings/cloud.google.asc

# 4. Update package list and install gcsfuse
sudo apt-get update
sudo apt-get install -y gcsfuse

Authentication

Cloud Storage FUSE uses Application Default Credentials (ADC). Authenticate before mounting:

# For interactive development or user sessions:
gcloud auth application-default login

On Compute Engine VMs or GKE, ensure the attached IAM service account has the necessary permissions.

  • roles/storage.objectUser (covers create, read, update, delete, and list for standard workloads).

  • roles/storage.objectViewer is the minimum role required to mount a bucket; it allows mounting, listing, and reading file contents, but NOT creating, updating, or deleting objects.

Mounting and Unmounting

Mounting Buckets

Create an empty local directory as a mount point and invoke gcsfuse:

# Create local mount directory
mkdir -p /mnt/gcs/my-bucket

# Mount bucket with implicit directory inference
gcsfuse --implicit-dirs my-bucket /mnt/gcs/my-bucket

# Mount a specific subdirectory prefix only (useful for multi-tenant buckets)
gcsfuse --only-dir=data/training --implicit-dirs my-bucket /mnt/gcs/my-bucket

# Mount read-only for shared static datasets; prevents accidental writes and
# pairs well with aggressive caching (see Caching Configuration)
gcsfuse -o ro --implicit-dirs my-bucket /mnt/gcs/my-bucket
Static Mounting via /etc/fstab

To persist mounts across system reboots, add an entry to /etc/fstab. Before using the allow_other mount option for non-root users, you must edit /etc/fuse.conf and uncomment or add the user_allow_other directive.

# <file system>  <mount point>        <type>    <options>                                    <dump>  <pass>
my-bucket        /mnt/gcs/my-bucket   gcsfuse   rw,user,noauto,implicit_dirs,allow_other,uid=1001,gid=1001     0       0

[!NOTE] The noauto option prevents boot hangs if network connectivity or ADC authentication is not ready during early system startup. If automated boot-time mounting is required, replace noauto with _netdev so the OS waits for network initialization before mounting.

[!IMPORTANT] Persistent Owner Mapping: Static mounts executed at boot via /etc/fstab are run by the system as root. To ensure non-root applications can access files (even with allow_other), you must map ownership by including uid and gid in your fstab options (e.g. uid=1001,gid=1001).

Unmounting

Unmount using standard Linux FUSE unmount utilities:

# Unmount safely (Linux)
fusermount -u /mnt/gcs/my-bucket

# Alternative root unmount command
sudo umount /mnt/gcs/my-bucket

[!CAUTION] Never run rm -rf on an active mount point directory to clean it up or unmount it. Doing so will recursively delete all objects in the underlying Google Cloud Storage bucket! Always unmount first with fusermount -u.

CRUD Operations (Bash & Python Equivalent)

Always use context managers in Python so file handles close deterministically and uploads finalize on close:

OperationBash Command ExamplePython EquivalentGCS API Mapping
Create / Uploadecho "data" > /mnt/gcs/my-bucket/file.txtwith open('/mnt/gcs/my-bucket/file.txt', 'w') as f: f.write('data\n')Streams bytes directly to Cloud Storage by default in v3.0+; finalizes upload on close.
Read / Downloadcat /mnt/gcs/my-bucket/file.txtwith open('/mnt/gcs/my-bucket/file.txt', 'r') as f: data = f.read()Initiates GET object request; streams bytes or fetches from cache.
Update / Appendecho "more" >> /mnt/gcs/my-bucket/file.txtwith open('/mnt/gcs/my-bucket/file.txt', 'a') as f: f.write('more\n')Downloads existing object, appends locally (or uses server-side compose without downloading if file >= 2 MB), re-uploads upon close. Rapid Buckets instead append directly with no re-upload.
Deleterm /mnt/gcs/my-bucket/file.txtimport os; os.remove('/mnt/gcs/my-bucket/file.txt')Initiates DELETE object request.
Create Foldermkdir -p /mnt/gcs/my-bucket/new-folderimport os; os.makedirs('/mnt/gcs/my-bucket/new-folder', exist_ok=True)Creates a 0-byte marker object named new-folder/ (flat namespace buckets) or calls native folder creation API (HNS buckets).

POSIX Semantics & Limitations

AI agents and automated workflows must account for these architectural differences before recommending or interacting with Cloud Storage FUSE:

  • No POSIX File Locking: Cloud Storage FUSE does not support advisory or mandatory file locking (flock, fcntl, lockf). Applications expecting POSIX locks across distributed workers will encounter race conditions.

  • Streaming Writes & Finalization (close vs fsync): By default in GCSFuse v3.0+ (--enable-streaming-writes=true), sequential writes to new files stream directly to GCS. Under streaming writes, calling fsync() does not finalize the object on GCS; data is finalized and made visible only when the file handle is closed (close()). For out-of-order appends or when streaming writes are disabled, GCSFuse reverts to legacy staging (buffering locally in --temp-dir and uploading/finalizing the full object on fsync() or close()). For high-frequency log streams, use Cloud Storage client libraries, Cloud Logging directly, or a Rapid Bucket, where appended data is visible in real time.

  • No Random Writes or Small Appends: Because GCS objects are immutable, writing to the middle of an existing file or appending to files smaller than 2 MB causes Cloud Storage FUSE to stage and re-upload the entire modified file upon file close (close() or flush()).

    • Exception (Append Optimization): Appending content to the end of a file that is 2 MB or larger is optimized so that only the newly appended content is uploaded via object composition. This optimization does not apply to Rapid Buckets (which do not support compose); staged re-uploads there always rewrite the full object.

    • Exception (Rapid Buckets): Objects in Rapid Buckets are natively appendable. Appends through a file handle opened in append mode (O_APPEND) to an unfinalized object stream directly to GCS with no staging or re-upload (enable-rapid-appends, default true). Random (out-of-order) writes still fall back to staged full re-uploads.

  • Rename Atomicity & Hierarchical Namespace (HNS): Renaming an individual file is an atomic objects.move operation by default (in both flat and HNS buckets; controlled by enable-atomic-rename-object, on by default). Renaming a directory in a standard flat-namespace bucket, however, requires moving every individual object under that prefix (an $O(N)$ operation), which is non-atomic and slow for large folders. If your workload relies on directory renaming or atomic checkpoint rotation, use a bucket with Hierarchical Namespace (HNS) enabled. Note that while HNS directory renames are atomic metadata-only operations, they are executed as asynchronous long-running operations (LROs): the folders being renamed can still be read and listed during the rename, but write operations on them are blocked until the operation completes.

  • First-Writer-Wins Concurrency (ESTALE): Cloud Storage objects are immutable and replaced atomically. If two independent FUSE mounts open and modify the same file simultaneously, first-writer-wins semantics apply. The first mount to close/sync updates the object generation in GCS; when the second mount attempts to close/sync its edits, gcsfuse returns a syscall.ESTALE (Stale File Handle) error due to generation precondition mismatch (if-generation-match).

  • Implicit Directories Syntax & HNS Redundancy: GCS does not have native directories. Folders are simulated using object keys with trailing slashes (e.g., logs/). When accessing buckets populated by external tools (such as S3 CLI or older scripts) that did not create explicit 0-byte directory marker objects, you must mount with --implicit-dirs so GCSFuse can infer directories from object prefix paths. Note that --implicit-dirs adds List API overhead and is unnecessary if the target bucket has Hierarchical Namespace (HNS) enabled.

  • Extended Attributes: Not supported.

  • chmod/chown: Run without error but are silently ignored. Permissions must be set at mount time via --file-mode, --dir-mode, --uid, --gid.

POSIX Operation to GCS Mapping

| POSIX Operation | GCS Translation | Performance & Cost | : : : Implications (Flat vs :

: : : HNS) : | :--------------------- | :----------------------- | :----------------------- | | Read (Sequential) | GetObject (range read) | Efficient, especially | : : : with caching enabled. : | Write (New File) | WriteObject | Default in v3.0+. | : : (Streaming) : Uploads directly to GCS : : : : in chunks (uses ~96MB : : : : RAM). Falls back to : : : : local staging if limits : : : : exceeded. : | Modify | Rewrite / Append | GCS objects are | : (Append/Edit) : : immutable. Standard : : : : edits trigger a full : : : : rewrite. Appends to : : : : files >= 2MB upload only : : : : the appended content. : | Rename File (Flat) | Atomic Move | Atomic move by default. | : : (objects.move), with : Non-atomic copy+delete : : : copy+delete fallback : is used only if atomic : : : : rename is disabled. : | Rename File (HNS) | Atomic Move | Atomic metadata-only | : : (objects.move) : operation. Fast, does : : : : not copy data. : | Rename Directory | Disabled by default. | Non-atomic. Renames each | : (Flat) : Enabled via : descendant individually; : : : --rename-dir-limit. : fails with EMFILE if : : : Batch per-object moves : the directory has more : : : : descendants than the : : : : limit. : | Rename Directory | Atomic Rename | Atomic metadata-only | : (HNS) : (folders.rename) : operation. Fast. : | Hard Links | Not Supported | Unsupported operation. |

Rapid Bucket Integration

Cloud Storage FUSE supports mounting Rapid Buckets (zonal, high-performance object storage designed for AI/ML and analytics workloads). Use version 3.7.2 or later. Google Kubernetes Engine (GKE) environments require version 1.35.0-gke.3047001 or later. When mounting a Rapid Bucket, GCSFuse utilizes several performance optimizations:

  • Optimized Read Path: GCSFuse automatically utilizes an optimized read path that leverages the Linux kernel's read-ahead algorithm by default, enabling faster sequential data access and higher aggregate throughput.

    • Note on Caching: The optimized read path is incompatible with GCSFuse file caching and buffered reads. By default, these features are disabled for Rapid Buckets. To use them, you must disable the kernel reader by setting enable-kernel-reader: false (a file-system config option not listed in the public config-file reference).

    • Note on non-GKE hosts: Outside GKE, the optimized read path also requires manual kernel tuning with root access (e.g., increasing read_ahead_kb and the FUSE max_background and congestion_threshold limits) to reach full throughput.

  • Native Appends & Real-Time Visibility: Rapid Bucket objects are appendable, and GCSFuse uploads data to them in real time for new files regardless of the mode they were opened in, and for existing (unfinalized) files when opened in append mode (O_APPEND). Flushed data is readable by other clients in real time — unlike standard buckets, where data becomes visible only when the file is closed. By default, closing a file does not finalize the object (finalize-file-for-rapid: false), so it remains appendable. Appendable objects accept only one writer at a time; a new writer preempts the existing stream.

  • Streaming Persistence: Object streams are kept open by default for zonal buckets, allowing efficient operations (such as reading a Parquet file's metadata and subsequent row data in a single stream) and reducing metadata round-trip latency.

    • Tip: To maximize the benefits of streaming persistence, ensure your application maintains open file handles and reuses them for subsequent operations on the same object.

Caching Configuration

Caching is essential to reduce latency and API cost (especially metadata operations). Configure caching using a YAML configuration file or the equivalent command-line flags — every config-file option has a corresponding flag (e.g., file-cache: max-size-mb ↔ --file-cache-max-size-mb).

Caching Mechanisms
MechanismPurposeRecommended For
File CacheCaches object content locallyAI/ML dataset
: (file-cache) : on disk (cache-dir) to serve : loading, multi-pass :
: : repeated reads at local : training epochs, and :
: : SSD/NVMe speeds. : repeated query :
: : : workloads. :
Metadata CacheCaches file stat attributes inDirectory-heavy
: (metadata-cache) : memory to eliminate : workloads with :
: : high-latency RPCs during ls : thousands of files. :
: : and stat calls (enabled by : :
: : default). : :
List CacheCaches directory listing scansWorkloads performing
: (file-system) : in kernel memory : frequent directory :
: : (kernel-list-cache-ttl-secs). : traversals. :

Run GCSFuse with the config file:

gcsfuse --config-file=/path/to/config.yaml my-bucket /path/to/mount
High-Performance Cache Config (Example)

Use this profile for read-heavy workloads (e.g., ML training) where data is static during the mount.

# Root-level configuration
cache-dir: /mnt/local-ssd/gcsfuse-cache # Point to high-performance media (e.g., Local SSD)
file-cache:
  # Enable local file caching
  max-size-mb: -1 # -1 for unlimited (constrained only by local disk)
  enable-parallel-downloads: true # Enabled by default; accelerates large file reads
  cache-file-for-range-read: true # Caches even if file is read in chunks
metadata-cache:
  # TTL for stat (metadata) cache
  # -1 means infinite TTL (perfect for static/read-only datasets)
  ttl-secs: -1
  stat-cache-max-size-mb: 34 # Default. Type cache merged into stat cache in v3.8.0; type-cache flags are no-ops
file-system:
  # Caches directory listings in the kernel
  kernel-list-cache-ttl-secs: -1

[!WARNING] Stale Data Risk: Setting ttl-secs or kernel-list-cache-ttl-secs to -1 or long durations means GCSFuse will not detect changes (metadata or file listings) made to the bucket outside of this mount. If the bucket is updated by other clients, users will see stale data or missing files.

Documentation

Requirements and compatibility

Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta

“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.

Needs: Needs an MCP server, Needs a command-line tool, Needs Node.js

Security

What our scanner noticed· Low risk

  • Instructions that use the network

A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.

Attribution and licence

Published by
Google
Publisher
Google (Official)
Source
google/skills · skills/cloud/google-cloud-storage-basics · commit 2194d3b
Licence
Apache License 2.0 (redistribution allowed)
  • LICENSE (added by AutoGineer from LICENSE)
  • ATTRIBUTION.md (written by AutoGineer)
Synced

AutoGineer is not affiliated with or endorsed by Google.

Download ZIP

The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download google-cloud-storage-basics.zip