Using Blobfuse2 to access Azure Storage like a folder from Windows
Blobfuse2 is a FUSE-compatible driver that allows you to mount Azure Blob storage containers as drives on Linux and Windows. Blobfuse2 uses the libfuse open source library to communicate with the Linux FUSE kernel module, and provides a virtual file system layer on top of Azure Storage. Blobfuse2 support:
- block blobs
- append blobs
And allows you to perform basic file operations such as read, write, rename, delete, etc. Blobfuse2 also supports caching and parallelism to improve performance and reliability.
Install Blobfuse2 on WSL
The most painless install is using Microsoft software repo for Linux. Ubuntu:
sudo wget https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
sudo apt-get update
sudo apt-get install libfuse3-dev fuse3
sudo apt-get install blobfuse2
Create a Config
Sample config I used:
allow-other: true
logging:
type: syslog
level: log_err
components:
- libfuse
- file_cache
- attr_cache
- azstorage
libfuse:
attribute-expiration-sec: 120
entry-expiration-sec: 120
negative-entry-expiration-sec: 240
file_cache:
path: /home/alg/.blobfuse2cache/alg/
timeout-sec: 120
max-size-mb: 4096
attr_cache:
timeout-sec: 7200
azstorage:
type: block
account-name: alganalytics
account-key: theKey
endpoint: https://alganalytics.blob.core.windows.net
mode: key
Then
sudo blobfuse2 mount all ./alganalytics --config-file=./blobfuse-alg.yml
Mounting container : archived to path alganalytics/archived
Mounting container : raw to path alganalytics/raw
2 of 2 containers were successfully mounted
You have to run as
sudo
and setallow-other: true
to be able to access it from Windows.
Now it’s accessible as file share, even in mc
.
And in Windows Explorer.
I can drag and drop as a usual filesystem in Windows. Works like a charm.
Blobfuse2 is also opensource.
Configuration
All the configuration keys are described here.
S3
Note, there is a similar fuse driver for AWS S3.
To contact me, send an email anytime or leave a comment below.