Help Center/ Object Storage Service/ Tools Guide/ obsfs/ Environment Preparation/ Method 2: Generating obsfs by Compilation
Updated on 2025-05-14 GMT+08:00

Method 2: Generating obsfs by Compilation

obsfs is open source and available on GitHub. If your Linux distribution is not Ubuntu 16 or CentOS 7, or a similar version, you can compile the obsfs source code from GitHub. To do so, you need to configure the environment and execute the script.

Downloading the obsfs Source Code

You can download the obsfs source code from https://github.com/huaweicloud/huaweicloud-obs-obsfs.

Alternatively, you can log in to your Linux server and run the following command to download the source code from there:

git clone https://github.com/huaweicloud/huaweicloud-obs-obsfs.git

Compiling the obsfs source code frees you from the Linux distribution limitation.

Configuring the Compilation Environment

The compilation environment is used to compile the source code on the host where you will generate obsfs. The specific commands used depend on the Linux distribution.

  • Commands for CentOS 7, CentOS 8, Fedora 28, RHEL 7, and RHEL 8:
    yum install -y gcc libstdc++-devel gcc-c++ fuse fuse-devel curl-devel libxml2-devel mailcap git automake make 
    yum install -y openssl-devel
  • Commands for Ubuntu 14, Ubuntu 16, Ubuntu 18, and Debian 8:
    apt-get install -y build-essential git libfuse-dev libcurl4-openssl-dev libxml2-dev mime-support automake libtool
    apt-get install -y pkg-config libssl-dev
  • Command for SUSE 12 and openSUSE Leap 42.1:
    zypper in -y automake curl-devel fuse fuse-devel gcc-c++ libxml2-devel make openssl-devel 
  • obsfs supports libfuse 2.9.7, 2.9.8, or 2.9.9. If your system has a different version of libfuse installed, remove it and install the correct version by referring to libfuse Installation Guide.
  • You can view the libfuse version by running the system's version query command or run the following command:
    find / -name libfuse.so*

Generating obsfs

After the compilation environment is configured successfully, run the cd command to go to the directory where the source code was downloaded, and run the bash build.sh command to generate obsfs.

cd Directory where the downloaded obsfs source code is/huaweicloud-obs-obsfs

The generated obsfs is saved in the following path: Directory where the downloaded obsfs source code is/huaweicloud-obs-obsfs/src

Installing obsfs

After obsfs is generated, execute bash install_obsfs.sh in the following path to install obsfs:

cd Directory where the downloaded obsfs source code is/huaweicloud-obs-obsfs

Verification

Go to the directory where obsfs has been installed and run the following command to verify the installation.

./obsfs --version

If the obsfs version is displayed in the command output, obsfs has been installed, and you can then start initializing and using obsfs.

If there is an error message in the command output, run the openssl version command to check whether the OpenSSL version is 1.0.0 or an earlier one.