[mac mini] Unable to install photoprism

Restart worked without any problem. But enabling and initialising an external disk failed with a different error:

exit status 1: ERROR: unable to open /dev/sdc: Device or resource busy btrfs-progs v5.18.1 See http://btrfs.wiki.kernel.org for more information.

Logs:

Feb 27 10:17:42 macmini platform.backend[682]: info storage/disks.go:148 activate disks {"disks": ["/dev/sdc"], "format": true}
Feb 27 10:17:42 macmini platform.backend[682]: info cli/executor.go:23 execute {"cmd": "/usr/bin/lsblk -Pp -o NAME,SIZE,TYPE,MOUNTPOINT,PARTTYPE,FSTYPE,MODEL,UUID"}
Feb 27 10:17:42 macmini platform.backend[682]: info storage/disks.go:258 deactivate disk
Feb 27 10:17:42 macmini platform.backend[682]: info storage/linker.go:19 relink disk
Feb 27 10:17:42 macmini platform.backend[682]: info cli/executor.go:23 execute {"cmd": "/usr/bin/snap run nextcloud.storage-change"}
Feb 27 10:17:42 macmini systemd[1]: Started snap.nextcloud.storage-change.a38fe967-4acc-41b7-b34c-971d9f4343b6.scope.
Feb 27 10:17:43 macmini platform.api[680]: info rest/middleware.go:71 GET: /app/install_path?name=nextcloud
Feb 27 10:17:43 macmini platform.api[680]: info rest/middleware.go:71 GET: /app/data_path?name=nextcloud
Feb 27 10:17:43 macmini platform.api[680]: info rest/middleware.go:71 POST: /app/init_storage
Feb 27 10:17:43 macmini platform.api[680]: info storage/storage.go:67 fixing permissions {"dir": "/data/nextcloud"}
Feb 27 10:17:43 macmini platform.api[680]: info cli/executor.go:23 execute {"cmd": "/usr/bin/chown -RLf nextcloud.nextcloud /data/nextcloud"}
Feb 27 10:17:43 macmini sudo[3287]:     root : PWD=/var/snap/platform/2250 ; USER=nextcloud ; COMMAND=/snap/nextcloud/current/bin/php.sh /snap/nextcloud/current/nextcloud/occ config:system:delete instanceid
Feb 27 10:17:43 macmini sudo[3287]: pam_unix(sudo:session): session opened for user nextcloud(uid=992) by (uid=0)
Feb 27 10:17:43 macmini platform.backend[682]: info rest/middleware.go:71 GET: /rest/job/status
Feb 27 10:17:43 macmini ld-2.31.so[1265]: macmini nginx: 2a02:3102:4d80:7000:2c31:a3bf:eb1d:de23 - - [27/Feb/2025:10:17:43 +0100] "GET /rest/job/status HTTP/2.0" 200 73 "https://xxxx.syncloud.it/storage" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.3 Safari/605.1.15"
Feb 27 10:17:44 macmini sudo[3287]: pam_unix(sudo:session): session closed for user nextcloud
Feb 27 10:17:44 macmini platform.api[680]: info rest/middleware.go:71 POST: /service/restart
Feb 27 10:17:44 macmini platform.api[680]: info cli/executor.go:23 execute {"cmd": "/usr/bin/systemctl restart snap.nextcloud.php-fpm"}
Feb 27 10:17:44 macmini nextcloud.php-fpm[3113]: [NOTICE] Terminating ...
Feb 27 10:17:44 macmini systemd[1]: Stopping snap.nextcloud.php-fpm.service - Service for snap application nextcloud.php-fpm...
Feb 27 10:17:44 macmini nextcloud.php-fpm[3113]: [NOTICE] exiting, bye-bye!
Feb 27 10:17:44 macmini systemd[1]: snap.nextcloud.php-fpm.service: Deactivated successfully.
Feb 27 10:17:44 macmini systemd[1]: Stopped snap.nextcloud.php-fpm.service - Service for snap application nextcloud.php-fpm.
Feb 27 10:17:44 macmini systemd[1]: Starting snap.nextcloud.php-fpm.service - Service for snap application nextcloud.php-fpm...
Feb 27 10:17:44 macmini nextcloud.php-fpm[3329]: [NOTICE] [pool www] 'user' directive is ignored when FPM is not running as root
Feb 27 10:17:44 macmini nextcloud.php-fpm[3329]: [NOTICE] [pool www] 'user' directive is ignored when FPM is not running as root
Feb 27 10:17:44 macmini nextcloud.php-fpm[3329]: [NOTICE] [pool www] 'group' directive is ignored when FPM is not running as root
Feb 27 10:17:44 macmini nextcloud.php-fpm[3329]: [NOTICE] [pool www] 'group' directive is ignored when FPM is not running as root
Feb 27 10:17:44 macmini nextcloud.php-fpm[3329]: [NOTICE] fpm is running, pid 3329
Feb 27 10:17:44 macmini nextcloud.php-fpm[3329]: [NOTICE] ready to handle connections
Feb 27 10:17:44 macmini systemd[1]: Started snap.nextcloud.php-fpm.service - Service for snap application nextcloud.php-fpm.
Feb 27 10:17:44 macmini platform.api[680]: 2025/02/27 10:17:44 systemctl output:
Feb 27 10:17:44 macmini platform.api[680]: info rest/middleware.go:71 POST: /service/restart
Feb 27 10:17:44 macmini platform.api[680]: info cli/executor.go:23 execute {"cmd": "/usr/bin/systemctl restart snap.nextcloud.nginx"}
Feb 27 10:17:44 macmini systemd[1]: Stopping snap.nextcloud.nginx.service - Service for snap application nextcloud.nginx...
Feb 27 10:17:44 macmini systemd[1]: snap.nextcloud.nginx.service: Deactivated successfully.
Feb 27 10:17:44 macmini systemd[1]: Stopped snap.nextcloud.nginx.service - Service for snap application nextcloud.nginx.
Feb 27 10:17:44 macmini systemd[1]: Started snap.nextcloud.nginx.service - Service for snap application nextcloud.nginx.
Feb 27 10:17:44 macmini platform.api[680]: 2025/02/27 10:17:44 systemctl output:
Feb 27 10:17:44 macmini systemd[1]: snap.nextcloud.storage-change.a38fe967-4acc-41b7-b34c-971d9f4343b6.scope: Deactivated successfully.
Feb 27 10:17:44 macmini systemd[1]: snap.nextcloud.storage-change.a38fe967-4acc-41b7-b34c-971d9f4343b6.scope: Consumed 1.519s CPU time.
Feb 27 10:17:44 macmini platform.backend[682]: info cli/executor.go:23 execute {"cmd": "/usr/bin/snap run photoprism.storage-change"}
Feb 27 10:17:44 macmini nextcloud.nginx[3380]: 2025/02/27 10:17:44 [warn] 3380#3380: duplicate extension "js", content type: "text/javascript", previous content type: "application/javascript" in /var/snap/nextcloud/820/config/nginx.conf:93
Feb 27 10:17:44 macmini nextcloud.nginx[3380]: 2025/02/27 10:17:44 [warn] 3380#3380: duplicate extension "wasm", content type: "application/wasm", previous content type: "application/wasm" in /var/snap/nextcloud/820/config/nginx.conf:94
Feb 27 10:17:44 macmini systemd[1]: Started snap.photoprism.storage-change.da2c40ed-b173-4d61-a6f6-3fcb2be6d96b.scope.
Feb 27 10:17:44 macmini platform.api[680]: info rest/middleware.go:71 POST: /app/init_storage
Feb 27 10:17:44 macmini platform.api[680]: info storage/storage.go:67 fixing permissions {"dir": "/data/photoprism"}
Feb 27 10:17:44 macmini platform.api[680]: info cli/executor.go:23 execute {"cmd": "/usr/bin/chown -RLf photoprism.photoprism /data/photoprism"}
Feb 27 10:17:44 macmini platform.backend[682]: info cli/executor.go:23 execute {"cmd": "/usr/bin/snap run users.storage-change"}
Feb 27 10:17:44 macmini systemd[1]: snap.photoprism.storage-change.da2c40ed-b173-4d61-a6f6-3fcb2be6d96b.scope: Deactivated successfully.
Feb 27 10:17:44 macmini systemd[1]: Started snap.users.storage-change.da5f9a6e-a4a8-4559-8d66-26f68604dfa4.scope.
Feb 27 10:17:45 macmini platform.api[680]: info rest/middleware.go:71 GET: /app/install_path?name=users
Feb 27 10:17:45 macmini platform.api[680]: info rest/middleware.go:71 GET: /app/data_path?name=users
Feb 27 10:17:45 macmini platform.api[680]: info rest/middleware.go:71 POST: /app/init_storage
Feb 27 10:17:45 macmini platform.api[680]: info storage/storage.go:67 fixing permissions {"dir": "/data/users"}
Feb 27 10:17:45 macmini platform.api[680]: info cli/executor.go:23 execute {"cmd": "/usr/bin/chown -RLf usersapp.usersapp /data/users"}
Feb 27 10:17:45 macmini platform.backend[682]: info systemd/control.go:132 checking {"service": "opt-disk-external.mount"}
Feb 27 10:17:45 macmini platform.backend[682]: info cli/executor.go:23 execute {"cmd": "/usr/bin/systemctl is-active opt-disk-external.mount"}
Feb 27 10:17:45 macmini systemd[1]: snap.users.storage-change.da5f9a6e-a4a8-4559-8d66-26f68604dfa4.scope: Deactivated successfully.
Feb 27 10:17:45 macmini platform.backend[682]: info systemd/control.go:136 is-active {"output": "inactive\n"}
Feb 27 10:17:45 macmini platform.backend[682]: info cli/executor.go:23 execute {"cmd": "/snap/platform/current/btrfs/bin/mkfs.sh -U 08efacab-a55e-454d-b48d-c617aa13d3de -f -m single -d single /dev/sdc"}
Feb 27 10:17:45 macmini platform.backend[682]: info btrfs/disk.go:79 error {"output": "ERROR: unable to open /dev/sdc: Device or resource busy\nbtrfs-progs v5.18.1 \nSee http://btrfs.wiki.kernel.org for more information.\n\n"}
Feb 27 10:17:45 macmini platform.backend[682]: error job/worker.go:37 error in the task {"error": "exit status 1: ERROR: unable to open /dev/sdc: Device or resource busy\nbtrfs-progs v5.18.1 \nSee http://btrfs.wiki.kernel.org for more information.\n\n"}
Feb 27 10:17:45 macmini platform.backend[682]: github.com/syncloud/platform/job.(*Worker).Do
Feb 27 10:17:45 macmini platform.backend[682]:         /drone/src/backend/job/worker.go:37
Feb 27 10:17:45 macmini platform.backend[682]: github.com/syncloud/platform/job.(*Worker).Start
Feb 27 10:17:45 macmini platform.backend[682]:         /drone/src/backend/job/worker.go:24
Feb 27 10:17:45 macmini platform.backend[682]: info rest/middleware.go:71 GET: /rest/job/status
Feb 27 10:17:45 macmini ld-2.31.so[1265]: macmini nginx: 2a02:3102:4d80:7000:2c31:a3bf:eb1d:de23 - - [27/Feb/2025:10:17:45 +0100] "GET /rest/job/status HTTP/2.0" 200 51 "https://xxxx.syncloud.it/storage" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.3 Safari/605.1.15"
Feb 27 10:17:45 macmini platform.backend[682]: info rest/middleware.go:71 GET: /rest/storage/disks
Feb 27 10:17:45 macmini platform.backend[682]: info cli/executor.go:23 execute {"cmd": "/usr/bin/lsblk -Pp -o NAME,SIZE,TYPE,MOUNTPOINT,PARTTYPE,FSTYPE,MODEL,UUID"}
Feb 27 10:17:45 macmini platform.backend[682]: info rest/middleware.go:71 GET: /rest/job/status
Feb 27 10:17:45 macmini ld-2.31.so[1265]: macmini nginx: 2a02:3102:4d80:7000:2c31:a3bf:eb1d:de23 - - [27/Feb/2025:10:17:45 +0100] "GET /rest/job/status HTTP/2.0" 200 51 "https://xxxx.syncloud.it/storage" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.3 Safari/605.1.15"
Feb 27 10:17:45 macmini platform.backend[682]: info rest/middleware.go:71 GET: /rest/storage/error/last
Feb 27 10:17:45 macmini platform.backend[682]: error rest/middleware.go:94 error {"error": "exit status 1: ERROR: unable to open /dev/sdc: Device or resource busy\nbtrfs-progs v5.18.1 \nSee http://btrfs.wiki.kernel.org for more information.\n\n"}
Feb 27 10:17:45 macmini platform.backend[682]: github.com/syncloud/platform/rest.(*Middleware).Fail
Feb 27 10:17:45 macmini platform.backend[682]:         /drone/src/backend/rest/middleware.go:94
Feb 27 10:17:45 macmini platform.backend[682]: github.com/syncloud/platform/rest.(*Backend).Start.(*Middleware).SecuredHandle.(*Middleware).Handle.func85
Feb 27 10:17:45 macmini platform.backend[682]:         /drone/src/backend/rest/middleware.go:86
Feb 27 10:17:45 macmini platform.backend[682]: github.com/syncloud/platform/rest.(*Backend).Start.(*Middleware).SecuredHandle.(*Middleware).Secured.func86
Feb 27 10:17:45 macmini platform.backend[682]:         /drone/src/backend/rest/middleware.go:65
Feb 27 10:17:45 macmini platform.backend[682]: github.com/syncloud/platform/rest.(*Backend).Start.(*Middleware).FailIfNotActivated.func29
Feb 27 10:17:45 macmini platform.backend[682]:         /drone/src/backend/rest/middleware.go:39
Feb 27 10:17:45 macmini platform.backend[682]: net/http.HandlerFunc.ServeHTTP
Feb 27 10:17:45 macmini platform.backend[682]:         /usr/local/go/src/net/http/server.go:2166
Feb 27 10:17:45 macmini platform.backend[682]: github.com/syncloud/platform/rest.(*Middleware).JsonHeader-fm.(*Middleware).JsonHeader.func1
Feb 27 10:17:45 macmini platform.backend[682]:         /drone/src/backend/rest/middleware.go:73
Feb 27 10:17:45 macmini platform.backend[682]: net/http.HandlerFunc.ServeHTTP
Feb 27 10:17:45 macmini platform.backend[682]:         /usr/local/go/src/net/http/server.go:2166
Feb 27 10:17:45 macmini platform.backend[682]: github.com/gorilla/mux.(*Router).ServeHTTP
Feb 27 10:17:45 macmini platform.backend[682]:         /go/pkg/mod/github.com/gorilla/mux@v1.8.0/mux.go:210
Feb 27 10:17:45 macmini platform.backend[682]: net/http.serverHandler.ServeHTTP
Feb 27 10:17:45 macmini platform.backend[682]:         /usr/local/go/src/net/http/server.go:3137
Feb 27 10:17:45 macmini platform.backend[682]: net/http.(*conn).serve
Feb 27 10:17:45 macmini platform.backend[682]:         /usr/local/go/src/net/http/server.go:2039
Feb 27 10:17:45 macmini ld-2.31.so[1265]: macmini nginx: 2a02:3102:4d80:7000:2c31:a3bf:eb1d:de23 - - [27/Feb/2025:10:17:45 +0100] "GET /rest/storage/error/last HTTP/2.0" 500 183 "https://xxxx.syncloud.it/storage" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.3 Safari/605.1.15"
Feb 27 10:17:45 macmini platform.backend[682]: info cli/executor.go:23 execute {"cmd": "/snap/platform/current/btrfs/bin/btrfs.sh --format json device stats /opt/disk/external"}
Feb 27 10:17:45 macmini platform.backend[682]: info cli/executor.go:23 execute {"cmd": "/snap/platform/current/btrfs/bin/btrfs.sh --format json device stats /opt/disk/external"}

Would it be possible to manipulate the symlink to circumvent this? What I mean is:

  1. Mounting the external drive at /opt/disk/external
  2. Change /data so it points to /opt/disk/external instead of /opt/disk/internal

If there are only references to /data and no direct references to /opt/disk/internal this should work?

Yes /data is what apps know about.
Did you initialize this disk using Syncloud storage page or yourself?
If you did it yourself you can just ask Syncloud to use it in partition mode on storage disk or do as you suggested.

I initialized it with Syncloud. Is that an issue? To my understanding I would just need to mount it?

I mean did you originally initialize it with Syncloud?
It just looks like it was busy/already mounted and Syncloud could not do anything with it (or we have some other issue on debian 12)
Feel free to mount yourself and see what happens.
Also as I remember Nextcloud does not like /data link and it wants a target directory as data dir, so it is better do do it with Syncloud but let’s see if you can do it manually for now.

Hello Boris, it is quite frustrating. None of the avenues I have tried really works (if you are interested in details see next post). I would like to go back to my old docker installation. Can I deactivate syncloud/rootfs?

I don’t know why, but I could never get Syncloud to enable the partition on the disk. It was never visible (maybe because it is btrfs? Although it was initialized with Syncloud.).

So I used Symlinks:

  • nextcloud works (with opt/disk/internal/nextcloud → opt/disk/external/nextcloud).
  • Photoprism works (with a link only for the originals directory, the whole photoprism directory did not work). But it was not possible to restore my backup, when I tried exactly the same mariadb issues came up as they did under docker.
  • Matrix does not work, maybe because of the symlink but the whole server is not reachable so it might be a bigger issue.
  • Mail could not be installed:
error: cannot perform the following tasks:
- Start snap "mail" (296) services (systemctl command [start snap.mail.postfix.service] failed with exit status 1: Job for snap.mail.postfix.service failed because the control process exited with error code.
See "systemctl status snap.mail.postfix.service" and "journalctl -xeu snap.mail.postfix.service" for details.
)
  • PiHole does not work (which is not an issue) but thats definitely not related to symlinks.
  • Files does not work (nginx error)

All in all I think it is too much work ahead to get this to work and the system gets too complicated with symlinks for some apps at different levels of their data directory. At the same time there is a working docker setup which I would therefore prefer to use.

Ok I agree you should NOT suffer like this.
The main problem is that too many parts are not compatible with debian bookworm and it takes time to fix them. I would continue doing this as I need it for Syncloud anyway.
You can try moving back to docker to see how that looks now, but this is how we started anyway so guess Sycnloud docker under debian bookworm is not good still.
Another option is to try installing Debian Buster on your macmini to see if that works better.

Ok.
How do I deinstall syncloud/rootfs?

snap remove ...

Untill no apps are installed.

Snap by itself should not cause issues, there is no uninstall, but you can do this:

systemctl stop snapd
systemctl disable snapd