This page describes the gcsfuse
command-line options used to interact with Cloud Storage FUSE
. If you're using the Cloud Storage FUSE CSI driver to mount your
buckets to your local file system in Google Kubernetes Engine, see Mount options for the Cloud Storage FUSE CSI driver
.
Overview of the gcsfuse CLI
The gcsfuse CLI is used to mount Cloud Storage buckets as file systems on a local machine.
Cloud Storage FUSE CLI options command structure
The following example shows the structure of the gcsfuse
command, including
required arguments and optional global options.
gcsfuse GLOBAL_OPTIONS
BUCKET_NAME
MOUNT_POINT
Where:
-
GLOBAL_OPTIONS
are the options that control how the mount is set up and how Cloud Storage FUSE behaves. -
BUCKET_NAME
is the name of the bucket to mount. For example,my-mount-bucket
. Optional. Exclude a bucket name from this command to perform dynamic mounting. -
MOUNT_POINT
is the local directory where the bucket will be mounted. For example,/path/to/mount/point
.
Global options
--anonymous-access
true
, false
.false
--app-name
my-bucket-mount
.""
--billing-project
""
--cache-dir
Enables the file cache and specifies the directory for storing file cache data.
/tmp/gcsfuse-cache-path
. An empty value
indicates this option is disabled. This option is disabled by default.""
--client-protocol
-
http1
for HTTP/1.1 -
http2
for HTTP/2 -
grpc
for gRPC . To use gRPC with Cloud Storage FUSE, we recommend using Cloud Storage FUSE versions 2.10.0 or newer.
http1
--cloud-metrics-export-interval-secs
Exports metrics to Cloud Monitoring with the specified interval.
10
(10 seconds). 0
specifies no exporting.0
--config-file
/etc/gcsfuse.yaml
.""
--custom-endpoint
storage. UNIVERSE_DOMAIN_NAME
:443
.
If a custom endpoint isn't specified, Cloud Storage FUSE uses the global
Cloud Storage JSON API endpoint, storage.googleapis.com:443
.
If authentication isn't supported on the custom endpoint you specify, set
the --anonymous-access
flag to true
to
bypass authentication.storage.googleapis.com:443
.""
--debug_fuse
(deprecated)
--log-severity
option. To enable debugging output, set the --log-severity
option to trace
, which includes
trace, debug, info, warning, and error logs.true
, false
.false
--debug_gcs
(deprecated)
--log-severity
option. To enable debugging output, set the --log-severity
option to trace
, which includes
trace, debug, info, warning, and error logs.true
, false
.false
--debug_invariants
true
, false
.false
--debug_mutex
trace
, which includes trace, debug, info, warning, and error
logs.true
, false
.false
--dir-mode
000
and 777
(inclusive).755
--enable-nonexistent-type-cache
NonexistentType
if a file isn't found in Cloud Storage. If the file gets created
in Cloud Storage but the NonexistentType
entry for
the file is cached, then Cloud Storage FUSE cannot request that file until
the NonexistentType
entry is removed from the type cache.true
, false
.false
--enable-streaming-writes
close()
or fsync()
.
For more information about streaming writes, see the Cloud Storage FUSE GitHub documentation
.true
, false
.true
--file-cache-max-size-mb
Specifies the maximum size in MiB that the file cache can use and lets you limit the total capacity the file cache can use within its mounted directory.
- Integer
-
-1
: Specifies the use of the cache's entire available capacity in the directory you specify forcache-dir
. This is the default only ifcache-dir
is passed. -
0
: Disables the file cache.
-1
--file-cache-cache-file-for-range-read
true
if you plan to perform several random reads
or partial reads.
true
, false
.false
--file-cache-download-chunk-size-mb
200
--file-cache-enable-parallel-downloads
Accelerates reads of large files by using the file cache directory as a prefetch buffer using multiple workers to download multiple parts of a file in parallel.
Parallel downloads are automatically enabled when you enable file caching. To learn more about file caching, see Use Cloud Storage FUSE file caching .
To learn more about parallel downloads and how to configure supporting properties, Parallel downloads .
true
, false
.true
--file-cache-max-parallel-downloads
- Integer
-
-1
: Specifies unlimited parallel downloads. -
0
: Disables parallel downloads. Can only be used if--enable-parallel-downloads
is not passed or is passed asfalse
.
16
,
whichever is higher. --file-cache-parallel-downloads-per-file
16
--file-mode
000
and 777
(inclusive).644
--foreground
gcsfuse
command in the foreground.true
, false
.false
--gid
- Integer representing a GID.
-
-1
: The GID of the caller is used.
-1
--help
--version
--http-client-timeout
1h10m10s
for 1 hour, 10 minutes,
and 10 seconds. 0s
specifies no timeout.0s
--ignore-interrupts
Control+C
. This prevents signals from
terminating in-flight operations.true
, false
.true
--implicit-dirs
true
, false
.false
--kernel-list-cache-ttl-secs
- Integer representing seconds, for example:
10
(10 seconds). -
0
: Disables list caching. -
-1
: Bypasses entry expiration and always returns the list response from the cache when it's available.
0
--key-file
/home/example_user/gcloud-key.json
. --limit-bytes-per-sec
-1
specifies no limit.-1
--limit-ops-per-sec
-1
specifies no limit.-1
--log-file
/tmp/user-example-bucket-gcsfuse-logs.txt
.stdout
when
Cloud Storage FUSE is run in the foreground or syslog
when
Cloud Storage FUSE is run in the background --log-format
-
text
-
json
json
--log-rotate-backup-file-count
- Integer
-
0
: Retains all rotated log files
10
--log-rotate-compress
true
, false
.true
--log-rotate-max-file-size-mb
1
.512
--log-severity
The severity level you want Cloud Storage FUSE to generate logs for. The
severity levels are ordered from lowest severity to highest severity. For
example, when you specify warning
, Cloud Storage FUSE generates logs
for warnings and errors. Generally, we recommend using the info
severity level.
-
off
: disables all logging. -
error
: contains messages about serious issues that prevent Cloud Storage FUSE from completing an operation, or indicate a failure such as mount failures, permission errors, and critical input/output (I/O) errors. -
warning
: contains messages indicating potential issues that aren't critical but can lead to issues if not addressed. Potential issues include non-fatal connection issues, deprecation warnings, resource contention that might cause slight performance degradation, and retries for transient failures. This severity level also includes information provided in theerror
severity level. -
info
: contains general logging information such as startup and shutdown messages, or information about successful mount operations, progress updates, and configuration settings. This severity level also includes information about thewarning
anderror
severity levels. -
debug
: contains logging information such as startup and shutdown messages, or information about successful mount operations, progress updates, and configuration settings. This severity level also includes the information provided in theinfo
,warning
, anderror
severity levels. -
trace
: contains granular details about each Cloud Storage FUSE operation and function call, outlining thegcsFUSE
interaction with the kernel FUSE driver and Cloud Storage. This severity level also includes the details provided indebug
,info
,warning
, anderror
severity levels.
info
--max-conns-per-host
--client-protocol
is set to http1
.0
and 2147483647
. 0
specifies no limit on TCP connections.0
--max-idle-conns-per-host
--client-protocol
is set to http1
.0
and 2147483647
. 0
specifies no limit on idle connections.0
--max-retry-attempts
- Integer representing the maximum number of retry attempts, for example:
10
. -
0
: Allows unlimited retry attempts.
0
--max-retry-sleep
1h5m50s
(1 hour, 5 minutes, and
50 seconds) or 60s
(60 seconds).30s
-o
FUSE
such as suid
are supported by
Cloud Storage FUSE and can be passed along with the -o
option.""
--only-dir
/etc/gcsfuse.yaml
.""
--prometheus-port
Exposes Prometheus metrics endpoint on the specified port and /metrics
path.
0
--rename-dir-limit
0
and 2147483647
.0
--retry-multiplier
2
--reuse-token-from-url
--token-url
.true
, false
.true
--sequential-read-size-mb
1
and 1024
.200
--stat-cache-capacity
(deprecated)
--stat-cache-max-size-mb
option.4096
--stat-cache-max-size-mb
- Integer. We recommend the following:
-
32
if your workload involves up to 20,000 files. - If your workload is larger than 20,000 files, increase the size by values of 10 for every additional 6,000 files, where the stat cache uses an average of 1,500 MiB per file.
-
-1
: Sets no limit, where the stat cache use as much memory as needed. -
0
: Disables the stat cache.
32
--stat-cache-ttl
(deprecated)
StatObject
results and inode
attributes. This option has been replaced by the --metadata-cache-ttl-secs
option.20s
(20 seconds).60s
--temp-dir
/mnt/ssd/example-user-gcsfuse-temp-dir
. /tmp
--token-url
--key-file
is absent.""
--type-cache-ttl
(deprecated)
--metadata-cache-ttl-secs
option.20s
(20 seconds).60s
--type-cache-max-size-mb
- Integer. We recommend the following:
-
4
if the maximum number of files within a single directory from the bucket you're mounting contains 20,000 files or less. - If the maximum number of files within a single
directory that you're mounting contains more than 20,000 files, increase
the value by
1
for every 5,000 files, which is an average of around 200 bytes per file.
-
-
-1
: Specifies no limit and lets the type cache use as much memory as needed. -
0
: Disables the type cache.
4
--uid
- Integer representing a UID.
-
-1
: The UID of the caller is used.
-1
--write-global-max-blocks
Specifies the maximum number of data chunks available for streaming writes across all files. Each file uses one 32 MiB data chunk by default.
- Integer
-
0
: disables streaming writes. -
-1
: sets the value to unlimited chunks.
- Default value for low-specification machines with limited resources:
4
- Default value for high-specification machines with a large amount of
resources:
1600