Thread: Merge drives
View Single Post
Old 06-03-2013, 06:19 AM  
Yil
Too much time...
 
Join Date: May 2005
Posts: 1,194
Default

Assuming you are running a recent version (7.5.3+) the BEST matching directory will be used for new files/folders or if they are all the same the FIRST one found. From an example in the Changelog:

Code:
      "C:\Games"   /Games
      "D:\Games2"  /Games

   And these real directories:
      C:\Games\Favorites
      C:\Games\New
      D:\Games2\New
      D:\Games2\New\Test
      D:\Games2\Old

   New files or directories will be created thus:
      /Games/New/A       -> C:\Games\New\A
      /Games/New/Test/B  -> D:\Games2\New\Test\B
      /Games/Favorites/C -> C:\Games\Favorites\C
      /Games/Old/D       -> D:\Games2\Old\D
The idea is to allow you to split dirs across the 2 drives and yet keep related things together. Thus you can keep all the seasons of a particular tv-show together on one drive including newly uploaded episodes, and do the same thing for another show on a different drive. If dropping everything into one big dir then just placing the new drive first will put everything new onto it. You might want to move a couple of shows to the new drive to make room for new episodes on the older drive if shows have their own subdir though...

I've got several posts, and lots of local notes, on how to handle this type of problem even better in the future though. For example, OnNewDir events in the future will have a way to specify where the directory should actually be created if more than one path is possible so scripts can customize it however you want. If the script doesn't want to handle it, I had a solution using a chattr setting that could determine where the new dir should go on a directory-by-directory basis. However I ran into issues when people use multiple .vfs files that mount things differently so I never released that feature...

Finally there is one other issue I should mention. There currently isn't a graceful way to force a directory to be moved across filesystems inside a merged directory. Say you just added a new disk, updated the .vfs to place it first, and then want to move half the shows to it. How would you do that inside the ftp (especially since it would preserve directory timestamps when done through the server)? My original idea was to enable appending :1, :2, etc onto names to force that vfs entry to be used to resolve the path. Users with the +V flag could even enable modes where extra listing information would help with this by automatically creating multiple entries for each subdir split across drives! I never finished the extra entry stuff though so I disabled the features, but you can use "list -alV" to get the group field to display which VFS entries were used to resolve each file/dir which is kind of handy if you have the .vfs file to reference.

HOWEVER, there are two easy way you can move dirs across filesystems when setting things up but it requires seeing extra paths. The first way is to create an admin.vfs file that's the same as default.vfs but ALSO mounts the directories separately. I.e. c:\Games onto /Games-C and d:\Games onto /Games-D as well as both dirs onto plain /Games. Now you can move dirs across disks easily by using the -Drive mountpoints. If you or other admins might use them for uploading make sure you add/modify the [SECTIONS] entry in the .ini file if you have a /Games section to match the new paths and update your bot configuration to do the same else you'll confuse people...

The other solution is probably better since I dislike using more than one .vfs file, because sooner or later you'll forget to mirror a change to admin.vfs. Instead of creating an admin.vfs file, just add the new entries directly to default.vfs and then turn the new dirs into private hidden dirs via site chattr +h <dir> "VM" . Now only VM flagged users (plus anyone else you specify) can see the /Games-C style dirs...

Hope that helps.
Yil is offline   Reply With Quote