Skip to content

Fix Docker volume mounts to enable hardlink optimization#3484

Merged
gantoine merged 3 commits into
masterfrom
claude/busy-keller-gd2Ue
Jun 6, 2026
Merged

Fix Docker volume mounts to enable hardlink optimization#3484
gantoine merged 3 commits into
masterfrom
claude/busy-keller-gd2Ue

Conversation

@gantoine

@gantoine gantoine commented Jun 6, 2026

Copy link
Copy Markdown
Member

Description

This change modifies the Docker VOLUME declaration to fix an issue where asset import/export hardlink optimization was failing due to cross-device link errors.

Previously, the Dockerfile declared each subdirectory individually (/romm/resources, /romm/library, /romm/assets, /romm/config, /romm/sync). When users bind-mounted a single parent directory at /romm, Docker would create separate mount points (each with its own st_dev) for each subdirectory. This caused os.link() operations to fail with EXDEV ("Cross-device link") errors, forcing the asset import/export process to fall back to slow full copies instead of using hardlinks.

The fix declares only the parent /romm directory (along with /redis-data) as volumes. This ensures all subdirectories remain on the same filesystem, allowing hardlink operations to succeed and enabling the hardlink optimization for asset import/export.

Fixes #3483

Checklist

  • I've tested the changes locally
  • I've updated relevant comments
  • I've assigned reviewers for this PR
  • I've added unit tests that cover the changes

https://claude.ai/code/session_01STuknV2qjadTPHfSe5EV4q

claude and others added 2 commits June 6, 2026 14:20
PR #3388 added hardlink-based asset import/export (os.link with a
shutil.copy2 fallback) to avoid duplicating disk space. The Dockerfile
VOLUME instruction listed each /romm subdirectory (resources, library,
assets, config, sync) separately, which makes Docker create an
independent mount point for each one — even when the user bind-mounts a
single parent at /romm. Each mount point is its own st_dev, so every
cross-directory os.link() failed with EXDEV and silently fell back to a
full copy, defeating the optimization.

Declare the parent /romm directory instead so all subdirectories share a
single filesystem and hardlinks can succeed when paths reside on the same
underlying host filesystem.
@gantoine
gantoine marked this pull request as ready for review June 6, 2026 14:24
Copilot AI review requested due to automatic review settings June 6, 2026 14:24

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the Docker image’s declared volumes to avoid Docker creating separate mount points per /romm/* subdirectory, which was causing os.link() hardlink operations to fail with EXDEV during asset import/export.

Changes:

  • Replace per-subdirectory VOLUME declarations with a single parent VOLUME ["/romm", "/redis-data"] to keep /romm/* on the same filesystem device when users bind-mount /romm.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread docker/Dockerfile Outdated
@gantoine
gantoine merged commit 56f65bb into master Jun 6, 2026
8 checks passed
@gantoine
gantoine deleted the claude/busy-keller-gd2Ue branch June 6, 2026 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] VOLUME instruction in Dockerfile prevents hardlink optimization (PR #3388) from working when using a NAS as

3 participants