Migrate Blobfuse (v1) to Blobfuse2
Migrate Blobfuse (v1) to Blobfuse2 So, last week i needed to resolve a client’s case where i had to migrate BlobFuse (v1) to Blobfuse2. I search in the web and i didn’t find lots of content about this and i decided to make a post about it.
So, last week i needed to resolve a client’s case where i had to migrate BlobFuse (v1) to Blobfuse2. I search in the web and i didn’t find lots of content about this and i decided to make a post about it.
This is not an very difficult task but can be a little bit tricky if you are managing lots of mounts in your VM/VMs.
The official information (Official GitHub repository) does not bring us lots of information, only the:
Blobfuse2 Config Converter Tool
To make migration easier, we created a tool to mount with v1 configurations to migrate from blobfuse to blobfuse2 seamlessly.
Run the following command with the same CLI parameters as you would pass to blobfuse
blobfuse2 mountv1 <MOUNT_PATH> --config-file=<BLOBFUSE_V1_CONFIG_PATH> <BLOBFUSE_V1_CLI_PARAMETERS> --output-file=<OPTIONAL_DESIRED_BLOBFUSE2_CONFIG_PATH>This will enable us to mount the Blobfuse2 with the old Blobfuse (v1) config files and, more intresting: export the new v2 config file in the using the — output-file=<OPTIONAL_DESIRED_BLOBFUSE2_CONFIG_PATH> flag.
Considerations:
A challenge arises because the locations of the Blobfuse v1 config files, tmp paths, and mount paths are individually defined for each mount unit. Their settings depend on the initial configuration set by the administrator who first configured the blobfuse mounts.
Prerrequisites
So, first of all we need to assess and audit the blobfuse v1 actual configuration paths:
- Mount Path dir.
- Tmp Path dir.
- Config file path.
I recomend you to standarize this so each Mount in each VM works with the same path. In this case the standarization is the key to avoid us to lose a lot of time in the future. For example, you could standarize the paths this way:
- Mount path dir: /srv/[mount-name]
- Tmp path dir: /mnt/resources/blobfusetmp/[tmp-path-for-container-name]
- Config file path: /root/[config-file-container-name.yaml].
All the mounts in the VMs should have the same paths.
Now lets migrate!
Test lab
In this test-lab case we have the following scenario:
- 1 ubuntu VM (ubuntu-test).
- 3 blobfuse (v1) unit map to 1) bronze-container, 2) gold-container and 3) silver-container.

- 1 azure blob storage with the containers 1) bronze-container, 2) gold-container and 3) silver-container.

- The access and authorization from the VMs to the SA Containers are made through Managed-System Identitys (MSI).

First of all we audit the mount paths, tmp paths and config files path.
Mount Paths:
- /srv/bronze
- /srv/silver
- /srv/gold
Tmp paths:

- /mnt/resource/blobfusetmp/bronze
- /mnt/resource/blobfusetmp/silver
- /mnt/resource/blobfusetmp/gold
Config file paths:

- /root
Install Blobfuse2
To install Blobfuse2 you have to follow this steps:
Download package:
- On Ubuntu
wget https://packages.microsoft.com/config/ubuntu/<UBUNTU_VERSION>/packages-microsoft-prod.debsudo dpkg -i packages-microsoft-prod.debsudo apt-get update- On RHEL
sudo rpm -Uvh https://packages.microsoft.com/rhel/<RHEL_VERSION>/prod/blobfuse2-<BLOBFUSE2_VERSION>-RHEL-<RHEL_VERSION>-x86_64.rpmInstall package:
- On Ubuntu 20.04 and above
sudo apt-get install fuse3 blobfuse2- On Ubuntu 18.04
sudo apt-get install fuse blobfuse2- On RedHat/CentOS
sudo yum install fuse3 blobfuse2- On SUSE
sudo zypper install fuse3 blobfuse2Unmount and mount
With this aproach first we need to unmount the blobfuse (v1) and mount the Blobfuse2 exporting the modified config file.
We will createa script “mig-bf-1-to-2.sh” to execute this steps and not get downtime:
#!/bin/bash
# Exit on any command failureset -e
# Define a function that acts as a "catch" blockerror_handler() { echo "An error occurred. Cleaning up and exiting." # You can add any cleanup code here if needed exit 1}
# Trap any errors (catch)trap error_handler ERR
mkdir /root/bf2-config
fusermount -u /srv/bronzeblobfuse2 mountv1 /srv/bronze --tmp-path=/mnt/resource/blobfusetmp/bronze --config-file=/root/config-bronze.cfg -o attr_timeout=240 -o entry_timeout=240 -o negative_timeout=120 -o allow_other --output-file=/root/bf2-config/config-bronze.yaml
fusermount -u /srv/silverblobfuse2 mountv1 /srv/silver --tmp-path=/mnt/resource/blobfusetmp/silver --config-file=/root/config-silver.cfg -o attr_timeout=240 -o entry_timeout=240 -o negative_timeout=120 -o allow_other --output-file=/root/bf2-config/config-silver.yaml
fusermount -u /srv/goldblobfuse2 mountv1 /srv/gold --tmp-path=/mnt/resource/blobfusetmp/gold --config-file=/root/config-gold.cfg -o attr_timeout=240 -o entry_timeout=240 -o negative_timeout=120 -o allow_other --output-file=/root/bf2-config/config-gold.yamlCreate a script file and grant +x permissions to be able to execute it:
nano mig-bf-1-to-2.shchmod +x mig-bf-1-to-2.shRun the script:

Create new mount script
Now we can create (or modify if already exist) a mount script for this to mount all at one script run:
mount-blobfuse.sh mkdir /srv/bronzemkdir /srv/silvermkdir /srv/goldmkdir /mnt/resource/blobfusetmp/bronze -pmkdir /mnt/resource/blobfusetmp/silver -pmkdir /mnt/resource/blobfusetmp/gold -p
#Blobfuse v1 mounting steps:
#blobfuse /srv/bronze --tmp-path=/mnt/resource/blobfusetmp/bronze --config-file=/root/config-bronze.cfg -o attr_timeout=240 -o entry_timeout=240 -o negative_timeout=120 -o allow_other#blobfuse /srv/silver --tmp-path=/mnt/resource/blobfusetmp/silver --config-file=/root/config-silver.cfg -o attr_timeout=240 -o entry_timeout=240 -o negative_timeout=120 -o allow_other#blobfuse /srv/gold --tmp-path=/mnt/resource/blobfusetmp/gold --config-file=/root/config-gold.cfg -o attr_timeout=240 -o entry_timeout=240 -o negative_timeout=120 -o allow_other
#Blobfuse2 mounting steps:
blobfuse2 /srv/bronze --tmp-path=/mnt/resource/blobfusetmp/bronze --config-file=/root/bf2-config/config-bronze.yaml -o attr_timeout=240 -o entry_timeout=240 -o negative_timeout=120 -o allow_otherblobfuse2 /srv/silver --tmp-path=/mnt/resource/blobfusetmp/silver --config-file=/root/bf2-config/config-silver.yaml -o attr_timeout=240 -o entry_timeout=240 -o negative_timeout=120 -o allow_otherblobfuse2 /srv/gold --tmp-path=/mnt/resource/blobfusetmp/gold --config-file=/root/bf2-config/config-gold.yaml -o attr_timeout=240 -o entry_timeout=240 -o negative_timeout=120 -o allow_otherWhen you run it:

Well this is the way i found to do this process controlled. If anyone found a more automated way to do it, please let me know on the comments :)
Thanks for reading. The learning continues in the next article.


