Mount Oracle Object Storage to Ubuntu Linux Rumi, November 8, 2023 Step 1. Install s3fs on an OCI compute instance running Ubuntu SSH remotely into your Ubuntu server and run sudo apt update to update your system repository. Then type the command sudo apt install s3fs awscli -y to install S3fs on your system. To verify proper installation, run which s3fs and you should be able to see the path of the program. Note: refer to our other tutorials on how to create and connect to cloud compute instance through Bastion host. Step 2. Create Bucket storage, Customer Secret Key and collect information needed for mounting Make sure you have created a bucket for your OCI account or refer to this link and create one. Go to the Oracle Cloud Infrastructure Web Console, click the Profile icon in the top-right corner, and select User Settings. Then click Customer Secret Keys in the Resources section, and then click Generate Secret Key. Give the key a meaningful name (for example, fuse-secret-key), and then click Generate Secret Key. Copy and save the secret key because it won’t be shown again. Then go back to the Buckets page and click the name of your Bucket to show details and find out the namespace of your bucket and the Data Region from Bucket OCID, e.g. ap-melbourne-1. By now, we should’ve collected the following details: bucket_name: My_Bucket Secret_Key: LIcM4Vcb7Io45k8VBpObHZSgy2TbBOT0uRBjpRHi9vk= Access_Key: 483b5fa7719923d55fef0901b3340d89c1767815 Namespace: id4kj863dlvy OCI_Region_Name: ap-melbourne-1 Step 3. Create a Password File Then in the remote SSH session, use vi, nano or another text editor to create a Password File and add Access_key:Secret_Key to the Password file, and set owner only permission. ubuntu@compute:~$ sudo su ubuntu@compute:~$ cd ~ ubuntu@root:~$ nano .passwd-s3fs 483b5fa7719923d55fef0901b3340d89c1767815:LIcM4Vcb7Io45k8VBpObHZSgy2TbBOT0uRBjpRHi9vk= ubuntu@root:~$ chmod 600 .passwd-s3fs Step 4. Mount Bucket storage as file system To mount the Bucket storage, use the following template and type command in the SSH session by replacing with your specific parameters. sudo s3fs <bucket_name> <local_path> -o endpoint=<oci_region_name> -o passwd_file=.passwd-s3fs -o url=https://<object_storage_namespace>.compat.objectstorage.<oci_region_name>.oraclecloud.com/ -onomultipart -o use_path_request_style -o allow_other As an example, based on the information collected above, the command line will be like this: sudo s3fs My_Bucket /home/ubuntu/my_bucket/ -o endpoint=ap-melbourne-1 -o passwd_file=.passwd-s3fs -o url=https://id2kj987dlvy.compat.objectstorage.ap-melbourne-1.oraclecloud.com -onomultipart -o use_path_request_style -o allow_other Then we can quickly check the mounting by typing df -h and you should be able to see the s3fs file system and the mounting point. Now you can operate the attached bucket storage like normal mounted drive. * if df -h doesn’t show you the expected mounted S3 bucket, check your ubuntu server time and get it properly fixed. Step 5. Un-mounting the File System To unmount the File System, use the command fusermount and type the following in the command line interface. sudo fusermount -u /home/ubuntu/my_bucket If you encounter the error message of failing to unmount because the drive is busy, it’s likely because there’s file reading/writing in the web console. Log out from the console and run the unmount command. Step 6. Automount your Bucket After restarting the server, the mounted directories will disappear. If you would like to automount of the Bucket storage, you will need to modify the /etc/fstab file and add the following entry: s3fs#<bucket_name> /home/ubuntu/my_bucket fuse _netdev,allow_other 0 0 Ref: https://blogs.oracle.com/research/post/mount-buckets-of-oracle-object-storage-to-compute-instances-running-ubuntu-linux Related Administrations Configurations (Linux) Networking OCI Object StorageOCIS3UbuntuUbuntu 20
Two Default Gateways on One System May 21, 2015 Problem Description You have built two or more network cards into one Linux system and each of these cards has its own default gateway. By default, you can only have one default gateway on a system. The case described would lead to asynchronous routing, whereby the router would reject the… Read More
Install Qemu Guest Agent on Proxmox December 21, 2019 The qemu-guest-agent is a helper daemon, which is installed in the guest. It is used to exchange information between the host and guest, and to execute command in the guest. In Proxmox VE, the qemu-guest-agent is used for mainly two things: To properly shutdown the guest, instead of relying on… Read More
Increase mail attachment in Zimbra 8.8 June 3, 2018 Postfix configuration (zimbraMtaMaxMessageSize and message_size_limit) You can examine the current value of this parameter like this: # su – zimbra $ postconf message_size_limit message_size_limit = 10240000 This configuration parameter is stored in the zimbra ldap directory, and propagated to postconf’s message_size_limit by zmmtaconfig, which is invoked by the zimbra postfix… Read More