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:

  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/


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