Linking between volumes

Status
Not open for further replies.

Red

Cadet
Joined
Dec 4, 2013
Messages
5
My server had a volume containing a large amount of data. When space started getting tight I added drives and made a second volume. You can read about that here. Now I've got another problem, and I'm not sure there's a good solution. I could use some advice.

My directory structure consists of folders organized by date. Previously, they were all in a folder like this:

Volume\
Data\
20080414 Data\
20080611 Data\
20081030 Data\
...
20130423 Data\
20131101 Data\

Now I've got a new volume, but I want to continue to make use of the old volume. Old data is rarely accessed anyway but needs to be available. What I've done is to move all the files fron 2013 to the new volume, so now it's:

Volume\
Data\
20080414 Data\
20080611 Data\
20081030 Data\
...

Volume2\
Data\
20130423 Data\
20131101 Data\
Then I changed my CIFS and NFS shares to point to Volume2 rather than Volume. Finally, I tried to create a link.
/mnt/Volume2/Data# ln -s /mnt/Volume/Data Archives
Worked great as long as I was in the shell on the server itself. Then I tried it through a CIFS share and was reminded that symbolic links don't work that way.
Any thoughts on an alternative? I just want to create something that looks like a directory containing all of the files from before 2013 and works over my network shares. Does FreeNAS itself have a way to do this?
 

pirateghost

Unintelligible Geek
Joined
Feb 29, 2012
Messages
4,219
Create a second CIFS share called Archives, and point it to the appropriate volume/Data

dont try and reinvent the wheel here. If it is archive data and is rarely accessed, i see no reason it shouldnt go into its own share
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
Another idea on top of pirateghost's idea is to have a script that automoves from the first volume to the second volume at midnight or something via cronjob. Then it'll handle itself.

I'm all about automation and simplicity!
 

Red

Cadet
Joined
Dec 4, 2013
Messages
5
@piraeghost: Thanks, but that's not what I'm trying to do. I may use your idea as a fallback if nothing else works, but first I want to try to do what I want to do: have the old volume's data appear as a subfolder of the new volume, with the separation transparent to the end user.

@cyberjock: Ah, I hadn't considered using mount. Yes, that would work: share the old volume with CIFS or NFS, then mount it in the new volume at system start. One thing, though (I'm greedy): I'd like to be able to just mount the directory without needing to create a network share. In Linux this can be done by passing -o bind to mount, but that doesn't seem to be available in FreeBSD. Is there a way to do that?
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
Only way is to do 2 shares. What you "should" have done was add your new disks to the existing pool, thereby expanding your pool to use the new space.
 

Dusan

Guru
Joined
Jan 29, 2013
Messages
1,165
Finally, I tried to create a link.
/mnt/Volume2/Data# ln -s /mnt/Volume/Data Archives
Worked great as long as I was in the shell on the server itself. Then I tried it through a CIFS share and was reminded that symbolic links don't work that way.
That is the default behavior, but it can be changed. Add "wide links = yes" to the CIFS Auxiliary parameters. It will still not work if also you enabled Unix Extensions. In that case you also need to add "allow insecure wide links = yes", but that creates a security risk (Unix Extensions allow the clients to create symlinks, so the client would be then able to create a symlink pointing outside the share and follow it).
 
Status
Not open for further replies.
Top