Subject: bug#79181: Guix file-system error error with mergerfs

From: Distopico <[email-masked]>
Date: Tue, 05 Aug 2025 18:22:40 -0500

I'm trying to setup Mergerfs in Guix,

Mergefs works with normal fstab configuration like:
https://trapexit.github.io/mergerfs/quickstart/#usage

--8<---------------cut here---------------start------------->8---
UUID=30393ca8-..........       /mnt/media1     ext4    defaults
/mnt/media1    /mnt/raid/      mergerfs        defaults,cache.files=partial,dropcacheonclose=true,category.create=pfrd 
--8<---------------cut here---------------end--------------->8---

But also support glob

--8<---------------cut here---------------start------------->8---
/mnt/media*    /mnt/raid/      mergerfs        defaults,...
--8<---------------cut here---------------end--------------->8---

and Guix is adding the fstab configuration fine (after reconfigure), but
I get an error in `guix reconfigure` and is not mounting it.

--8<---------------cut here---------------start------------->8---
guix system: warning: exception caught while executing 'start' on service 'file-system-/mnt/raid':
In procedure mount: mount "/mnt/media1" on "///mnt/raid": No such device
--8<---------------cut here---------------end--------------->8---

`herd status`:
--8<---------------cut here---------------start------------->8---
Failed to start:
 ! file-system-/mnt/raid
--8<---------------cut here---------------end--------------->8---

this is my file-system configuration

--8<---------------cut here---------------start------------->8---
(define margerfs-mapped-device
   (list (file-system
                  (mount-point "/mnt/media1")
                  (device (uuid
                            "30393ca8-..." 'ext4))
                  (type "ext4"))))
--8<---------------cut here---------------end--------------->8---

--8<---------------cut here---------------start------------->8---
 (file-systems (cons*
                ;; more disks...
                ;; mergerfs               
                (file-system
                 (device "/mnt/media1")
                 (mount-point "/mnt/raid")
                 (dependencies margerfs-mapped-device)
                 (options "defaults,cache.files=partial,dropcacheonclose=true,category.create=pfrd")
                 (type "mergerfs")
                 ;(mount-may-fail? #t)
                 ;(create-mount-point? #t)
                 (check? #f))
               (append
                margerfs-mapped-device
                %base-file-systems)))
--8<---------------cut here---------------end--------------->8---

Right now I'm just mapping one disk "/mnt/media1/", with "/mnt/media*" or
"/mnt/media1:/mnt/media2" does not work either (and I expected to not
work with that custom mergefs way), mounting manually works fine, or
after the reconfigure with `sudo mount -a`

I guess this is a perfect use case for mapping-devices but mergerfs is
not implemented for mapping in guix yet.

Why the most simple use case that should work is not working?