# mount.nfs4: mounting ...failed due No such file or d(SOLVED)

## pacho2

Since months, I was sucessfully sharing my portage DISTDIR directory with nfs without problems but, now, I want try to use nfs4 instead. The problem is that it fails to mount due:

```

 # /etc/init.d/nfsmount start

 * Starting NFS sm-notify ...                                                                                                                          [ ok ]

 * Mounting NFS filesystems ...

mount.nfs4: mounting belkin3:/usr/distfiles failed, reason given by server:

  No such file or directory                                                                                                                            [ !! ]

```

My /etc/exports in server is:

```
/usr/distfiles 192.168.1.202(no_root_squash,no_subtree_check,async,rw,fsid=0) 192.168.1.201(no_root_squash,no_subtree_check,async,rw,fsid=0) 

/home/osorio/Videos 192.168.2.1(no_root_squash,no_subtree_check,sync,rw)

```

And the line for mounting this in client fstab is:

```

192.168.1.203:/usr/distfiles /usr/distfiles nfs4        defaults                                0       0
```

Thanks a lotLast edited by pacho2 on Wed Mar 11, 2009 9:05 am; edited 1 time in total

----------

## depontius

Setup for nfs4 is significantly different than nfs3 - it isn't a matter of flipping a switch or tweaking a config file.  Unfortunately I'll tell you to RTFM, but here is the start point...

With nfs4 there is an "export root", and everything you export is supposed to be under that export root.  In my case, I bind-mount everything into that root.  Here is some of the relevant stuff from my nfs4 server:

```
localuser@localhost ~ $ cat /etc/exports

# /etc/exports: NFS file systems being exported.  See exports(5).

/exports       nnn.nnn.nnn.0/255.255.255.0(fsid=0,rw,sync,no_subtree_check,secure,anonuid=1000,anongid=100)

/exports/home  nnn.nnn.nnn.0/255.255.255.0(nohide,rw,sync,no_subtree_check,secure,anonuid=1000,anongid=100)

homer@homer 
```

Excerpt from /etc/fstab:

```
/dev/md1                /raid1-1        ext3            data=journal,relatime,nosuid,noexec,nodev       1 2

/raid1-1/home           /exports/home   none            bind            0 0
```

So in this case, "/exports" is the nfs4 root, and "/exports/home" is what I'm publishing.  On my client machine, I have this line in /etc/fstab:

```
myserver.mydomain:/home          /home                   nfs4    rw,hard,intr,rsize=32768,wsize=32768,nosuid,nodev               0 0
```

----------

## pacho2

Thanks a lot, seems to work now. 

About manual page, you are true, I have uninstalled man-pages-es (and adjusted man-pages linguas flag) for getting only original man-pages as they were too outdated (well, spanish nfs pages didn't mention nfs4 at all)

Best regards!

----------

