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

feature request(hardlinking): Automagically hardlink to differing partition/disk/mount #625

Open
Audionut opened this issue Mar 27, 2024 · 8 comments
Labels
config related to config file feature New feature or request workflow Relevant to workflow

Comments

@Audionut
Copy link
Contributor

Hardlinking seems like the most preferred linking solution, and indeed, #619 seeks to set hardlinking as the default.

Currently only one linkDir: is allowed to be set, resulting in what would appear to be non-optimal outcomes for those who have media files spread across different partition/disk/mount.

The most ideal solution, for us dumb users, would seem to allow multiple entries within linkDir:, where the user can set the directories for each partition/disk/mount, and xseed automagically uses the appropriate directory when linking.

@Audionut Audionut changed the title feat(hardlinking): Automagically hardlink across partition/disk/mount feat(hardlinking): Automagically hardlink to differing partition/disk/mount Mar 27, 2024
@Audionut Audionut changed the title feat(hardlinking): Automagically hardlink to differing partition/disk/mount feature request(hardlinking): Automagically hardlink to differing partition/disk/mount Mar 27, 2024
@NooNameR
Copy link

NooNameR commented Mar 27, 2024

@Audionut just to confirm you want something like:

["/datadir1" => "/linkdir1"]
["/datadir2" => "/linkdir2"]

this is kind of solved by mergefs, but might make sense for some cases

@Audionut
Copy link
Contributor Author

mergefs would appear to be unix only.

"/datadir1" => "/linkdir1" would undoubtedly work, however in cases with many data directories residing on the one partition, it would seem to be excessive config.

A cleaner solution, IMO:
linkDir: ["a:\\linked", "b:\\linked", "c:\\linked",] with xseed automagically linking the data match from the relevant datadir to the correct linkDir.

@NooNameR
Copy link

NooNameR commented Mar 27, 2024

mergefs would appear to be unix only.

"/datadir1" => "/linkdir1" would undoubtedly work, however in cases with many data directories residing on the one partition, it would seem to be excessive config.

A cleaner solution, IMO: linkDir: ["a:\\linked", "b:\\linked", "c:\\linked",] with xseed automagically linking the data match from the relevant datadir to the correct linkDir.

there are 2 things:

  1. linkdir from torrents (I assume you have only single mount there), otherwise it will be hard to do linking
  2. linkdir for data. So data should contains its map:
["/linkdir1" => ["/datadir1/tv", "/linkdir1/movies"]]
["/linkdir2" => ["/datadir2/tv", "/linkdir2/movies"]]

@fabricionaweb
Copy link
Contributor

fabricionaweb commented Mar 27, 2024

At first, I didnt understand what you said because hardlinks by definition dont work across disks, volumes or partitions. But NooNameR makes me see that it's about mapping the dataDir to linkDir. Thanks.

Usually we just use a fuse system that handles it, so cross-seed - or any other software - dont need to be working around it.

Example, if you have 3 disks, a fuse system would create a single pool "/mnt/media" (or anything else) and you just use it. The fuse system is the one responsable to manage inodes and support - or not - the hardlink.

@Audionut
Copy link
Contributor Author

there are 2 things:

1. linkdir from torrents (I assume you have only single mount there), otherwise it will be hard to do linking

2. linkdir for data. So data should contains its map:

Don't understand 1, as linking only works with data matching.

2 is good, although it would ideally parse the data directories only from the linkdir: config, if enabled, and ignore datadir:

So instead of adding directories to datadir: and linkdir:, with linking enabled, the directories would only need to be added to linkdir:.

Fuse system makes sense, and if that does indeed work, it would seem the logical solution. I'll have to edumacate myself though, as I don't understand how a single directory in the xseed config and storage pool, automagically creates the link on the correct disk.

@mmgoodnow
Copy link
Collaborator

mmgoodnow commented Mar 27, 2024

Well, it would be the same way that cross seed would do it.

This seems like a pretty niche feature, so unless we see a swarm of demand for it, we probably won't implement it anytime soon . I would look at solutions for running a single file system on multiple disks, or running multiple instances of cross-seed.

@Audionut
Copy link
Contributor Author

I was totally missing that point that everything is in the same mount, so of course the hard link would work within the mount, regardless of the underlying drive structure.

@zakkarry
Copy link
Collaborator

zakkarry commented Apr 3, 2024

there are 2 things:

1. linkdir from torrents (I assume you have only single mount there), otherwise it will be hard to do linking

2. linkdir for data. So data should contains its map:

Don't understand 1, as linking only works with data matching.

This will change with v6, as torrent-based linking has been implemented if appropriately configured

2 is good, although it would ideally parse the data directories only from the linkdir: config, if enabled, and ignore datadir:

So instead of adding directories to datadir: and linkdir:, with linking enabled, the directories would only need to be added to linkdir:.

Fuse system makes sense, and if that does indeed work, it would seem the logical solution. I'll have to edumacate myself though, as I don't understand how a single directory in the xseed config and storage pool, automagically creates the link on the correct disk.

This is how unraid operates, and I believe even mergerfs works in this manner. This is the general consensus on how to accomplish this currently. It requires some reading and understanding of the implementation, but isn't overly complex.

I don't think someone's unwillingness and laziness to get their system configured in a way that accomplishes their desires is necessarily something we should just "solve" for them. It's not a small task, but it's not like a huge hurdle for the user. Spend a few hours and you can have it up rather easily without us "doing it for them" - just my thoughts though.

I don't mean to sound like I'm attacking, but there are solutions to this issue, and the implementation isn't something we necessarily have to prioritize to accommodate people who don't want to bother with getting their system setup in a way to facilitate the optimal setup.

@zakkarry zakkarry added feature New feature or request workflow Relevant to workflow config related to config file labels Apr 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
config related to config file feature New feature or request workflow Relevant to workflow
Projects
None yet
Development

No branches or pull requests

5 participants