WalkerOfTheDay
Posts: 7
Joined: Mon May 13, 2019 12:47 pm

Two mount points to the same disk possible ??

Tue May 14, 2019 9:00 am

Hi guys,

I hope you will be able to help an absolute Linux nOOb out. I also posted this in the Dutch section, but I think I
might get more response in the English section so that why I'm posting it here as well.

Years ago I have configured my rPi 2 as a Home Server using this https://melgrubb.com/2014/08/01/raspber ... ver-index/ guide.

Everything works as intended and I'm quite happy with it. The guide helped me to create a data share to the ntfs partition of the USB drive using Webmin.
This looks like this:

Image

Info about the partition:
Image

fstab:

Code: Select all

/dev/disk/by-uuid/0D8378F30372ED28      /mnt/data       ntfs-3g defaults,noatime        0       0
This share is wide open so everyone on the (Windows) network can access the files, which is ok by me.

But now I would like to create another share on the same usb drive with user restrictions where I can place my private
files.

So I though I'd simply do this:
Image
And then this:

Code: Select all

/dev/disk/by-uuid/0D8378F30372ED28      /mnt/prive       ntfs-3g defaults,noatime        0       0
But that doesn't seem to be working. The 'prive' share becomes available in Windows but it seems to lead to the SD Card, not to the USB drive.

Like I said, total Linux noob so I apologize in advance for my stupidity...

Ernst
Posts: 1092
Joined: Sat Feb 04, 2017 9:39 am
Location: Germany

Re: Two mount points to the same disk possible ??

Tue May 14, 2019 9:14 am

What you are doing does not make sense and is not really needed.
To me it looks that you have mounted the USB partition as one share and now you want to mount the same partition as a different share. What this means is that both shares will see the same information.

The simple solution is to use only one share with a private directory. From Windows change the security on the private directory to allow access to your user name and remove any reference to "Users" and "Authenticated Users". Make sure that you propagate these permissions in the tree under the directory.
The road to insanity is paved with static ip addresses

BespokeTech
Posts: 40
Joined: Thu Apr 04, 2019 8:14 pm

Re: Two mount points to the same disk possible ??

Tue May 14, 2019 9:14 am

Hi,

I have never used webmin before, but looking at your screenshots you appear to be confusing mount points and folders.

So in your first screenshot, you are showing that you have a share called "Data" and the directory being shared is "/mnt/data". Essentially this is saying share the entire partition and all folders / data within it.

I think what you need to do is change the folder structure on your drive so you essentially have a folder that everyone can access "Data" and another folder for your private share "Prive"

Then change your share setup like so....

"Data" directory to share becomes /mnt/data/everyonesdatafolder
"Prive" directory to share becomes /mnt/data/privatefolder

WalkerOfTheDay
Posts: 7
Joined: Mon May 13, 2019 12:47 pm

Re: Two mount points to the same disk possible ??

Tue May 14, 2019 9:35 am

Thanks guys. It seems like I'm overcomplicating things I see :shock:

I'll try your suggestion. Many thanks.

@Ernst:
I can set the file permissions to the private share straight from Windows ??
I never would have thought that would be possible.

This shouldn't be arranged from the rPi ??

LTolledo
Posts: 1387
Joined: Sat Mar 17, 2018 7:29 am

Re: Two mount points to the same disk possible ??

Tue May 14, 2019 10:03 am

I've tried Webmin about a year ago... for the exact purpose the OP is trying to do... share a drive on the network.
It was as a "replacement" for Open Media Vault, that was not available for the RPi3B. (Tried also OMV on other SBC....hated it.)

though I liked the GUI, and the "ease to setup", I find that Webmin does have a lot of overhead.
after a month of test I realized that the same can be achieved via CLI, minus the overhead.

from then on I've been doing my file server setup via CLI (have 4 of those lying around.... somewhere....)

same disk 2 mount points.... my take on this is.... there are two partitions on the same disk, each partition mounted separately... and of course shared separately...

or it can be two separate directories on the same disk, each mounted separately....

Oh and I've mounted my Buffalo NAS as 3 separate mount points on this RPi3B+, depending on the share folder...
"Don't come to me with 'issues' for I don't know how to deal with those
Come to me with 'problems' and I'll help you find solutions"

Some people be like:
"Help me! Am drowning! But dont you dare touch me nor come near me!"

WalkerOfTheDay
Posts: 7
Joined: Mon May 13, 2019 12:47 pm

Re: Two mount points to the same disk possible ??

Tue May 14, 2019 10:37 am

Thanks guys.

I have now succesfully setup the second share, but when I try to give access to only one user I cannot seem
to log on from Windows. Any suggestions ?

This is what I did:

Image

Image

Image

Image

LTolledo
Posts: 1387
Joined: Sat Mar 17, 2018 7:29 am

Re: Two mount points to the same disk possible ??

Tue May 14, 2019 10:44 am

you have rob as user in windows?
"Don't come to me with 'issues' for I don't know how to deal with those
Come to me with 'problems' and I'll help you find solutions"

Some people be like:
"Help me! Am drowning! But dont you dare touch me nor come near me!"

Ernst
Posts: 1092
Joined: Sat Feb 04, 2017 9:39 am
Location: Germany

Re: Two mount points to the same disk possible ??

Tue May 14, 2019 10:47 am

WalkerOfTheDay wrote:
Tue May 14, 2019 9:35 am
@Ernst:
I can set the file permissions to the private share straight from Windows ??
Honest answer: I do not know at the moment.

In a Windows environment this would not be a problem but I just noticed that it does not work the same when the share is exported from linux. The problem is that (in my environment) I can only use security objects available on the raspberry, where I do not have any users.

To me it looks that using folder level security it will be necessary to dig deeper in the a samba security concept (?) or to split the USB file system in two folders each with a different export using access control.

You must be aware that there are two levels of access control, the first level is on the share within samba, the second level is within ntfs. To restrict access to the share you need a username and a password and configure this within samba. To restricts access to folders you need a username / password and this is configured within the file system. At the moment I do not know how this should/can be done in this type of environment.

You must have some idea of a security concept if you want to restrict access to private information. You will have to create users on the samba server and you have to restrict access to the shares to these users. When you connect to the share you must provide a username / password so that samba knows that you are the user that may access certain resources.
The road to insanity is paved with static ip addresses

WalkerOfTheDay
Posts: 7
Joined: Mon May 13, 2019 12:47 pm

Re: Two mount points to the same disk possible ??

Tue May 14, 2019 11:03 am

LTolledo wrote:
Tue May 14, 2019 10:44 am
you have rob as user in windows?
I do, but does that matter ?
When I click the share I'm asked for a username/password so when this matches one would think access should be granted right?

Edit:
This is strange (to me at least).

The user Rob in Windows had a different password than the one I've setup on the rPi.

I just changed the password on the Pi to the one in Windows, and now I'm able to logon.
But I don't understand why ?

What if I would connect to my vpn server running on the pi from a totally different pc ?
Would I then be forced to create the same user account on the Windows pc ?
Doesn't make sense to me, because why would I get this dialog asking for my username and password ?

edit
NVM. Figured it out. I created another Samba user on the Pi that doesn't exist on the PC, and now I am able
to logon with the credentials created on the pi.

Thanks for you help.

BespokeTech
Posts: 40
Joined: Thu Apr 04, 2019 8:14 pm

Re: Two mount points to the same disk possible ??

Wed May 15, 2019 10:02 am

Glad to hear you got it working. For windows clients I personally find it more reliable to map the drive from the command prompt of windows...

net use s: \\tower\movies /user:username password /persistent:Yes

LTolledo
Posts: 1387
Joined: Sat Mar 17, 2018 7:29 am

Re: Two mount points to the same disk possible ??

Wed May 15, 2019 10:23 am

Me to am glad you got access working.... it took you just one day (?) to figure it out.... with the help of the generous volunteers in this forum... :D

Took me 2.5 days on my own...... ;)

So 1 disk 2 mount points (thereby 2 share points) also success?
"Don't come to me with 'issues' for I don't know how to deal with those
Come to me with 'problems' and I'll help you find solutions"

Some people be like:
"Help me! Am drowning! But dont you dare touch me nor come near me!"

WalkerOfTheDay
Posts: 7
Joined: Mon May 13, 2019 12:47 pm

Re: Two mount points to the same disk possible ??

Fri May 17, 2019 12:52 pm

LTolledo wrote:
Wed May 15, 2019 10:23 am
Me to am glad you got access working.... it took you just one day (?) to figure it out.... with the help of the generous volunteers in this forum... :D

Took me 2.5 days on my own...... ;)

So 1 disk 2 mount points (thereby 2 share points) also success?
Thanks LTolledo,

It took me quite a bit more day :) I even gave up at one point.

But with the help of the forum I achieved my goal.

It did not succeed creating 2 mount points on one disk, but after moving some folders around I don't need that
way.

WalkerOfTheDay
Posts: 7
Joined: Mon May 13, 2019 12:47 pm

Re: Two mount points to the same disk possible ??

Fri May 17, 2019 12:55 pm

BespokeTech wrote:
Wed May 15, 2019 10:02 am
Glad to hear you got it working. For windows clients I personally find it more reliable to map the drive from the command prompt of windows...

net use s: \\tower\movies /user:username password /persistent:Yes
Yeah that's an option too. But I'm always a bit reluctant to do this.
Once we were hit with ransomware virus at work, and the shares that had not been mapped to a drive
letter were unafected by the virus because it only looked at drive letters.

Which of course doesn't mean other ransomeware variants won't affect non-mapped ones.

Return to “General discussion”