NFS sharing between Windows and Linux

Hi Guys,
    Today I am describing about the NFS and cifs sharing between windows to Linux.
I have figured out few points that can help you guys.

Here I have tried on windows version : Server 2008 R2
Linux : RHEL 6.3



WINDOW NFS SHARING AND MOUNTING IT TO LINUX/UNIX HOST
TEST CASE:
     We have a requirement of Mounting Windows directory on a Linux Machine for taking expdp dump from Linux to a remote windows 2008 R2 server machine.
Options We Have:
  We have two option
ü  CIFS Sharing
ü  NFS Sharing
CIFS SHARING:
      Common Internet File Sharing is a easiest method of File sharing. We can mount a windows Directory on a Linux System.
Procedure:
·         It requires no special services to activate.
·         Create a share folder in windows Machine ex: LOGICALBKP
·         In Linux System
   #mount -t cifs -o username=administrator,password='xxx@123'  //10.33.8.33/LOGICALBKP /BKP
Problem with CIFS:
      ORACLE does not recommend to use CIFS for taking expdp to a remote server. So NFS is the only option in our scenario.
NFS SHARING:
       Note: NFS Sharing requires nfs services to be installed in  windows System 
·         NFS sharing is different from   directory sharing in windows.
·         For nfs sharing we need to enable nfs service in windows system.
·         Procedure to configure a nfs service  (in Windows 2008 R2)
1.      Click Start, point to Administrative Tools, and then click Server Manager.
2.      In the left pane, click Manage Roles.
3.      Click Add Roles. The Add Roles Wizard appears.
4.      Click Next. The Select Server Roles options appear.
5.      Select the File Services check box, and then click Next.
6.      The File Services screen appears. Click Next to view the Role Services options.
7.      Select the Services for Network File System (NFS) check box, and then click Next.
8.      Confirm your selection and click Install.
9.      When the installation completes, the installation results appear. Click Close.
Creating a directory for NFS sharing.
      Directory Name: LOGICALBKP
      Nfs sharing of LOGICALBKP directory
  1. On the Windows Server 2008 R2 computer that is running Server for NFS, create a folder to use as the NFS shared folder.
  2. In Windows Explorer, right-click the folder that you created, and click Properties. In Properties, click the NFS Sharing tab. Note that the NFS Sharing tab is not available unless you install Services for Network File System components, as described in the previous section.
  3. Click Manage NFS Sharing, and select Share this folder. Provide a name for the share that you would like to export to NFS client computers.
  4. If you want to allow anonymous access, select Allow anonymous access. You can also specify the UID and GID to be used for anonymous access (the default is -2).
  5. To configure share permissions, click Permissions, click Add, and then do one of the following:
    • In the Names list, click the clients and groups that you want to add, and then click Add.
    • In the Add Names text box, type the names of the clients or groups that you want to add (separate the names in the list with a semicolon).
  6. In the Type of Access list, click the type of access that you want to allow the selected clients and groups.
  7. Select Allow root access if you want a user who is identified as a root user to have access other than as an anonymous user. By default, the user identifier (UID) root user is forced to use the anonymous UID.
  8. In the Encoding list, choose the type of directory and file name encoding to be used for the selected clients and groups.
  9. Click OK twice, and then click Apply.
Note: After nfs service installed,we can observe NFS sharing tab in the property of Directory.

 




Now NFS shared directory is exported from windows Machine and will be visible to the required host, in fact this exported directory will be visible to all the machine in the network.
  

 



 

MOUNT THE SHARED NFS DIRECTORY TO A LINUX MACHINE AND TAKE EXPDP BACKUP:
·         Check the visibility of the nfs shared directory
#showmount –e  10.33.8.33
/LOGICALBKP(everyone)
·         Mount on the Linux Server
Here mount options are recommended by oracle if you are trying to take rman or expdp backup on this mount point.
#mount -o rw,bg,hard,nointr,tcp,nfsvers=3,timeo=600,rsize=32768,wsize=32768,actimeo=0 EK-DC-SRV-02:/LOGICALBKP  /BKP
Now Check whether mounted directory is working properly or not.
 

Hope You guys can enjoy this article.

1 comment: