14 Jan 2008 • Comments
Fake DFS is a small script that mimics DFS folder grouping without the hassle or overhead of running any kind of server. While the downside of this is that changes to the FS aren’t replicated in real time, you can adjust things (cron) or use it in conjunction with other programs to make things synchronize quickly.
What does that mean?
Let’s say you have 3 machines on your home network. Each has a 200 Gig drive. Say you created a folder structure on Machine A as follows:
/mp3s /tv /movies
Now inside /tv you create a folder called "The Office" and in there you create another folder called "Season 3". So you put episodes 1,2 and 3 of Season 3 into the folder but by the 4th episode have filled the capacity of the drive in Machine A (with Mp3s and movies let's say). However you still have 2 other machines with plenty of room on the drives. So now on Machine B you create an identical folder structure:
/mp3s /tv /The Office /Season 3 /movies
And you place episode 4 in the directory.
Now how are you going to see ALL of Season 4 as if they are in the same directory on the same drive?
So to use this script logon to the machine you are going to make the "master" server (IE where the FS’s will be merged). Mount the remote drives as CIFS/SAMBA or NFS. Create a "Master" directory, this is where you will see on single file structure for all of you drives. Then run the script with something like:
$ fdfs parent destination
Where parent is a the top part of the filesystem you want to be centralized and destination is the folder you created as the "Master" folder or a folder within.
Then run the command again for as many sub-structures as you wish to centralize. I create a small shell script that has all of my mappings in it so that re-syncing the FS is simple:
#!/bin/sh fdfs /media/Archive/TV/ /media/mythtv/TV/ fdfs /media/zxc/TV/ /media/mythtv/TV/ fdfs /media/Archive/Documentary/ /media/mythtv/Documentary/ fdfs /media/zxc/Documentary/ /media/mythtv/Documentary/ fdfs /media/Archive/Movies/ /media/mythtv/Movies/ fdfs /media/zxc/Movies/ /media/mythtv/Movies/ fdfs /media/zxc/Music/ /media/mythtv/Music/
Now you just run the shell script and it will "re-sync" the file system (IE if you change a file on one of the "child" filesystems).
fdfs - download