Solved Error mounting nfs from /etc/fstab

Hi,

From a Linux box, I've exported a directory that should be mounted inside a jail subdirectory.

In the Linux (server) box:
Code:
# grep incomi /etc/exports
/partilha_casa/partilha_mldonkey/incoming 192.168.3.0/24(secure,rw,sync,no_subtree_check,root_squash)

In the FreeBSD (client) box:
Code:
192.168.1.30:/partilha_casa/partilha_mldonkey/incoming /usr/jails/mldonkey/usr/home/mldonkey/.mldonkey/incoming/  nfs rw 0 0

When trying to mount this as:
Code:
# mount /usr/jails/mldonkey/usr/home/mldonkey/.mldonkey/incoming/
mount: /usr/jails/mldonkey/usr/home/mldonkey/.mldonkey/incoming: unknown special file or file system
# echo $?
1


Oops, something is wrong.

But, when mounting from the command line:
Code:
# mount -t nfs 192.168.1.30:/partilha_casa/partilha_mldonkey/incoming  /usr/jails/mldonkey/usr/home/mldonkey/.mldonkey/incoming/

# echo $?
0

No problem to mount it.
To try to find out where the problem is, I changed the line in /etc/fstab to:
Code:
192.168.1.30:/partilha_casa/partilha_mldonkey/incoming /mnt  nfs  rw 0 0

And
Code:
# mount /mnt; echo $?
0


Mounts fine.

So, the problem doesn't seem to be in the server part and doesn't seem to be any syntax error in /etc/fstab.

My mounted filesystems are:
Code:
# mount                                                               
/dev/ada0p2 on / (ufs, local, journaled soft-updates)
devfs on /dev (devfs, local, multilabel)
/usr/jails/sharedfs on /usr/jails/mldonkey/sharedfs (nullfs, local, read-only)
devfs on /usr/jails/mldonkey/dev (devfs, local, multilabel)


What is wrong with this setup? How to correct it?
 
My guess is that the system is trying to mount it before the mldonkey jail has started. So the target directory simply doesn't exist yet.

Add the mount to /etc/fstab.mldonkey and configure the jail to mount it when it starts. That way it'll be mounted/unmounted when the jail starts/stops.
 
Thanks SirDice.
This is working and I don't know really why. What I did was to remove the trainling slash in the fstab entry. then it mounted fine. Tried again with the trailing slash and it worked fine again.
 
Back
Top