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:
ossfs 2.0 installed and configured
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/
该文章对您有帮助吗?