LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 05-14-2019, 06:11 AM   #1
bladez99
LQ Newbie
 
Registered: Jun 2009
Posts: 6

Rep: Reputation: 0
Switch Mounting Protocols NFS to CIFS


Hi All,

I have 2 servers that uses 2 different protocols to access the same set of folders.

Server 1 = NFS protocol
Server 2 = CIFS protocol

for example folder is "folder1" which is available by mounting from any of this server using NFS or CIFS.

However, the question is, i would not know what is available on the client-side, some might have NFS and some might have CIFS and some might even have BOTH or even may not have any at all.

Is there a way to identify which protocol can i use to mount, or some commands to check which protocol is available or some command to know which mounting should i do NFS or CIFS, and if both are available, is there a way to know if all NFS mounts worked before switching to CIFS ?

Hoping to discuss this with the community on a effective way of doing this.
 
Old 05-14-2019, 06:52 AM   #2
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS, Manjaro
Posts: 5,767

Rep: Reputation: 2765Reputation: 2765Reputation: 2765Reputation: 2765Reputation: 2765Reputation: 2765Reputation: 2765Reputation: 2765Reputation: 2765Reputation: 2765Reputation: 2765
I cannot think of a single utility to do ALL of that, but I would examine the man page for showmount to get a start on the NFS side.
 
Old 05-14-2019, 08:01 AM   #3
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,784

Rep: Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937
Depends on the distribution but avahi is a zeroconf network discovery service using the mDNS/DNS-SD protocol. If running the avahi-browse utility should be able to find which server is running which service.

A little more crude but nmap (a port scanning utility) should be able to detect what ports are open which corresponds to what service is running.
 
Old 05-14-2019, 09:37 AM   #4
bladez99
LQ Newbie
 
Registered: Jun 2009
Posts: 6

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by wpeckham View Post
I cannot think of a single utility to do ALL of that, but I would examine the man page for showmount to get a start on the NFS side.
Ok I can try looking at showmount.
 
Old 05-14-2019, 09:43 AM   #5
bladez99
LQ Newbie
 
Registered: Jun 2009
Posts: 6

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by michaelk View Post
Depends on the distribution but avahi is a zeroconf network discovery service using the mDNS/DNS-SD protocol. If running the avahi-browse utility should be able to find which server is running which service.

A little more crude but nmap (a port scanning utility) should be able to detect what ports are open which corresponds to what service is running.
I think you might have gotten me in wrong context. I setup the server myself and therefore I know which server is what protocol. But what I am asking here is, how do I know of my clients consists of what capability NFS/CIFS in order for me to direct them via scripting to use the correct protocol and commandline with the right protocol.

For example, as I mention SERVER 1 and SERVER 2, NFS and CIFS individually.

Now I have a client, of which I do not know what the client capabilities are whether to mount using NFS or CIFS,

1- how can I identify that?
2- if they happen to have both capabilities, how can I know NFS was successful completely and therefore I can skip trying CIFS, and if NFS failed, I would try with CIFS?
 
Old 05-14-2019, 10:43 AM   #6
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,784

Rep: Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937
Sorry, you did post client side. I agree with wpeckham there isn't a definitive method to determine client capabilities.

Depends on distribution/version but typically mount.cifs is not installed by default and would indicate if SMB/CIFS is available. With nfs it depends on version. NFS V3 requires rpcbind to be installed and running. In addition, if the client does not have to mount the share from the command line then mount.cifs is not required and access can be accomplished from the file browser. I don't know of a file browser that has a built in nfs client.

On the other hand pick one and make all clients use the same protocol then it does not matter.
 
1 members found this post helpful.
Old 05-14-2019, 07:05 PM   #7
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS, Manjaro
Posts: 5,767

Rep: Reputation: 2765Reputation: 2765Reputation: 2765Reputation: 2765Reputation: 2765Reputation: 2765Reputation: 2765Reputation: 2765Reputation: 2765Reputation: 2765Reputation: 2765
Quote:
Originally Posted by michaelk View Post
Sorry, you did post client side. I agree with wpeckham there isn't a definitive method to determine client capabilities.

Depends on distribution/version but typically mount.cifs is not installed by default and would indicate if SMB/CIFS is available. With nfs it depends on version. NFS V3 requires rpcbind to be installed and running. In addition, if the client does not have to mount the share from the command line then mount.cifs is not required and access can be accomplished from the file browser. I don't know of a file browser that has a built in nfs client.

On the other hand pick one and make all clients use the same protocol then it does not matter.
Since Windows can have a problem with NFS, but both can handle CIFS properly, I would standardize on CIFS for your network share standard. Make sure you are using the latest SAMBA packages available on the LINUX clients.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
mount.nfs: access denied by server while mounting (null) when mounting nfs shares into each other. weylyn1 Linux - General 5 12-06-2017 12:24 PM
mounting cifs/nfs using DNS trackstar2000 Linux - Newbie 3 10-24-2017 05:59 PM
[B]RHEL & CENTOS: What is the best practice for mounting NFS/CIFS/DISKS[/B] person_of_interest Linux - Newbie 1 02-22-2015 08:16 AM
Problems mounting Netgear NAS drive with CIFS, NFS. Cenobite Linux - Networking 1 07-07-2010 01:52 AM
Why is multicast protocols designed in Layer 3 when routing protocols in L5 vineeth_thampi Linux - Networking 2 07-04-2006 05:23 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration