nfs problems

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

nfs problems

Rodrigo Amestica
I have a w2k box running cygwin and in particular the nfs-server. Then I
have serge debian box with the standard stuff.

It seems that nfs-server is not able to actually make available stuff
outside the cygwin root. Is this a hard fact or is there space for a
misconfiguration?

in the w2k box I have installed cygwin under c:\Optional\cygwin and I
have used --change-cygdrive-prefix for changing the prefix to '/'.

c: and d: are local hard drives in the w2k machine.

My output is shown below. Trying to mount /c gives a catastrophic error
output, trying to mount /d seems to be less serious but a failure
anyhow. Mounting / works great.

cygwin is great stuff and nfs-server is valuable. I would like to know
whether I'm doing something wrong or whether I'm just hitting the limits.

thanks,
  Rodrigo

# mount -t nfs remote:/c /mnt/remote
mount: wrong fs type, bad option, bad superblock on
remote:/c,
        missing codepage or other error
        In some cases useful info is found in syslog -
try


        dmesg | tail  or so

# dmesg -c
nfs_get_root: getattr error = 116
nfs_read_super: get root inode failed
nfs warning: mount version older than kernel
nfs_get_root: getattr error = 116
nfs_read_super: get root inode failed


# mount -t nfs remote:/d /mnt/remote
mount: remote:/d failed, reason given by server: No
such file or directory
# dmesg -c
# mount -t nfs remote:/ /mnt/remote
# ls
/mnt/remote
/
bin  cygwin.bat  cygwin.ico  etc  home  lib  tmp  usr
var

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

Reply | Threaded
Open this post in threaded view
|

RE: nfs problems

Sam Robb
> I have a w2k box running cygwin and in particular the
> nfs-server. Then I
> have serge debian box with the standard stuff.
>
> It seems that nfs-server is not able to actually make available stuff
> outside the cygwin root. Is this a hard fact or is there space for a
> misconfiguration?
>
> in the w2k box I have installed cygwin under c:\Optional\cygwin and I
> have used --change-cygdrive-prefix for changing the prefix to '/'.

Ouch.  OK.  I've tried nfs-server with this, and seen problems.  This
is probably related to the "Cannot export Windows directories not under
Cygwin root" issue documented in the nfs-server-2.3-3.README (which you
can find under /usr/share/doc/Cygwin.)  It's wrapped up in the fact that
the nfs-server has some problems handling cygwin mount points properly,
unless there's an actual directory that things are mounted on.

On way to export your c:\ and d:\ directories would be to follow the
workaround suggested in the README - create a new directory, mount c:/
at that directory, and then export the directory.  Since the mount is
on top of an existing directory, things work fine.

Another workaround that suffices for vanilla cygwin setups is to create
a '/cygdrive' directory.  This is enough to give nfs-server a real directory
to hang it's hat on, so to speak - in effect, all the local drives end up
mounted on top of an existing directory, so again things work fine, and
you can export any local disk under '/cygdrive' properly.

Unfortunately, in your case, while '/' already exists, and has a real
directory underneath it, it is also treated specially by nfs-server.
So you need to create a real '/c' directory that the nfs-server can
interact with.  You will have to do this via cmd.exe or Explorer, since
cygwin's mkdir already sees a directory in that location.  Once you do
this, you should be able to export '/c' via nfs.

I've tested all these configurations on my local machine, using an FC4
linux system to mount the exported directories.  Assuming you don't
have any other configuration issues, the last recommendation (creating
real '/c' and '/d' directories) should solve your export problem.

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

Reply | Threaded
Open this post in threaded view
|

RE: nfs problems

Rodrigo Amestica
In reply to this post by Rodrigo Amestica
Hi Sam, many thanks for following up on this problem.

Does your local windows machine has more than 2 (two) hard drives? In my
machine, c: and d: are two different drives.

I have tried by creating /exports/c and /exports/d as explained in the
README file.

First I just created /exports/d; mounted and exported it within cygwin
as described. In this situation, mounting it from linux does work just
fine, great!. I can live with just this.

But, if now I follow the same procedure for c then something weird goes one.

Now in cygwin I have c: and d: mounted over /exports/c and /exports/d,
respectively, and my /etc/exports looks like this

/exports/c (ro, no_root_squash)
/exports/d (ro, no_root_squash)

if in linux now I mount /exports/d then what I see by ls-ing its content
is not 'd' but 'c'! Am I clear?

After this strange situation I have exported a third entry, '/usr'. And
yes, it mounts just fine in the remote linux box.

As far as I can tell, I can export 'd' and properly mount it in the
remote machine only when it is the only one.

thanks again,
  Rodrigo

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

Reply | Threaded
Open this post in threaded view
|

RE: nfs problems

Sam Robb
In reply to this post by Rodrigo Amestica
> Hi Sam, many thanks for following up on this problem.
>
> Does your local windows machine has more than 2 (two) hard
> drives? In my machine, c: and d: are two different drives.

Unfortunately, no.  So I'm unable to try and reproduce the
exact problem that you're seeing.
 
> I have tried by creating /exports/c and /exports/d as
> explained in the README file.
>
> First I just created /exports/d; mounted and exported it
> within cygwin as described. In this situation, mounting
> it from linux does work just fine, great!. I can live with
> just this.

Wheh!  OK, that's good to hear.

> But, if now I follow the same procedure for c then something
> weird goes one.
>
> Now in cygwin I have c: and d: mounted over /exports/c and
> /exports/d, respectively, and my /etc/exports looks like this
>
> /exports/c (ro, no_root_squash)
> /exports/d (ro, no_root_squash)
>
> if in linux now I mount /exports/d then what I see by ls-ing
> its content is not 'd' but 'c'! Am I clear?

Unfortunately, yes :-(  It certainly sounds like something in
the nfs-server is doing the wrong thing when resolving mounts
in this situation.
 
> After this strange situation I have exported a third entry,
> '/usr'. And yes, it mounts just fine in the remote linux box.
>
> As far as I can tell, I can export 'd' and properly mount it in the
> remote machine only when it is the only one.

I'm sorry that you're seeing this problem, Rodrigo - and I
don't think that I will have the ability to dig into this
problem anytime soon.  If you have any interest in working on
resolving it, I'd be happy to hear whatever else you can
discover about the problem.

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

Reply | Threaded
Open this post in threaded view
|

Re: nfs problems

Rodrigo Amestica-2
On 11/14/05, Robb, Sam <[hidden email]> wrote:
> If you have any interest in working on
> resolving it, I'd be happy to hear whatever else you can
> discover about the problem.

Hi Sam,

what I found is the following: in a machine like mine, in which I have
2 physical disk drives, I get the following from the stat command:

/exports/c
Device: c98ce9bh/211340955d     Inode: 1407374883553285  Links: 9

/exports/d
Device: c847021ch/3360096796d   Inode: 1407374883553285  Links: 6

As you can see the device id is not the same but the inode it is!

Now, in libnfs/fhandle.c there is a function called pseudo_inode. For
cygwin this function creates a pseudo node id that enterely drops any
information about the device id. Therefore, what is happening is that
for a remote client /exports/c and /exports/d are mounted on the same
file system because fh_lookup has no means for resolving same inodes
on diffrent drives.

Inlined in the code of pseudo_inode there is a comment. The comment
seems to be valid for one single drive, but as soon as you have more
thatn 1 then the comment is, let's say, incorrect.

Perhaps, the author of that comment was very aware of this situation
and somewhere else annotated that this version of nfs-server is not
good for more than one drive.

Fixing the problem seems to be possible, but I just wonder about the
comment in pseudo_inode. Perhaps, there is something else I'm
overlooking.

thanks,
 Rodrigo

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