Jump to content
172pilot

Share same directory under 2 names??

12 posts in this topic Last Reply

Recommended Posts

Hi,

 

Sorry if this is a dumb question, but I've searched the documentation, and can't find an answer....

 

My current "File Server" is a Windows 2003 box which I'm considering replacing with an UnRaid.

 

All of my shares, I typically share out with two different names, for example "Music" and "Music$"  (the $ making it hidden).  The difference is that the non-hidden share is read-only at the share level, and the hidden one is read/write.  My purpose is so that things like my software install repository, my music, and my other media files can't be overwritten by a virus or accidental deletion by my wife or myself..  BUT, when I want to add a new ISO to the software share, or rip that new CD I bought so that I can load it into Itunes, I just reference the UNC and add the "$" so that I get write access for that transaction...

 

Is there any way to accomplish this in UnRaid?  If so, how...  If not, is there a similarly protected work-around that I could do?

 

Initially, I thought that the user level rights would be the best bet, but I am assuming that like most SMB servers, you can only be connected from any one workstation to any one server as one specific user ID at a time, in otherwords, I can't map to \\unraid\music as "sjones" and then map to \\unraid\music on another drive letter and have it connected as admin or root.. 

 

If this is all true, then the only solution I think I can see is to log into the unraid and change the whole share to r/w when I want to write to it, and then change it back to r/o when I'm done, and/or I'm wondering if I can have nested shares, such that my directory could look like \writable\music  where the "writable" directory would be shared out as r/w, while the "music" directory would be shared r/o..  This way, when I wanted to write, I'd just map to \\unraid\writable\music instead of \\unraid\music to get to the same place on the file structure.

 

I hope this makes sense...  Any help would be appreciated..  I think I'm going to build the machine in any case, and play with it, but if there's anyone who already knows an answer to my question, that'd be a great help!

 

thanks!

-Steve

Share this post


Link to post

Yes you can do that.  You can also set up one share and have it updatable only by certain IDs, read only by others, and not accessible by still others.

Share this post


Link to post

Or make the Share Read-Only, and export the data disk as Read/Write/Hidden, then you can write directly to the disks, but access them through the User Share.  (it's late, I'm tired, apologies if I missed something obvious)

Share this post


Link to post

Anyone care to explain the process?

 

On the "Shares" page, I can only seem to provide "Included disk(s)".  How do I tell it to use the same directories of a share that is currently set to use "disk1, disk2" without it creating a whole new share with a whole new directory on the disk(s)?

Share this post


Link to post

I haven't used user controls or anything fancy with User Shares, someone else will need to help there.  Here is an example of the simple way to do it.  I do understand it may not fit your needs.

 

You have a Share called Music, set to Read Only, includes disk1,disk2, network path is //Tower/Music.

 

Then you set Disk Shares to Export read/write or Export read/write, hidden as you may prefer.  Then you can write to either of the 2 paths:  //Tower/disk1/Music and //Tower/disk2/Music.  You are going around the User Share system, by writing directly to the disks.  The User Share //Tower/Music is the public path, and is read only.

Share this post


Link to post

Hmm.. That works for having a few disks (currently my case) but seems unreasonable if you have a lot.  You'd have to map 6 drive letters for write access and then map the main share if you didn't want to have to search across all the drives when you are looking for a file.

 

Is there any way to create a share point that points to another share point?  For example, create a share called \\Tower\RMusic (R=read only, for example) and have it point to \\Tower\Music that would allow us to set the control to read only on the "RMusic" share, but it point to the same files as the "Music" share. Or, for example, Share a directory within a share?  On my current data server (running CentOS), I like to have a "data" share that allows me browse everything on the server, and have individual shares (such as music, movies, games, etc) within that data directory.

 

I'm new to unRAID, but not new to Linux or Samba.  Is there not a lot of demand for this kind of control, or is there something with the way the virtual file system works that makes this kind of stuff more difficult?

Share this post


Link to post

If you are not new to Samba, then you are not new to unRAID's share features, because Samba is how it is all implemented.

 

With user shares, the front end Web GUI provides a set of features to enable security on your shares.  You can set them up so they are R/O for some users and R/W for others.  It does not allow the full power of Samba, however.

 

But take a look at this post.  It is quite easy to define your own Samba shares.  With this you could define any number of shares to the same location with different settings.

 

I am pretty confident that anything you want to do from a share perspective can be done with unRAID.

Share this post


Link to post

I'm new to unRAID, but not new to Linux or Samba.  Is there not a lot of demand for this kind of control, or is there something with the way the virtual file system works that makes this kind of stuff more difficult?

 

It's a matter of keeping things simple for those who know nothing about linux/samba.  The unRAID share model defines two types of shares: disk shares and user shares.  Disk shares are simply samba shares with path pointing to root of each mounted data disk.  User shares are samba shares auto-generated based on all top-level directories found on all the data disks (with the ability to merge the contents of same-named top-level directories on each disk into a single view).

 

Of course there is far more you can do with Samba, but at cost of ever increasing complexity.

 

In your case what you are asking for is essentially an alias, where two different share names point to the same path but with different access rights.  I wasn't even aware this was possible to do in Windows - an interesting idea.

 

In the next unRAID beta release we added an 'include' statement in the smb.conf file at the end of the global section that references a file called 'config/smb.extra'.  You could use this to set up all kinds of special share configurations including the two you mention (creating an alias with different access rights, and creating shares that point to subdirs).  Of course, this requires a good understanding of how samba works.

Share this post


Link to post

Added to the FAQ (link back only), here.  Feel free to edit.

 

(I realize there is not a complete answer yet, the FAQ entry just points to this ongoing discussion.)

Share this post


Link to post

In the next unRAID beta release we added an 'include' statement in the smb.conf file at the end of the global section that references a file called 'config/smb.extra'.  You could use this to set up all kinds of special share configurations including the two you mention (creating an alias with different access rights, and creating shares that point to subdirs).  Of course, this requires a good understanding of how samba works.

 

Wish I'd thougt of that.  Hey, wait a minute, i DID think of that!  ;)

 

Thanks for putting this in, Tom!

Share this post


Link to post

I'd like to bring this post back to life.  I'm thinking of how best to implement a CACHE drive and the following capabilities would have important implications on how a CACHE drive could be implemented:

 

1) Creating an alias with different access rights to the same share

2) Creating shares that point to subdirs

 

Right now I have my "Movies" directory as a subdirectory of a root-level share called "Media".  I do this so that the "Media" share can be mounted as Read-Only by all my users (This share also contains "Music", "Photos", & "Home-Video", etc...).Since I am the only one who populates these shares with data, I do so by writing to the disk share. 

 

I'd like to implement the CACHE drive for writing new ISO files to the "Movie" directory, but not to the other subdirectories of the "Media" share (because the "Movie" ISO's are so large and the other media type files are so small.)

 

The way shares are currently implemented in the unRAID GUI, I am not able to utilize the benefit of a CACHE drive for shares that are configured as Read-Only.  That is a bummer.

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.