Quick installation

Last Updated: Oct 13, 2017

Introduction

ossfs allows you to mount Alibaba Cloud OSS buckets to local files in Linux systems. In the system, you can quickly use the local file system to perform operations on OSS objects, achieving data sharing.

Features

The ossfs is constructed based on S3FS and incorporates all S3FS functions. Key functions include:

  • Support for most functions of the POSIX file system, including file reading/writing, directories, link operations, permissions, UID/GID, and extended attributes.
  • Uploads of large files using the OSS multipart function.
  • MD5 checksum to ensure data integrity.

Limits

Compared to a local file system, the functions and performance provided by ossfs have certain limitations. These include:

  • Random write and append operations will overwrite the entire file.
  • The performance of metadata operations, such as list directory, is poor because the system has to remotely access the OSS server.
  • The file/folder rename operation is not atomic.
  • When multiple clients are attached to a single OSS bucket, you must coordinate the actions of each client manually. For example, you need to avoid multiple clients writing the same file.
  • Hard link is not supported.
  • This system is not suitable for highly-concurrent read/write scenarios, as this will greatly increase the system load.

Installation and use

Installation package download:

Released Linux Download
Ubuntu 16.04 (x64) ossfs_1.80.3_ubuntu16.04_amd64.deb
Ubuntu 14.04 (x64) ossfs_1.80.3_ubuntu14.04_amd64.deb
CentOS 7.0 (x64) ossfs_1.80.3_centos7.0_x86_64.rpm
CentOS 6.5 (x64) ossfs_1.80.3_centos6.5_x86_64.rpm

Install the ossfs

  • Run these commands to install Ubuntu:
  1. sudo apt-get update
  2. sudo apt-get install gdebi-core
  3. sudo gdebi your_ossfs_package
  • Run these commands to install CentOS 6.5 or above:
  1. sudo yum localinstall your_ossfs_package
  • Run these commands to install CentOS 5 or above:
  1. sudo yum localinstall your_ossfs_package --nogpgcheck

Use the ossfs

Set bucket name and AccessKeyId/Secret and save it to the /etc/passwd-ossfs file.

Note that the permissions for this file must be set correctly. We suggest setting it to 640.

  1. echo my-bucket:my-access-key-id:my-access-key-secret > /etc/passwd-ossfs
  2. chmod 640 /etc/passwd-ossfs

Mount the OSS bucket to the specified directory.

  1. ossfs my-bucket my-mount-point -ourl=my-oss-endpoint

Example

Mount the bucket my-bucket to the /tmp/ossfs directory. The AccessKeyId is faint, the AccessKeySecret is 123, and the OSS endpoint is http://oss-cn-hangzhou.aliyuncs.com.

  1. echo my-bucket:faint:123 > /etc/passwd-ossfs
  2. chmod 640 /etc/passwd-ossfs
  3. mkdir /tmp/ossfs
  4. ossfs my-bucket /tmp/ossfs -ourl=http://oss-cn-hangzhou.aliyuncs.com

Unmount the bucket:

  1. fusermount -u /tmp/ossfs

For more information, refer to here.

Release log

Refer to here.

Thank you! We've received your feedback.