Jump to content

How do I specify the path to the share?


Recommended Posts

Hello,

 

I am running version 6.11.5 of unRAID. I have a share for myself at mnt/user/server and it is named "server" . That way I have access to all of my data.

 

There is a subdirectory a few levels down called "movies" . I would like to setup up a share for just that directory as read only for my girlfriend.

 

When I go to the shares tab (I am using user shares) and click "Add Share" it lets me name the share as "movies" however I can not figure out how to specify the path to the share, which is mnt/user/server/video/movies.

 

When you are naming the share it says that you can't use special characters so how do I point the share to the right directory?

 

 

 

Sent from my SM-S918U using Tapatalk

 

 

Link to comment

You can't.  (EDIT:  Not really true...  continue reading this thread for another way to do this.)  Begin by getting down the documentation from the first post in this thread:

        https://forums.unraid.net/topic/110580-security-is-not-a-dirty-word-unraid-windows-10-smb-setup/

 

Set up two users-- one for you. one for girl girl.  Make share 'Private'.  Read-only permission of GF.  Read-Write permission for you.

 

Navigate with Windows Explorer to the Media folder.  Right click on the Media Folder and select 'Map network drive...'   Right-click Drag the Mapped drive to the desktop and create a shortcut.  Done.

 

Edited by Frank1940
Link to comment
You can do this by creating the new share (empty) and have a symbolic link to the movies folder you want within the new share.
The caveat is that permissions will be whatever this new share is set to, so set as read-only there.
I had never heard of a symbolic link. However when I Googled it, I saw that it was similar to a shortcut in Windows. I used the ln -s command that I read about in the terminal and it worked like a charm. Thank you for pointing me in the right direction!

Sent from my SM-X800 using Tapatalk

Link to comment

You can't make a share "within" a share without taking some "liberties" with SMB.

 

You have to shut down the array to do it (not yet).

 

You have to go to Settings>SMB

 

You have to look at SMB Extras... You might see things there?

 

If you don't, you can make a share like:

 

[rootshare]
  path = /mnt/user
  comment = "only do this if you know what you are doing"
  browseable = no
  valid users = *you* (your user name)
  write list = *you* (your user name)

 

Why isn't a password in there?... Get it?

 

(There isn't a password because you already have root)

 

I'm pretty sure I haven't been clear enough about this, but it's too damned easy if you have access (which you do); to shoot yourself in the foot (if you want to).

 

MrGrey.


 

 

 

 

 

 

Link to comment
10 hours ago, tjb_altf4 said:

You can do this by creating the new share (empty) and have a symbolic link to the movies folder you want within the new share.

The caveat is that permissions will be whatever this new share is set to, so set as read-only there.

I am doing some research (and study) on using this technique.  Running the   ln -s   command in a terminal window in the root directory of the new Share will (apparently) create the symbolic link to the 'Movies' folder within the other Share.  Is this correct so far?

 

Now for the $64,000 question:  What happens to that symbolic link when the server is rebooted? 

 

Link to comment
On 4/8/2023 at 7:55 AM, Frank1940 said:

Now for the $64,000 question:  What happens to that symbolic link when the server is rebooted? 

 

After waiting a few days for an answer, I decided to do a bit of testing on my own.  I set a Symbolic Linked Share to a directory within another share.  

 

I first created a new share (named   SymLinkShare  ).  (As a bit of disclosure, I actually emptied out an old test share and renamed it.)   Set up the share for export and sharing.  Be aware as you do this, the permissions you give to the various users could give those users permission to modify/rename/delete the original files in the other Share!!!!

 

I then used the following command line in the Unraid terminal Window:

ln -s /mnt/user/RoseMediaTest/I /mnt/user/SymLinkShare

 

Where:

      /mnt/user/RoseMediaTest/I   -------> is the path to the directory within another share that I want as the root for the linked share.

     /mnt/user/SymLinkShare       -------> is the path to the new created share

 

IF you want more information about the command, google   linux symbolic link directory

 

Now for the answer to the $64,000 Question!  YES, the symbolic link will survive the reboot!  

 

@limetech, @JorgeB  Do you know of any reason(s) why Symbolic Linked Shares should not be used?  

Link to comment
5 hours ago, Kilrah said:

The generic reason is simply that you risk giving access to things you didn't mean to if you're not careful.

 

I realize that fact.  A Symbolic Linked Share is a 'Backdoor' to the inside of another Share.  It could easily be a security issue/problem.  But that does not change that fact that it is quite easy for the Administrator (root) of an Unraid server to set up a Symbolic Linked Share up.  (I just doubled checked.  I can write to the Symbolic Linked Share via SMB even when the SMB user does not have access privileges to the original Share that the Link is pointed to!  I am not set up to test what happens with NFS...)  

 

If we put the security issue aside, is there any other reason that a Symbolic Linked Share does not work?  There have been inquires in the past for a way to be able to do what a Symbolic Linked Share will (apparently) do and the response has been "it is not possible".   I hate to know that there is a way when someone asks how to configure their Unraid server to work the way they need it to and say "No, it is not possible".   Everything that I have try to do on my linked share has worked-- copy files to it, delete a preexisting file, open a file using the default application, edit a file and save it back.   One thing that is different is that the Symbolic Linked Share will only use the 'cache' if the original Share is setup to use the cache drive.  In fact, directory created on the cache drive is the original Share when the copy is being made to the Symbolic Linked Share.  Mover worked.

 

Can anyone think of any other tasks that should be tested?  

 

 

Edited by Frank1940
Link to comment

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.

×
×
  • Create New...