You can use the -h option to view the common options supported by ossfs.
You must use this command in the directory where ossfs is located. The directory is /usr/local/bin/ by default and is subject to the actual installation environment.
For example, you can use the following option to specify the uid and gid parameters when you attach a bucket:
-o option_name[=option_value] or -ooption_name[=option_value]
ossfs bucket_name mount_point -ourl=endpoint -ouid=uid -ogid=gid
- url: specifies the endpoint used to access a bucket. Format:
url=endpoint. The default request protocol is HTTP.
-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 configured correctly. 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
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 attached, but not objects in the directory. To modify the access permission on the objects in the directory, you must run the chmod command. No value is available for this option. To grant 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, to enable info log collection, use the -odbglevel=info option. Logs are written to system logs. For example, in CentOS, logs are written to /var/log/messages.
- -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 setting.
Unless otherwise specified, options are in one of the following formats:
- ossfs options
Option Description default_acl Specifies the access control list (ACL) of an object when the object is uploaded to OSS. Default value: private. Valid values:
retries Specifies the number of retry attempts when a request fails. Default value: 2. storage_class Specifies the storage class of an object when the object is uploaded to OSS. Default value: Standard. Valid values:
public_bucket Allows users to access buckets as anonymous users. This option is applicable only to buckets whose ACLs are public read/write. Default value: 0. Valid values:
- 0: prohibits users to access buckets as anonymous users.
- 1: allows users to access buckets as anonymous users.
passwd_file Specifies the object that stores the AccessKey pair used to access a bucket. Default value: /etc/passwd-ossfs. connect_timeout Specifies the timeout period in seconds for connections. Default value: 300. readwrite_timeout Specifies the timeout period in seconds for read or write requests. Default value: 60. max_stat_cache_size Specifies the maximum number of objects whose metadata can be cached. Default value: 1000. The metadata of 1,000 objects consumes about 4 MB of cache space. stat_cache_expire Specifies the expiration time for the object metadata cache. By default, the metadata cache does not expire. no_check_certificate Specifies that the server certificates are not validated. This option is valid 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_max Specifies the maximum number of concurrent requests to access object metadata during object listing. Default value: 20. parallel_count Specifies the number of parts that can be uploaded concurrently when multipart upload is used to upload large objects. Default value: 5. multipart_size Specifies 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 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. url Specifies the endpoint used to access a bucket. mp_umask Specifies 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 way as the umask command. For example, you can set -oallow_other -omp_umask=007 to set the permission of the mount point to 770, and set -oallow_other -omp_umask=077 to set the permission of the mount point to 700. enable_content_md5 Specifies whether to set the CONTENT_MD5 header for uploads. By default, this header is not set. No value is available for this option. To specify CONTENT_MD5, use the -oenable_content_md5 option. ram_role Specifies access to OSS by using instance RAM roles. When you access OSS by using instance RAM roles, the AccessKey ID and AccessKey secret of the key object are ignored. dbglevel Specifies the log level. Valid values: critical, error, warn, info, and debug. Default value: critical. curldbg Specifies whether to enable libcurl logging. By default, libcurl logging is disabled. No value is available for this option. To obtain libcurl logs, use the -ocurldbg option.
- fuse options
Option Description allow_other Modifies the permission of the mount point to allow access from all users. By default, only the root user can set this option. No value is available for this option. To allow access from all users, use the -oallow_other option. uid Specifies the user ID (UID) of the owner of a directory. gid Specifies the group ID (GID) of the owner of a directory.