Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Hard links, shfs, and seeding moved torrents

Featured Replies

I've been trying to conceive of a solution to help manage moving/renaming torrent files on my unRAID system while continuing to seed. A lifehacker post today prompted me to revisit how to automate this to some extent.

 

I run a standard unRAID 4.5 with purko's untorrent package, cache_dirs, and jungledisk CLI. Right now rtorrent downloads stuff to my cache drive in a directory excluded from the user file system. It's not too much trouble to move stuff out to the user drives and then point rtorrent to /mnt/user/... instead of /mnt/cache/... . The trouble comes if I need to rename files to my liking or for import to media libraries, but want to continue seeding. To date, when I've taken the time to bother at all, I've created symlinks on the cache drive to the moved/renamed files on the user fs. That works fine, provided I don't continue to rename the files after the link is created. I'd like to set up the redirect for rtorrent once and then not worry about it, but that's where it gets fuzzy for me.

 

I'm certainly not a Linux whiz-bang, but I manage. What I understand is that while a hardlink in the fuse shfs or underlying tmpfs might be possible, it's all volatile and would be lost on any reboot. (wiki states that the shfs is created on top of a tmpfs) A hardlink from the ReiserFS of the cache drive to the shfs just isn't possible and wouldn't work anyway cause on reboot the inode (or equivalent) in the shfs might not belong to the same target file anymore.

 

So is there any good way to move a file from cache to a parity protected drive while simultaneously keeping a link to it on the cache drive that will be tracked or won't get broken if the target is relocated? Anything I can conceive of would seem to require hooks into the shfs or the individual disks to track when files are moved/renamed. Or maybe hardlinks in a special directory on the individual disks, that will be used by rtorrent but excluded/hidden from the usual media library folders? The idea being that rtorrent looks in /mnt/user/hardlinks/ with the /mnt/diskN/hardlinks/ directories containing aliases for the moved/renamed files elsewhere on /mnt/diskN/, so that rtorrent doesn't have to care which disk the files are on.

 

That might work fine so long as you didn't later move files to yet another disk in the array, but I guess you could add another tool/script to handle this sort of move... Actually it would work fine, but moving to another disk would essentially be a copy at that point...So now you have to be careful to delete all links if at some point you really want to get rid of a file... Can you symlink to an inode? In other words, a target-filename-agnostic cross-filesystem link? Probably a bad idea, even if you could, but in a controlled system...

 

Anyway, I'm just sort of brainstorming here, hoping for input from folks with more linux experience than I have. My goal would be to create a "mv_and_ln" script that could be called maybe by rtorrent, manually, or the unraid mover script.

 

  • copy files from cache disk to new location on diskN
  • hardlink from /mnt/diskN/hardlinks/ to new location of files
  • signal rtorrent to now look at /mnt/user/hardlinks/ for the moved torrent
  • rtorrent will probably rehash to confirm file?
  • delete original file on cache disk

 

Now you can rename the files all you like and rtorrent shouldn't care or notice. You could probably add some logic there to check for other hardlinks and remove them if moving between disks, to make it generic for the initial moves or subsequent ones...

In transmission I have it set to use an incomplete directory and set the complete directory to be within the array. When it's done downloading, it gets moved onto the array. I don't know if rTorrent has such a feature, you'll have to look for it.

  • Author

yes, there's something similar in rtorrent, but what I'm referring to is not just changing location, but also changing filenames. Some clients can handle a different filename if there's only one file, or a different directory name if there's multiple files, but I don't know of anyway to tell any client or rtorrent that each file in a multi-file torrent has a different name than the ".torrent" file indicates.

Archived

This topic is now archived and is closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.