Ossfs is a userspace filesystem to mount the Open Storage Service from Aliyun as a local filesystem. It is implemented using FUSE.
fuse >= 2.8.4 libcurl >= 4 libglib-2.0 >= 2.24 libxml2 >= 2.7.8 libssl >= 1.0.0
Before install ossfs, you need install all dependencies first. The command or process to install them depends on linux distribution you are using, I only list some very popular distibutions. [Ubuntu]
$ sudo apt-get install pkg-config fuse libfuse-dev libcurl3 libcurl4-openssl-dev libglib2.0-dev libxml2-dev libssl-dev
-
Get source code using git. On Linux: open a terminal, change to the directory you want to place the source code, run the following command
git clone https://github.com/samsong8610/ossfs.git
you will get all the source code files into ossfs subdirectory.
-
Build it. On Linux: using the following command
cd ossfs ./configure make sudo make install
-
First you need register an aliyun account from https://member.aliyun.com/.
-
Login using your account, and go to http://i.aliyun.com/access_key/ to create an access id/key pair.
-
Create a bucket, for example mybucket, from http://i.aliyun.com/dashboard/instance?type=oss .
-
Copy default config file to ~/.config/ossfs/ .
mkdir -p ~/.config/ossfs/ cp conf ~/.config/ossfs/
-
Open ~/.config/ossfs/conf using your favorate editor, and modify the following config.
host: if you use a vm server from aliyun, you should set host to the intranet url. accessid: set to your access id created in step 2. accesskey: set to your access key created in step 2.
-
Make your mount directory, for example /mnt/oss.
-
Mount your bucket to /mnt/oss using following command
ossfs -b mybucket /mnt/oss
-
Now, you can access your object from /mnt/oss.
-
Use command below to umount ossfs. You must leave out the /mnt/oss before umount.
fusermount -u /mnt/oss
-
Have fun.
Ossfs v0.1 is very basic, even not support multipart upload API, and testing is not enough, so if you need this tool, please send bugs you found to https://github.com/samsong8610/ossfs/issues. Or send me a mail to samsong8610@gmail.com.
Any suggestions or new feature requests are also welcomed, send me a mail to samsong8610@gmail.com.