You can use ossfs to mount OSS buckets to local files systems in Linux and perform operations on OSS objects in the same manner as you operate local files, to serve data sharing purposes.

Runtime environment

ossfs is implemented based on the filesystem in userspace (fuse), and can only be run on machines that support fuse. Alibaba Cloud provides installation packages for Ubuntu and CentOS operating systems. To run ossfs in other environments, you can build the target program by using source code.

ossfs is supported both in the internal network and the Internet. In the internal network, you can use an internal endpoint to improve the speed and stability of access.

Install ossfs


ossfs is built based on S3FS and incorporates all S3FS functions, including:

  • Support for most functions of the POSIX-compliant file systems, including file reading/writing, directories, link operations, permissions, UID/GID, and extended attributes.
  • OSS multipart upload of large objects.
  • MD5 verification to ensure data integrity.
Note You can use Cloud Storage Gateway (CSG) to access OSS. This way, OSS buckets are mapped to local directories or disks.
  • CSG supports NFS and SMB (CIFS), allowing shared access to OSS-based objects.
  • CSG also supports iSCSI. A large number of OSS buckets can be mapped to local disks to provide an efficient elastic storage solution.

We recommend that you prioritize CSG over ossfs. For information, see What is CSG?.


Note the following limits before you use ossfs:
  • You cannot mount a bucket of the Archive storage class.
  • If you use ossfs to edit an object that was uploaded, the object will be uploaded again.
  • The performance of metadata-related operations such as list directory is compromised because you must remotely access the OSS server.
  • Errors may occur if you rename an object or a folder. Operation failures may cause data inconsistencies.
  • ossfs is not suitable for scenarios that require highly concurrent read and write operations.
  • If an OSS bucket is mounted to multiple clients, you are responsible for maintaining data consistency. For example, you must schedule when users can use objects to prevent multiple clients from writing to the same object at the same time.
  • Hard links are not supported.
Notice Although you can use ossfs to perform operations on OSS in the same manner as a local file system, the performance and functions of ossfs are not as good because data must be synchronized. Exercise caution when you want to use ossfs for applications that have high I/O requirements, such as databases.