This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Starting with Cygwin NFS Server

> > 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:


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

  $ cygpath -u 'C:\exports\public'

  $ cygpath -u 'C:\exports\private'

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

  /cygdrive/c/exports/public map_static=/etc/nfs/
  /cygdrive/c/exports/private map_static=/etc/nfs/

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,

  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 map_static=/etc/nfs/
  /exports/private map_static=/etc/nfs/

... 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,


Unsubscribe info:
Problem reports:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]