Mount a bucket to a local Linux system using ossfs 2.0

更新时间:
复制 MD 格式

Mount an Object Storage Service (OSS) bucket to a local Linux file system using ossfs 2.0.

Prerequisites

Before you begin, ensure that you have:

Create a mount directory

Choose a name and path for the mount directory. This example uses /tmp/ossfs2-bucket.

sudo mkdir /tmp/ossfs2-bucket

Mount a bucket

Run the following command to mount the bucket defined in ossfs2.conf to /tmp/ossfs2-bucket/. For more configuration examples, see Configure ossfs 2.0.

sudo ossfs2 mount /tmp/ossfs2-bucket/ -c /etc/ossfs2.conf 

Verify the mount

To confirm the bucket is mounted, run one of the following commands:

df -h | grep ossfs2-bucket

or

mount | grep ossfs2

To list the contents of the mounted directory:

ls -la /tmp/ossfs2-bucket/

Unmount a bucket

Run the following command to unmount the bucket at /tmp/ossfs2-bucket/.

sudo umount /tmp/ossfs2-bucket/