Discussion:
NFS with FreeBSD and Mac OS X
(too old to reply)
Steven
2003-08-11 18:25:50 UTC
Permalink
Hello all,
I have a FreeBSD 4.7 box that I want set up as a nfs server for my Mac
running Max OS X 10.2.6.

To do this I put the following lines in rc.conf of the FreeBSD box:

nfs_server_enable="YES"
rpc_statd_enable="YES"
mount_flags="-r"
nfs_server_flags="-u -t -n 4"
portmap_enable="YES"

and I entered the following line to /etc/exports:

/usr/www/htdocs -alldirs 192.168.0.1

On the Mac I have loaded the following in niutil:

{
"opts" = ( "w" );
"dir" = ( "/mount/1" );
"name" = ( "192.168.0.64:/usr/www/htdocs" );
"vfstype" = ( "nfs" );
}

and I entered the folowing in /etc/rc:

nfs_client_enable="YES"
nfs_client_flags="-n 4"

I can't get the volume to mount. when I do

sudo mount -t nfs -a

on the Mac, I get the following message on the FreeBSD side:

"NFS request from unprivileged port (192.168.0.1:49167)"

I am new to this, any help and/or comments much appreciated,

Steven
--
***@sifre.nl
g***@ucdavis.edu
2003-08-11 19:56:21 UTC
Permalink
Post by Steven
"NFS request from unprivileged port (192.168.0.1:49167)"
This is an OS/X annoyance. Add "-P" to the "opts" record on your
Mac.

Greg Shenaut
Steven
2003-08-11 21:03:00 UTC
Permalink
Post by g***@ucdavis.edu
Post by Steven
"NFS request from unprivileged port (192.168.0.1:49167)"
This is an OS/X annoyance. Add "-P" to the "opts" record on your
Mac.
As in the example below? Or should it also specify a portnumber, and if
so, what port number?
Pardon my ignorance but are these the options to mount_nfs I can look up
in the man page?

{
"opts" = ( "w -P" );
"dir" = ( "/mount/1" );
"name" = ( "192.168.0.64:/usr/www/htdocs" );
"vfstype" = ( "nfs" );
}

Steven
--
***@sifre.nl
michaelwerth
2003-08-15 23:32:07 UTC
Permalink
we have some success with this but not all...



assuming you have exported the fs on the server and allowed the IP range
for your client



on the client machine system disk root create a folder to map the server
to. call it for example theshare



on the client machine add this line near the end of /etc/rc
before exit 0



/sbin/mount_nfs -s -P servername:/somewhere/foldertoshare /theshare



when you boot up the map should work.... but when i set it up it was r/w
and now it's read-only :(



hth


--
Posted via http://dbforums.com
Steven
2003-08-18 04:44:37 UTC
Permalink
Post by michaelwerth
we have some success with this but not all...
assuming you have exported the fs on the server and allowed the IP range
for your client on the client machine system disk root create a folder to map the server
to. call it for example theshare on the client machine add this line near the end of /etc/rc
before exit 0
/sbin/mount_nfs -s -P servername:/somewhere/foldertoshare /theshare
When I do this I can't mount any disks when I reboot my Mac. It seems to
get stuck when it tries to mount the nfs I guess...
Post by michaelwerth
when you boot up the map should work.... but when i set it up it was r/w
and now it's read-only :(
I am still struggling with this. I'm rather new to this and it is hard
for me to tell if the problem is on the server side or the client side
(or both). Is there a way to determine whether a server is working
correctly as an nfs server? Without using the client to test it?

This is a FreeBSD server version 4.7. IP address is 192.168.0.64.
The client is a Mac OS X machine that has IP 192.168.0.1 when it is
offline or a DHCP assigned IP address when it is online. The two are
connected via ethernet. The connection is working; I can log in with ssh
from the Mac to the FreeBSD server, I can FTP and I can view websites
hosted on the FreeBSD server. To do this I have to go offline and
assign the IP 192.168.0.1 to the Mac.

(Wouldn't it be possible to also connect to these services on the FreeBSD
box while I'm using the IP assigned by my ISP via DHCP? But that's a
whole other can of worms, I guess I need to run a DNS to do that, right?)

Anyway, the FreeBSD box is not connected to the internet. To make it
work as a nfs server I entered the following lines in /etc/rc.conf:

portmap_enable="YES"
nfs_server_enable="YES"
nfs_server_flags="-u -t -n 4"
mountd_flags="-r"

and the following in /etc/exports:

/usr/home/myname 192.168.0.1 XXX.XX.XX.X

This should do it, right? This should make it a nfs server after reboot,
or am I missing something?

When I check for more clues if it is actually working I do:

Bash: ~# rpcinfo -p
program vers proto port
100000 2 tcp 111 portmapper
100000 2 udp 111 portmapper
100005 3 udp 1023 mountd
100005 3 tcp 1023 mountd
100005 1 udp 1023 mountd
100005 1 tcp 1023 mountd
100003 2 udp 2049 nfs
100003 3 udp 2049 nfs
100003 2 tcp 2049 nfs
100003 3 tcp 2049 nfs
100024 1 udp 1011 status
100024 1 tcp 1022 status

Bash: ~# ps -aux | grep -E "nfsiod|nfsd|mountd|portmap"
daemon 64 0.0 0.8 956 636 ?? Is 10:43PM 0:00.04
/usr/sbin/portmap
root 66 0.0 0.5 524 352 ?? Is 10:43PM 0:00.03 mountd -r
root 68 0.0 0.3 368 196 ?? Is 10:43PM 0:00.02 nfsd: master (nfsd)
root 70 0.0 0.2 360 184 ?? I 10:43PM 0:00.01 nfsd: server (nfsd)
root 71 0.0 0.2 360 184 ?? I 10:43PM 0:00.00 nfsd:server (nfsd)
root 72 0.0 0.2 360 184 ?? I 10:43PM 0:00.00 nfsd:server (nfsd)
root 73 0.0 0.2 360 184 ?? I 10:43PM 0:00.00 nfsd:server (nfsd)

Are there more ways to check if it is working correctly that I should
know of?

The Mac is configured as a nfs client; I added the following to /etc/rc:

nfs_client_enable="YES"
nfs_client_flags="-n 4"

created a directory to mount in:

mkdir /Users/myname/Server

created the a directory under the mount directory in NetInfoDatabase
with the following values:

Bash: ~# niutil -read . 54
vfstype: nfs
dir: /Users/myname/Server
name: 192.168.0.64:/usr/home/myname
opts: rw

As I understand it this is equivalent to a fstab file with:

192.168.0.64:/usr/home/myname /Users/myname/Server nfs rw 0 0

When automount on the Mac is off and I try to mount nfs with:

sudo mount -a -t nfs

I don't get my prompt back and nothing seems to happen.

When I reboot with automount on I get a forever spinning beachball when
I try to open the directory where the volume is supposed to mount.

I hope somebody, anybody has an idea, maybe I'm missing something that's too
obvious? Thanks,

Steven
--
***@sifre.nl
Loading...