ossfs mounts an Alibaba Cloud Object Storage Service (OSS) bucket as a local file system, allowing you to manage OSS data with standard file system operations.
Version upgrade
For AI training, inference, and autonomous driving simulation workloads, use ossfs 2.0 instead. ossfs 2.0 is the recommended alternative when you need better performance than an OSS SDK or Accelerate Model Training using the OSS Connector for AI/ML can provide.
ossfs 2.0 delivers:
Basic POSIX compatibility, built around OSS server-side read and write capabilities.
High-performance sequential reads and writes for large files through end-to-end I/O path optimization.
Efficient concurrent loading of small files with optimized metadata management.
Use ossfs 1.0 when your workload primarily involves standard POSIX file operations on a Linux system and does not require the high-throughput performance that ossfs 2.0 targets.
ossfs
ossfs is built on FUSE (filesystem in userspace) and mounts an OSS bucket as a local file system on Linux. It works well for workloads such as log archival, static content serving, data lake access, and batch jobs that read or write files sequentially.
ossfs supports:
Most POSIX file system operations, including uploading and downloading files and directories, and setting user permissions.
Multipart upload and resumable upload by default.
MD5 verification to ensure data integrity.
Prerequisites
ossfs runs on machines that support FUSE. Pre-built installation packages are available for Ubuntu, CentOS, and Alibaba Cloud Linux. For other environments, build ossfs from source.
-
Linux
CentOS 7.0 or later.
Ubuntu 20.04 or later.
Alibaba Cloud Linux 2 or later.
-
FUSE 2.8.4 or later
Run the
fusermount -Vcommand to check your FUSE version. An output likefusermount version: 2.9.2confirms the requirement is met.
Limitations
Because ossfs maps object storage API calls to POSIX file system semantics, some operations behave differently than on a local disk. Be aware of the following limitations before mounting a bucket:
-
Not suitable for highly concurrent mixed read and write workloads.
NoteRandom reads and all writes flush data to disk first. In highly concurrent mixed read/write workloads, disk I/O becomes the bottleneck for both reads and writes.
Concurrent read and write requests contend for the same bandwidth, reducing overall throughput.
Hard links are not supported. OSS objects have no concept of multiple directory entries pointing to the same data.
Do not mount buckets that use the Archive, Cold Archive, or Deep Cold Archive storage classes. These classes require data restoration before access, which is incompatible with file system semantics.
Editing a file causes ossfs to re-upload the entire file, because OSS does not support in-place partial writes.
Metadata operations such as
list directoryare slow. Each call requires a round trip to the OSS server, unlike a local file system where directory listings are cached in memory.Renaming a file or directory can fail, which may cause data inconsistency. OSS does not support atomic rename; ossfs emulates it with a copy-then-delete sequence that can leave partial state if interrupted.
If multiple clients mount the same OSS bucket and write to the same file simultaneously, data consistency is not guaranteed.
Grant your AccessKey full permissions on the target bucket or prefix. If full permissions are not possible, grant at minimum:
oss:GetObject,oss:ListObjects,oss:DeleteObject,oss:PutObject,oss:AbortMultipartUpload, andoss:ListMultipartUploads. Insufficient permissions cause mount failures or unexpected behavior.
What's next
Before mounting a bucket, Install ossfs 1.0 and Configure ossfs 1.0. After setup is complete, Mount a bucket to a local Linux system.