Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not work with Hardlinks #13

Open
karshd opened this issue Jan 19, 2025 · 1 comment
Open

Does not work with Hardlinks #13

karshd opened this issue Jan 19, 2025 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@karshd
Copy link

karshd commented Jan 19, 2025

Hello and thanks for the script

It seems like it doesnt work with hardlinks

cp: cannot create hard link '/mnt/data/template/host-services-docker-dir.pxar.didx.zip' to '/mnt/cache/template/host-services-docker-dir.pxar.didx.zip'cp: cannot create hard link '/mnt/data/test/host-services-docker-dir.pxar.didx.zip' to '/mnt/cache/test/host-services-docker-dir.pxar.didx.zip': Invalid cross-device link
: Invalid cross-device link
ERROR:root:Unexpected error moving file: Command '['cp', '-al', '/mnt/cache/template/host-services-docker-dir.pxar.didx.zip', '/mnt/data/template/host-services-docker-dir.pxar.didx.zip']' returned non-zero exit status 1.
ERROR:root:Unexpected error moving file: Command '['cp', '-al', '/mnt/cache/test/host-services-docker-dir.pxar.didx.zip', '/mnt/data/test/host-services-docker-dir.pxar.didx.zip']' returned non-zero exit status 1.
2025-01-19 20:40:08,294 - ERROR - File Move Operation:
  From: /mnt/cache/template/host-services-docker-dir.pxar.didx.zip
  To: /mnt/data/template/host-services-docker-dir.pxar.didx.zip
  Unexpected error moving file: Command '['cp', '-al', '/mnt/cache/template/host-services-docker-dir.pxar.didx.zip', '/mnt/data/template/host-services-docker-dir.pxar.didx.zip']' returned non-zero exit status 1.
2025-01-19 20:40:08,295 - ERROR - File Move Operation:
  From: /mnt/cache/test/host-services-docker-dir.pxar.didx.zip
  To: /mnt/data/test/host-services-docker-dir.pxar.didx.zip
  Unexpected error moving file: Command '['cp', '-al', '/mnt/cache/test/host-services-docker-dir.pxar.didx.zip', '/mnt/data/test/host-services-docker-dir.pxar.didx.zip']' returned non-zero exit status 1.

Any chance to support hardlinks ?

@monstermuffin
Copy link
Owner

monstermuffin commented Jan 19, 2025

Hey @karshd, the system should support hardlinking and what you're seeing was supposed to be implemented for this (cp -al) but I don't use hardlinks personally so haven't been able to test this.
I just wrote a quick test and wasn't able to reproduce this, could you please give me more info about the setup?

  • What filesystem type are you using for both the cache and backing storage?
  • Are you using mergerfs? If so, could you share your mergerfs mount options?
  • Could you share the output of df -T for both your cache and backing paths?

Looking into the Invalid cross-device link error, it may be that hardlinks will be unsupported based on the setup, but we can certainly see what can be done.

@monstermuffin monstermuffin self-assigned this Jan 19, 2025
@monstermuffin monstermuffin added the bug Something isn't working label Jan 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants