There is no pre-build packages for Alpine Linux. So I build it by myself.

Install fuse

sudo apk add fuse3

Build&install mergerfs

git clone
cd mergerfs
git checkout tags/2.30.0 -b v2.30.0
sudo make install

mergerfs was installed to /usr/local/bin.

Load fuse mod on boot

Add fuse to /boot/extlinux.conf

# Generated by update-extlinux 6.04_pre1-r6
DEFAULT menu.c32
MENU TITLE Alpine/Linux Boot Menu
MENU AUTOBOOT Alpine will be booted automatically in # seconds.
  MENU LABEL Linux lts
  LINUX vmlinuz-lts
  INITRD initramfs-lts
  APPEND root=UUID=d0f32707-6030-473e-a236-823b90dd2e72  modules=sd-mod,usb-storage,ext4,xfs,fuse nomodeset quiet rootfstype=ext4


Mount mergerfs on boot

Modify /etc/fstab:

UUID=d0f32707-6030-473e-a236-823b90dd2e72	/	ext4	rw,relatime 0 1
UUID=7794c691-bc03-4c26-898f-58231b93e780	/boot	ext4	rw,relatime 0 2
UUID=b5ebf3c5-39b0-41ec-ae68-7f08e99b7688	swap	swap	defaults	0 0
UUID=13534eb9-ae36-4af5-af78-f21b1ef34213       /media/disk1 xfs defaults 0 0
UUID=4a10fa24-aaea-42f1-88ae-7d32c0bcab3d       /media/disk2 xfs defaults 0 0
/media/disk1:/media/disk2                       /media/vdisk fuse.mergerfs defaults,allow_other,noforget,use_ino,inodecalc=path-hash,minfreespace=4G,ignorepponrename=true,cache.files=off,,category.create=mfs,func.getattr=newest,posix_acl=true 0 0
/dev/cdrom	/media/cdrom	iso9660	noauto,ro 0 0
/dev/usbdisk	/media/usb	vfat	noauto	0 0

Mount mergerfs without reboot:

sudo mount /media/vdisk

Setup Samba share

Append below to /etc/samba/smb.conf

   comment = All disks
   path = /media/vdisk/
   public = no
   writable = yes
   printable = no
   browsable = yes     
   valid users = lei
   admin users = lei
   follow symlinks = yes
   wide links = yes
   map archive = no
   map system = yes
   map hidden = yes

Restart samba service to make changes take effect:

sudo rc-service samba restart


It's OK to visit samba share from other computers after these setups. But there's a problem the file system reports no space left on device when you create a file or directory under /media/vdisk/.

I found that you can modify and save an existing file successfully. At first, I thought it's a problem of samba. Then I tried different configurations for samba, such as create mask, directory mask, force create mode, force directory mode, and security mask etc. Also tried many combinations of mergerfs options.

I thought it might be permission issue. Then I changed the permissions of disks.

sudo chown -R lei /media/disk1/
sudo chown -R lei /media/disk2/
chmod 777 /media/disk1/
chmod 777 /media/disk1/

Tried different mergerfs versions, but no luck.

I even tried with different fs type, from ext4to xfs.

Then I tried to create a file with touch /media/vdisk/temp.txt or mkdir /media/vdisk/temp, and got no space left on device error. Obviously it's something wrong with mergerfs.