delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/12/12/13:22:52

X-Spam-Check-By: sourceware.org
content-class: urn:content-classes:message
MIME-Version: 1.0
Subject: RE: Starting with Cygwin NFS Server
Date: Mon, 12 Dec 2005 13:13:49 -0500
Message-ID: <3D848382FB72E249812901444C6BDB1D03E05165@exchange.timesys.com>
From: "Robb, Sam" <sam DOT robb AT timesys DOT com>
To: <cygwin AT cygwin DOT com>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id jBCIMnap030980

> > The doc you mentioned above is the README for the original
> > nfs-server package.  There is a cygwin-specific README for
> > the nfs-server package as well, under:
> 
> >  /usr/share/doc/Cygwin/nfs-server-2.3-3.README
> 
> [snip]
> 
> Thanks.
> 
> Perhaps the foloowing question is off-topic.

Not quite, I don't think...

> NFS Client runs on UNIX.
> Cygwin NFS Server runs on Windows.
> 
> 
> How to specify the device (Windows-directory/folder) to be mounted on
> mount point (UNIX-directory)?
> 
> 
> The problem is how to set the pathname of the exported file system on
> Windows NFS Server.
> 
> 
> For UNIX NFS Server the pathname might be set as it follows
> <IP address of UNIX machine>:/dir1/dir2
> 
> 
> For instance, Windows machine contains folder C:\folder1\folder2 that
> is to be exported.
> How to set the pathname? What to do with "C:"?
> 
> 
> Should
> <IP address of UNIX machine>:C:\folder1\folder2
> work?

No - the nfs-server is a cygwin service, and so works with cygwin
paths.  As a quick example, let's say you want to export two
directories, public and private:

  C:\exports\public
  C:\exports\private

You can use the cygpath utility to translate the Windows paths
into cygwin paths:

  $ cygpath -u 'C:\exports\public'
  /cygdrive/c/exports/public

  $ cygpath -u 'C:\exports\private'
  /cygdrive/c/exports/private

Now, you can edit your /etc/exports file to export these two
directories:

  /cygdrive/c/exports/public     192.168.1.100(ro map_static=/etc/nfs/server.map)
  /cygdrive/c/exports/private    192.168.1.100(rw map_static=/etc/nfs/server.map)

After this, you can start the portmap, mountd, and nfsd.  On
the UNIX machine, you would mount the directories as usual, ex:

  $ mount -t nfs <IP address of cygwin machine>:/cygdrive/c/exports/public /mnt/nfs/public
  $ mount -t nfs <IP address of cygwin machine>:/cygdrive/c/exports/private /mnt/nfs/private

Simple as pi :-/

Note that there are potential issues with exporting a regular old
Windows directory (ex, the '/cygdrive/c/...' type paths).  Please
read the docs for some additional info on this.  If you can arrange
your exports so that they are from under the cygwin root directory,
ex:

  mkdir -p /exports/public
  mkdir -p /exports/private

... then everything is a little easier.  In this case, aside from
avoiding potnetial problems, your /etc/exports look a little cleaner:

  /exports/public     192.168.1.100(ro map_static=/etc/nfs/server.map)
  /exports/private    192.168.1.100(rw map_static=/etc/nfs/server.map)

... and the client mount commands are a little less verbose:

  $ mount -t nfs <IP address of cygwin machine>:/exports/public /mnt/nfs/public
  $ mount -t nfs <IP address of cygwin machine>:/exports/private /mnt/nfs/private

Hope that helps,

-Samrobb







--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019