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.
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
|Ubuntu 18.04 (x64)||ossfs_1.80.6_ubuntu18.04_amd64.deb|
|Ubuntu 16.04 (x64)||ossfs_1.80.6_ubuntu16.04_amd64.deb|
|Ubuntu 14.04 (x64)||ossfs_1.80.6_ubuntu14.04_amd64.deb|
|CentOS 8.0 (x64)||ossfs_1.80.6_centos8.0_x86_64.rpm|
|CentOS 7.0 (x64)||ossfs_1.80.6_centos7.0_x86_64.rpm|
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.
?spm=xxxxfrom the URLs.
- Download the installation package. For example, run the following command to download the ossfs installation package for CentOS 7.0 (x64):
- Install ossfs.
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
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=./ fuseNotice 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=EndpointFor example, you can run the following command to mount a bucket named
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.comNotice 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.comto 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
fusermount -u /tmp/ossfs
For more information, visit GitHub ossfs.
For more information about the version history of ossfs, visit GitHub ChangeLog.