This topic describes how to use ossfs 2.0 to mount an Object Storage Service (OSS) bucket to a local file system in a Linux system.
Prerequisites
You have installed ossfs 2.0 and configured ossfs 2.0.
Create a mount directory
You can set the file name and path of the mount directory according to your needs. For example, you can create the /tmp/ossfs2-bucket
directory as the mount directory.
mkdir /tmp/ossfs2-bucket
Mount a bucket
Execute the following command to mount the bucket configured in the ossfs 2.0 configuration file ossfs2.conf
to the local /tmp/ossfs2-bucket/
directory. For examples of the ossfs 2.0 configuration file, see Configure ossfs 2.0.
ossfs2 mount /tmp/ossfs2-bucket/ -c /etc/ossfs2.conf
Unmount a mounted bucket
You can use a command to unmount the OSS file system that is mounted to the local system. For example, you can unmount the file system mounted at the /tmp/ossfs2-bucket/
path.
sudo umount /tmp/ossfs2-bucket/