LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   HOWTO access a NFS mount within a SAMBA share from WINDOWS? (https://www.linuxquestions.org/questions/linux-networking-3/howto-access-a-nfs-mount-within-a-samba-share-from-windows-621520/)

salmageo 02-15-2008 11:15 PM

HOWTO access a NFS mount within a SAMBA share from WINDOWS?
 
I am wondering if it is possible to mount an NFS drive within a SAMBA share so that a Windows client can view read-only the mounted component of the SAMBA share.

For example I have a SAMBA share called Software on Server X. Software has a path of /data/software. I am NFS mounting a dir from Server Y at Server X path /data/software/archive. On my windows client I am able to see the SAMBA share called Software, however I am unable to see the mounted NFS dir .

I have created a 2nd SAMBA share for the NFS mount on Server X, however this throws an error on my Windows machine saying I do not have the necessary permissions to view the directory.

How can I place mounted dir from a remote *nix server onto a SAMBA server share and have it accessible to Windows Clients? Or is there a better way?

manwichmakesameal 02-15-2008 11:19 PM

Why not just use Samba for all your shares. From what I understand, it is actually more secure than NFS unless you tunnel NFS thru ssh, but that's another story. I have an all Linux network, and I just use Samba for everything. Also allows access to shares from XBMC.

salmageo 02-15-2008 11:26 PM

What I was hoping to do was design a primitive tiered storage system where aged files would move to a read-only location off the primary server, so that backup times on the primary would remain consistent, and the read-only files would only need to be backed up once.

Although the files would physically be on separate servers, depending on their age, the end-user would see a "seamless" list of all files.

I know someone one mentioned the use of symbolic links, however I don't think these can span servers. So what I was looking at doing was mounting the read-only files onto a mount point on the primary server, and allow users read-access only.

Thoughts?

billymayday 02-15-2008 11:46 PM

Did you try mounting the NFS shares in a Samba directory?

salmageo 02-16-2008 08:58 AM

Yea I did and received permission errors. Interesting though that the UID was different on the two different SAMBA servers I am using. How can you sync UIDs?

Maybe that is the problem?

billymayday 02-16-2008 01:17 PM

Ideally when you add the user. You can change them in the password file, but you'll need to change the owner of any files with the old UID

salmageo 02-16-2008 01:31 PM

Thanks for the tip BillyMayDay!

Now back to my original dilemma. Can one mount an NFS drive within a SAMBA share and allow it to be listed and browsed from a windows client???

jdavis2 02-16-2008 09:24 PM

Yes it can be done. Just mount your exported NFS drive under a directory that you will share through Samba. And it will be right there just like a normal subdirectory under a Samba share.

salmageo 02-18-2008 07:07 AM

Well I tried again under two different scenarios:


1. Have a SAMBA share on Server X with an NFS mount from Server Y. Attempting to access the NFS mount from Windows Explorer, however it keeps asking for username to Server X.
2. Have a SAMBA share on Server X with an NFS mount within a SAMBA share on Server Y. Attempting to access the NFS mount from Windows Explorer, however connection times out.

NFS mount set to rw
SAMBA share is completely open


PS other SAMBA shares within Server X work fine

jdavis2 02-18-2008 09:39 AM

Here is what I did. I mounted the NFS drive in a Samba share the way I mentioned before. But what I did to connect was map a network drive from the Windows box.

I have the netbios protocols disabled and no network browsing. If you opt to try to map a network drive you will get the option to logon as a different user if you are using WIN2K or later.

However, with WIN2K or later you should get a logon prompt when trying to map a networked drive unless you are logged on to a domain using domain logon credentials.

If you are using WIN98 or earlier your only choice may be to create a user account on the Windows box that matches one on your Linux box and then setup your Windows box up so that you can logon to it as that linux user. If you do it one of these ways depending on your Windows version, I believe that you will be able to at least map a network drive to your Samba share.

Truthfully unless there is some kind of authentication problem you should have no problem seeing your NFS share through the Samba share if you can see the NFS share on your Linux box.

salmageo 02-18-2008 09:02 PM

OK I think I solved the majority of problems I was having. Because I'm running SELinux, my mount command must include the context

-o context=system_u:object_r:samba_share_t

With this I am able to see my files off an NFS mount

Thanks everyone

jdavis2 02-18-2008 09:43 PM

Quote:

Originally Posted by salmageo (Post 3062016)
Because I'm running SELinux, my mount command must include the context

-o context=system_u:object_r:samba_share_t

That is very interesting! Thanks for sharing that solution.


All times are GMT -5. The time now is 11:33 PM.