ossfs allows you to mount Object Storage Service (OSS) buckets as local file systems
on Linux. Then, you can manage OSS objects in the same manner as you manage local
files.
Runtime environment
We recommend that you run ossfs in the following environments:
- Linux-based operating systems
- CentOS 7.0 or later
- Ubuntu 14.04 or later
- Fuse 2.8.4 or later
Download URLs
The preceding table provides the download URLs of ossfs installation packages for
common operating systems. If your operating system is not included in the table, install
ossfs by compiling the source code. For more information about the source code, visit
GitHub ossfs.
Notice When you copy the URLs and use them in the wget command to download ossfs, delete
?spm=xxxx
from the URLs.
Installation
- Download the installation package.
For example, run the following command to download the ossfs installation package
for CentOS 7.0 (x64):
wget http://gosspublic.alicdn.com/ossfs/ossfs_1.80.6_centos7.0_x86_64.rpm
- Install ossfs.
- Ubuntu
For example, you can run the following command to install ossfs in Ubuntu 16.04 (x64):
sudo apt-get update
sudo apt-get install gdebi-core
sudo gdebi ossfs_1.80.6_ubuntu16.04_amd64.deb
- CentOS
For example, you can run the following command to install ossfs in CentOS 7.0 (x64):
sudo yum install ossfs_1.80.6_centos7.0_x86_64.rpm
If your client uses Yellowdog Updater, Modified (YUM) to install the Red-hat Package
Manager (RPM) package, dependencies may fail to be downloaded when the client node
network environment is not suitable. To resolve this issue, you can use YUM to download
the dependencies over the normal network to a node that runs the same operating system
version, and then copy the dependencies to the required node. For example, ossfs runs
based on fuse 2.8.4 or later. You can run the following command to download the latest
version of fuse from the YUM source to your local device:
sudo yum install --downloadonly --downloaddir=./ fuse
Notice To download other dependencies, replace fuse with the name of the required package.
- Configure access information of the account.
Store the bucket name and the AccessKey pair that can be used to access the bucket
in the
/etc/passwd-ossfs object. We recommend that you set the object permission to 640.
echo BucketName:yourAccessKeyId:yourAccessKeySecret > /etc/passwd-ossfs
chmod 640 /etc/passwd-ossfs
- Mount the bucket to the specified directory.
ossfs BucketName mountfolder -o url=Endpoint
For example, you can run the following command to mount a bucket named
bucket-test
to the
/tmp/ossfs
directory.
echo bucket-test:LTAIbZcdVCmQ****:MOk8x0y9hxQ31coh7A5e2MZEUz**** > /etc/passwd-ossfs
chmod 640 /etc/passwd-ossfs
mkdir /tmp/ossfs
ossfs bucket-test /tmp/ossfs -o url=http://oss-cn-hangzhou.aliyuncs.com
Notice If you use an Alibaba Cloud Elastic Compute Service (ECS) instance to provide ossfs
services, you can use the internal endpoint of the bucket. In the preceding example,
you can set the endpoint of OSS to
oss-cn-hangzhou-internal.aliyuncs.com
to minimize traffic fees. For more information about the internal endpoints of OSS,
see
Regions and endpoints.
- If you no longer want to mount the bucket, you can run the following command to unmount
it:
fusermount -u /tmp/ossfs
For more information, visit GitHub ossfs.
Version history
For more information about the version history of ossfs, visit GitHub ChangeLog.