You can use the -h option to view the common options supported by ossfs.

Command syntax

./ossfs -h

You must use this command in the directory where ossfs is located. The default directory is /usr/local/bin/ and the path varies based on the actual installation environment.

Common options

ossfs is implemented based on Filesystem in Userspace (FUSE) and supports the fuse options and the ossfs options. When you mount a bucket, you can specify different startup options. The options can be in one of the following formats:
-o option_name[=option_value] or -ooption_name[=option_value]
For example, you can use the following option to specify the uid and gid parameters when you mount a bucket:
ossfs bucket_name mount_point -ourl=endpoint -ouid=uid -ogid=gid
The following section describes common ossfs options.
  • url: specifies the domain name that you want to use to access a bucket. Format: url=endpoint. The default request protocol is HTTP.

    Example:

    -ourl=oss-cn-hangzhou.aliyuncs.com
    -ourl=http://oss-cn-hangzhou.aliyuncs.com
    -ourl=https://oss-cn-hangzhou.aliyuncs.com
  • passwd_file: specifies the object that stores the AccessKey pair used to access a bucket. Default value: /etc/passwd-ossfs. Make sure that the permission of this object is correctly configured. If the object is /etc/passwd-ossfs, you can set the permission to 640. If the object is not /etc/passwd-ossfs, you must set the permission to 600. The content of the object is in the following format: ${bucket}:${access-key-id}:{access-key-secret}.

    Example:

    echo bucket-test:LTAIbZcdVCmQ****:MOk8x0y9hxQ31coh7A5e2MZEUz**** > /etc/passwd-ossfs
    chmod 640 /etc/passwd-ossfs
    
    echo bucket-test:LTAIbZcdVCmQ****:MOk8x0y9hxQ31coh7A5e2MZEUz**** > /passwd-path/passwd-ossfs
    chmod 600 /passwd-path/passwd-ossfs
    
    -opasswd_file=/passwd-path/passwd-ossfs
  • max_stat_cache_size: specifies the maximum number of objects whose metadata can be cached. Default value: 1000. When a directory contains a large number of objects, you can adjust this option to accelerate object listing when you run the ls command to list objects. To disable metadata caching, you can set the value of this option to 0.
  • allow_other: authorizes other users to access the directory to which the bucket is mounted, but not the objects in the directory. To modify the access permissions on the objects in the directory, you must run the chmod command. No value is available for this option. To grant the permissions to other users, use the -oallow_other option.
  • dbglevel: specifies the log level. Valid values: critical, error, warn, info, and debug. Default value: critical. For example, if you want to enable info log collection, use the -odbglevel=info option. Logs are written to system logs. For example, logs are written to /var/log/messages in CentOS.
  • -f: runs ossfs as a foreground program instead of a daemon. In this case, logs are displayed on the screen of a terminal. This option is used in debugging.
  • -d: enables logging. This option is also used in fuse. In ossfs, this option is equivalent to the -odbglevel=info configurations.

Options

Unless otherwise specified, options are in one of the following formats: -ooption_name=option_value or -o option_name=option_value.

  • ossfs options
    OptionDescription
    default_aclSpecifies the access control list (ACL) of an object when the object is uploaded to Object Storage Service (OSS). Default value: private. Valid values:
    • private
    • public-read
    • public-read-write
    For more information, see Object ACL.
    retriesSpecifies the number of retry attempts that you want the system to perform when a request fails. Default value: 2.
    storage_classSpecifies the storage class of the object that you want to upload to OSS. Default value: Standard. Valid values:
    • Standard
    • IA
    • Archive
    For more information about storage classes, see Overview.
    public_bucketAllows users to access buckets as anonymous users. This option is suitable only for buckets whose ACLs are public read/write. Default value: 0. Valid values:
    • 0: does not allow users to access buckets as anonymous users.
    • 1: allows users to access buckets as anonymous users.
    passwd_fileSpecifies the object that stores the AccessKey pair used to access a bucket. Default value: /etc/passwd-ossfs.
    connect_timeoutSpecifies the timeout period in seconds for connections. Default value: 300.
    readwrite_timeoutSpecifies the timeout period in seconds for read or write requests. Default value: 60.
    max_stat_cache_sizeSpecifies the maximum number of objects whose metadata can be cached. Default value: 1000. The metadata of 1,000 objects consumes approximately 4 MB.
    stat_cache_expireSpecifies the expiration time for the object metadata cache. Unit: seconds. By default, the metadata cache does not expire.
    no_check_certificateSpecifies that the server certificates are not validated. This option takes effect only when the request protocol is HTTPS. By default, certificate validation is enabled. No values are available for this option. To disable certificate validation, use the -ono_check_certificate option.
    multireq_maxSpecifies the maximum number of concurrent requests to access object metadata during object listing. Default value: 20.
    parallel_countSpecifies the number of parts that can be concurrently uploaded when multipart upload is used to upload large objects. Default value: 5.
    multipart_sizeSpecifies the size of each part in MB when multipart upload is used to upload data. Default value: 10. This option limits the maximum size of the object that you want to upload. When multipart upload is used, the maximum number of parts that can be uploaded is 10,000. By default, the maximum size of the object that can be uploaded is 100 GB. You can adjust the value of this option to upload larger objects.
    urlSpecifies the domain name that you want to use to access a bucket.
    mp_umaskSpecifies the permission mask for mount points. This option takes effect only when the allow_other option is set. Default value: 000. This option is used in the same manner as the umask command. For example, you can configure -oallow_other -omp_umask=007 to set the permission of the mount point to 770, and configure -oallow_other -omp_umask=077 to set the permission of the mount point to 700.
    enable_content_md5Specifies whether to configure the CONTENT_MD5 header for object upload. By default, this header is not configured. If you want to configure the Content-MD5 header, add the -oenable_content_md5 option.
    ram_roleAllows access to OSS by using RAM roles. When you access OSS by using RAM roles, the AccessKey ID and AccessKey secret of the key object are ignored.
    listobjectsv2When versioning is enabled for a bucket, we recommend that you use the -olistobjectsv2 option to list objects.
    notsup_compat_dirThe supported directory types. By default, ossfs recognizes dir/, dir, and dir_$folder$ as directories.

    If you want ossfs to recognize only dir/ as directories to reduce the number of interaction requests between ossfs and the server, you must use the -onotsup_compat_dir option.

    ensure_diskfreeThe available storage capacity of a disk that can be reserved by ossfs. To improve performance, ossfs uses the storage capacity of a disk to save temporary data uploaded or downloaded by default. You can use this option to configure the available storage capacity of a disk that can be reserved by ossfs. Unit: MB. For example, if you want ossfs to reserve 1024 MB of storage capacity of a disk, use the -oensure_diskfree=1024 option.
    dbglevelSpecify the log level. Valid values:
    • critical (default)
    • error
    • warn
    • info
    • debug
    curldbgSpecifies whether to enable libcurl logging. By default, libcurl logging is disabled. To obtain libcurl logs, use the -ocurldbg option.
  • fuse options
    OptionDescription
    allow_otherModifies the permission of the mount point to allow access from all users. By default, only the root user can configure this option. No value is available for this option. To allow access from all users, use the -oallow_other option.
    uidSpecifies the user ID (UID) of the owner of a directory.
    gidSpecifies the group ID (GID) of the owner of a directory.