Re: NFSv4 - how to set up at FreeBSD 8.1 ?

2011-01-08 Thread Andrew Thompson
On 7 January 2011 14:25, Jean-Yves Avenard jyaven...@gmail.com wrote:
 On 7 January 2011 08:16, Rick Macklem rmack...@uoguelph.ca wrote:

 When I said I recalled that they didn't do TCP because of excessive
 overhead, I forgot to mention that my recollection could be wrong.
 Also, I suspect you are correct w.r.t. the above statement. (ie. Sun's
 official position vs something I heard.)

 Anyhow, appologies if I gave the impression that I was correcting your
 statement. My intent was just to throw out another statement that I
 vaguely recalled someone an Sun stating.

 After hitting yet another serious bug in 8.2 ; I reverted back to 8.1

Has the problem been reported? There is still time to fix serious bugs in 8.2


Andrew
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to freebsd-stable-unsubscr...@freebsd.org


Re: NFSv4 - how to set up at FreeBSD 8.1 ?

2011-01-07 Thread Rick Macklem
 On 7 January 2011 08:16, Rick Macklem rmack...@uoguelph.ca wrote:
 
  When I said I recalled that they didn't do TCP because of excessive
  overhead, I forgot to mention that my recollection could be wrong.
  Also, I suspect you are correct w.r.t. the above statement. (ie.
  Sun's
  official position vs something I heard.)
 
  Anyhow, appologies if I gave the impression that I was correcting
  your
  statement. My intent was just to throw out another statement that I
  vaguely recalled someone an Sun stating.
 
 After hitting yet another serious bug in 8.2 ; I reverted back to 8.1
 
 Interestingly, it now complains about having V4: / in /etc/exports
 
At one time the V4: line was required to be at the end of the /etc/exports
file. (You could consider that a bug left over from the OpenBSD port, where
it was a separate section of /etc/exports.) I removed that restriction from
mountd.c at some point, but maybe after 8.1.

So, try just moving the V4: line to the end of /etc/exports.

 NFSv4 isn't available in 8.1 ?

It should be there, rick
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to freebsd-stable-unsubscr...@freebsd.org


Re: NFSv4 - how to set up at FreeBSD 8.1 ?

2011-01-07 Thread Freddie Cash
On Fri, Jan 7, 2011 at 7:05 AM, Rick Macklem rmack...@uoguelph.ca wrote:
 NFSv4 isn't available in 8.1 ?

 It should be there, rick

It is.  I'm running FreeBSD 8.1 i386 at home, using NFSv4 to share
folders out to my media PC/laptop beast thingy.

[fc...@rogue /home/fcash]$ uname -a
FreeBSD rogue.ashesofthe.net 8.1-RELEASE FreeBSD 8.1-RELEASE #0
r211388: Sun Aug 22 15:18:36 PDT 2010
r...@rogue.ashesofthe.net:/usr/obj/usr/src-8/sys/ROGUE  i386

[fc...@rogue /home/fcash]$ cat /etc/exports
/home -mapall=fcash -network 172.20.0.0/24
V4: /home/samba/shared -sec=sys -network 172.20.0.0/24

Never tried it with the V4: line anywhere but at the end of the file.

-- 
Freddie Cash
fjwc...@gmail.com
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to freebsd-stable-unsubscr...@freebsd.org


Re: NFSv4 - how to set up at FreeBSD 8.1 ?

2011-01-06 Thread perryh
John Baldwin j...@freebsd.org wrote:

 ... even NFS UDP mounts maintain their own set of socket state
 to manage retries and retransmits for UDP RPCs.

Not according to what I remember of the SunOS NFS documentation,
which indicated that the driving force behind using UDP instead of
TCP was to have the server be _completely_ stateless.  (Of course
locking is inherently stateful; they made it very clear that the
locking protocol was considered to be an adjunct rather than part
of the NFS protocol itself.)

It's been quite a few years since I read that, and I didn't get
into the details, but I suppose the handle returned to a client (in
response to a mount or open request) must have contained both a
representation of the inode number and a unique identification of
the filesystem (so that, in the case where server crash recovery
included a newfs and reload from backup, the FS ID would not match
and the client would get a stale handle response).  All of the
retry and retransmit burden had to have been managed by the client,
for both reading and writing.
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to freebsd-stable-unsubscr...@freebsd.org


Re: NFSv4 - how to set up at FreeBSD 8.1 ?

2011-01-06 Thread perryh
Rick Macklem rmack...@uoguelph.ca wrote:

 Sun did add a separate file locking protocol called the NLM
 or rpc.lockd if you prefer, but that protocol design was
 fundamentally flawed imho and, as such, using it is in the
 your mileage may vary category.

I suppose it was not all that bad, considering that what it sought
to accomplish is incomputable.  There is simply no way for either
the server or the client to distinguish between the other end has
crashed and there is a temporary communication failure until the
other end comes back up or communication is restored.

On a good day, in a completely homogeneous environment (server and
all clients running the same OS revision and patchlevel), I trust
lockd about as far as I can throw 10GB of 1980's SMD disk drives :)

Exporting /var/spool/mail read/write tends to ensure that good days
will be rare.  Been there, done that, seen the result.  Never again.
That's what IMAP is for.
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to freebsd-stable-unsubscr...@freebsd.org


Re: NFSv4 - how to set up at FreeBSD 8.1 ?

2011-01-06 Thread Rick Macklem
 Rick Macklem rmack...@uoguelph.ca wrote:
 
  Sun did add a separate file locking protocol called the NLM
  or rpc.lockd if you prefer, but that protocol design was
  fundamentally flawed imho and, as such, using it is in the
  your mileage may vary category.
 
 I suppose it was not all that bad, considering that what it sought
 to accomplish is incomputable. There is simply no way for either
 the server or the client to distinguish between the other end has
 crashed and there is a temporary communication failure until the
 other end comes back up or communication is restored.
 
Yep. The blocking lock operation is also a trainwreck looking for a
place to happen, imho. (In the NLM, the client can do an RPC that says
get a lock, waiting as long as necessary for it, and then let me know.)

 On a good day, in a completely homogeneous environment (server and
 all clients running the same OS revision and patchlevel), I trust
 lockd about as far as I can throw 10GB of 1980's SMD disk drives :)
 
Heh, heh. For those too young to have had the priviledge, a 1980s SMD
drive was big and HEAVY. I just about got a hernia every time one had
to go in a 19inch rack. You definitely didn't throw them far:-)

 Exporting /var/spool/mail read/write tends to ensure that good days
 will be rare. Been there, done that, seen the result. Never again.
 That's what IMAP is for.
 
Great post. I couldn't have said it as well, rick
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to freebsd-stable-unsubscr...@freebsd.org


Re: NFSv4 - how to set up at FreeBSD 8.1 ?

2011-01-06 Thread Rick Macklem
 John Baldwin j...@freebsd.org wrote:
 
  ... even NFS UDP mounts maintain their own set of socket state
  to manage retries and retransmits for UDP RPCs.
 
 Not according to what I remember of the SunOS NFS documentation,
 which indicated that the driving force behind using UDP instead of
 TCP was to have the server be _completely_ stateless. (Of course
 locking is inherently stateful; they made it very clear that the
 locking protocol was considered to be an adjunct rather than part
 of the NFS protocol itself.)
 
For UDP, in the server all requests show up at socket/port 2049. They
pretty quickly discovered that retries of non-idempotent RPCs trashed
things, so the Duplicate Request Cache was invented, which is really
state that doesn't have to be recovered after a server crash.
(By Chet Jacuzak at DEC, if I recall correctly, who is living on a
little island on a lake up in Maine, last I heard.)

My recollection of why Sun didn't use TCP was that they knew that
the overhead would be excessive, which wasn't completely untrue,
given the speed of an MC68020.

 It's been quite a few years since I read that, and I didn't get
 into the details, but I suppose the handle returned to a client (in
 response to a mount or open request) must have contained both a
 representation of the inode number and a unique identification of
 the filesystem (so that, in the case where server crash recovery
 included a newfs and reload from backup, the FS ID would not match
 and the client would get a stale handle response). All of the
 retry and retransmit burden had to have been managed by the client,
 for both reading and writing.
Yea, it depended on how the backup was done. To avoid stale handle
the backup/reload had to retain the same i-nodes, including the generation
number in them. (But, then, those 1980s SMD disks never trashed the
file systems, or did they?:-)

You shouldn't get me reminising on the good ole days, rick
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to freebsd-stable-unsubscr...@freebsd.org


Re: NFSv4 - how to set up at FreeBSD 8.1 ?

2011-01-06 Thread John Baldwin
On Thursday, January 06, 2011 3:08:04 am per...@pluto.rain.com wrote:
 John Baldwin j...@freebsd.org wrote:
 
  ... even NFS UDP mounts maintain their own set of socket state
  to manage retries and retransmits for UDP RPCs.
 
 Not according to what I remember of the SunOS NFS documentation,
 which indicated that the driving force behind using UDP instead of
 TCP was to have the server be _completely_ stateless.  (Of course
 locking is inherently stateful; they made it very clear that the
 locking protocol was considered to be an adjunct rather than part
 of the NFS protocol itself.)

No extra NFS state is tied to a TCP mount aside from maintaining TCP state 
(i.e. congestion window for the socket, etc.).  A TCP mount does not have a 
different amount of NFS state than a UDP mount.  As Rick noted, many
servers do maintain a DRPC, but that applies to both UDP and TCP mounts.

 It's been quite a few years since I read that, and I didn't get
 into the details, but I suppose the handle returned to a client (in
 response to a mount or open request) must have contained both a
 representation of the inode number and a unique identification of
 the filesystem (so that, in the case where server crash recovery
 included a newfs and reload from backup, the FS ID would not match
 and the client would get a stale handle response).  All of the
 retry and retransmit burden had to have been managed by the client,
 for both reading and writing.

Yes, this is true for both UDP and TCP (if you exclude TCP's retransmit for 
missed packets in server replies on a TCP mount).  Even with TCP a client can
still retransmit requests for which it does not receive a reply in case the
connection dies due to a network problem, server reboot, etc.

-- 
John Baldwin
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to freebsd-stable-unsubscr...@freebsd.org


Re: NFSv4 - how to set up at FreeBSD 8.1 ?

2011-01-06 Thread Rick Macklem
 
  Not according to what I remember of the SunOS NFS documentation,
  which indicated that the driving force behind using UDP instead of
  TCP was to have the server be _completely_ stateless. (Of course
  locking is inherently stateful; they made it very clear that the
  locking protocol was considered to be an adjunct rather than part
  of the NFS protocol itself.)
 
When I said I recalled that they didn't do TCP because of excessive
overhead, I forgot to mention that my recollection could be wrong.
Also, I suspect you are correct w.r.t. the above statement. (ie. Sun's
official position vs something I heard.)

Anyhow, appologies if I gave the impression that I was correcting your
statement. My intent was just to throw out another statement that I
vaguely recalled someone an Sun stating.

rick
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to freebsd-stable-unsubscr...@freebsd.org


Re: NFSv4 - how to set up at FreeBSD 8.1 ?

2011-01-06 Thread Jean-Yves Avenard
On 7 January 2011 08:16, Rick Macklem rmack...@uoguelph.ca wrote:

 When I said I recalled that they didn't do TCP because of excessive
 overhead, I forgot to mention that my recollection could be wrong.
 Also, I suspect you are correct w.r.t. the above statement. (ie. Sun's
 official position vs something I heard.)

 Anyhow, appologies if I gave the impression that I was correcting your
 statement. My intent was just to throw out another statement that I
 vaguely recalled someone an Sun stating.

After hitting yet another serious bug in 8.2 ; I reverted back to 8.1

Interestingly, it now complains about having V4: / in /etc/exports

NFSv4 isn't available in 8.1 ?
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to freebsd-stable-unsubscr...@freebsd.org


Re: NFSv4 - how to set up at FreeBSD 8.1 ?

2011-01-05 Thread perryh
Rick Macklem rmack...@uoguelph.ca wrote:

 ... one of the fundamental principals for NFSv2, 3 was a stateless
 server ...

Only as long as UDP transport was used.  Any NFS implementation that
used TCP for transport had thereby abandoned the stateless server
principle, since a TCP connection itself requires that state be
maintained on both ends.
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to freebsd-stable-unsubscr...@freebsd.org


Re: NFSv4 - how to set up at FreeBSD 8.1 ?

2011-01-05 Thread Marek Salwerowicz

You can also do the following:
For /etc/exports
V4: /
/usr/home -maproot=root -network 192.168.183.0 -mask 255.255.255.0


Not in my configuration - '/' and '/usr' are different partitions (both UFS)

--
Marek Salwerowicz

___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to freebsd-stable-unsubscr...@freebsd.org


Re: NFSv4 - how to set up at FreeBSD 8.1 ?

2011-01-05 Thread John Baldwin
On Wednesday, January 05, 2011 5:55:53 am per...@pluto.rain.com wrote:
 Rick Macklem rmack...@uoguelph.ca wrote:
 
  ... one of the fundamental principals for NFSv2, 3 was a stateless
  server ...
 
 Only as long as UDP transport was used.  Any NFS implementation that
 used TCP for transport had thereby abandoned the stateless server
 principle, since a TCP connection itself requires that state be
 maintained on both ends.

Not filesystem cache coherency state, only socket state.  And even NFS UDP 
mounts maintain their own set of socket state to manage retries and 
retransmits for UDP RPCs.  The filesystem is equally incoherent for both UDP 
and TCP NFSv[23] mounts.  TCP did not change any of that.

-- 
John Baldwin
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to freebsd-stable-unsubscr...@freebsd.org


Re: NFSv4 - how to set up at FreeBSD 8.1 ?

2011-01-05 Thread Rick Macklem
  You can also do the following:
  For /etc/exports
  V4: /
  /usr/home -maproot=root -network 192.168.183.0 -mask 255.255.255.0
 
 Not in my configuration - '/' and '/usr' are different partitions
 (both UFS)
 
Hmm. Since entire volumes are exported for NFSv4, I can't remember if
exporting a subtree of the volume works (I think it does, but??).

However, I do know that if you change the /etc/exports for the above to:
(note I also moved the V4: line to the end because at one time it
 was required to be at the end and I can't remember if that restriction
 is still enforced. Always check /var/log/messages after starting mountd
 with a modified /etc/exports and look for any messages related to problems
 with /etc/exports.) In other words, export the volume's mount point and
 put the V4: line at the end are changes that might be required?. If you
 take a look at mountd.c, you'll understand why I have trouble remembering
 exactly what works and what doesn't.:-)
/usr -maproot=root -network 192.168.183.0 -mask 255.255.255.0
V4: /

then for the above situation:
# mount -t nfs -o nfsv4 server:/ /mnt
- will fail because / isn't exported
however
# mount -t nfs -o nfsv4 server:/usr /mnt
- should work. If it doesn't work, it is not because /etc/exports are
  wrong.

A small number of NFSv4 ops are allowed on non-exported UFS partitions
so that mount can traverse the tree down to the mount point, but that
mount point must be exported. When I did this I did not realize that ZFS
did its own exporting and, as such, traveral of non-exported ZFS volumes
doesn't work, because ZFS doesn't allow any operations on the non-exported
volumes to work.

At some point, there needs to be a debate w.r.t. inconsistent behaviour.
The easiest fix is to disable the capability of traversal of non-exported
UFS volumes. The downside of this is that it is harder to configure the
single (sub)tree on the server that is needed for NFSv4.

Have fun with it, rick
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to freebsd-stable-unsubscr...@freebsd.org


Re: NFSv4 - how to set up at FreeBSD 8.1 ?

2011-01-05 Thread Rick Macklem
 On Wednesday, January 05, 2011 5:55:53 am per...@pluto.rain.com wrote:
  Rick Macklem rmack...@uoguelph.ca wrote:
 
   ... one of the fundamental principals for NFSv2, 3 was a stateless
   server ...
 
  Only as long as UDP transport was used. Any NFS implementation that
  used TCP for transport had thereby abandoned the stateless server
  principle, since a TCP connection itself requires that state be
  maintained on both ends.
 
 Not filesystem cache coherency state, only socket state. And even NFS
 UDP
 mounts maintain their own set of socket state to manage retries and
 retransmits for UDP RPCs. The filesystem is equally incoherent for
 both UDP
 and TCP NFSv[23] mounts. TCP did not change any of that.
 
Unfortunately even NFSv4 doesn't maintain cache coherency in general. The state 
it
maintains/recovers after a server crash are opens/locks/delegations, but
the opens are a Windows-like open share lock (can't remember the Windows/Samba
term for them) and not a POSIX-like open. NFSv4 does tie cache coherency to
file locking, so that clients will get a coherent view of file data for byte
ranges they lock.

The term stateless server refers to the fact that the server doesn't know 
anything
about the file handling state in the client that needs to be recovered after
a server crash (opens, locks, ...). When an NFSv2,3 server is rebooted, it
normally knows nothing about what clients are mounted, what clients have files
open, etc and just services RPCs as they come in. The design avoided the
complexity of recovery after a crash but results in a non-POSIX compliant
file system that can't do a good job of cache coherency, knows nothing about
file locks, etc. (Sun did add a separate file locking protocol called the
NLM or rpc.lockd if you prefer, but that protocol design was fundamentally
flawed imho and, as such, using it is in the your mileage may vary category.)

Further, since without any information about previous operations, retries of
non-idempotent RPCs would cause weird failures, soft state in the form of
a cache of recent RPCs (typically called the Duplicate Request Cache or DRC
these days) was added, to avoid performing the non-idempotent operation
twice. A server is not required to retain the contents of a DRC after a
crash/reboot but some vendors with non-volatile RAM hardware may choose to
do so in order to provide closer to correct behaviour after a server
crash/reboot.

rick
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to freebsd-stable-unsubscr...@freebsd.org


Re: NFSv4 - how to set up at FreeBSD 8.1 ?

2011-01-05 Thread Rick Macklem
 Rick Macklem rmack...@uoguelph.ca wrote:
 
  ... one of the fundamental principals for NFSv2, 3 was a stateless
  server ...
 
 Only as long as UDP transport was used. Any NFS implementation that
 used TCP for transport had thereby abandoned the stateless server
 principle, since a TCP connection itself requires that state be
 maintained on both ends.
 
You've seen the responses w.r.t. what stateless server referred to
already. But you might find this quirk interesting...

Early in the NFSv4 design, I suggested that handling of the server
state (opens/locks/...) might be tied to the TCP connections (NFSv4
doesn't use UDP). Lets just say the idea flew like a lead balloon.
Lots of responses along the lines of NFS should be separate for the
RPC transport layer, etc.

Then, several years later, they came up with Sessions for NFSv4.1, which
does RPC transport management in a very NFSv4.1-specific way, including
stuff like changing the RPC semantics to exactly-once... Although very
different from what I had envisioned, in a sense Sessions does tie state
handling (ordering of locking operations, for example) to RPC transport
management as I currently understand it.

rick
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to freebsd-stable-unsubscr...@freebsd.org


Re: NFSv4 - how to set up at FreeBSD 8.1 ?

2011-01-05 Thread Rick Macklem
 Hi
 
 On 5 January 2011 12:09, Rick Macklem rmack...@uoguelph.ca wrote:
 
  You can also do the following:
  For /etc/exports
  V4: /
  /usr/home -maproot=root -network 192.168.183.0 -mask 255.255.255.0
 
  Then mount:
  # mount_nfs -o nfsv4 192.168.183.131:/usr/home /marek_nfs4/
  (But only if the file system for / is ufs and not zfs and,
  admittedly
  there was a debate that has to be continued someday that might make
  it
  necessary to export / as well for ufs like zfs requires.)
 
  rick
  ps: And some NFSv4 clients can cross server mount points, unlike
  NFSv2, 3.
 
 
 I've done that (exporting V4: /)
 
 but then when I mount a sub zfs filesystem (e.g. /pool/backup/sites/m)
 then it appears empty on the client.
 
 If I export /pool/backup/sites/m , then I see the content of the
 directory.
 
 Most of the sub-directory in /pool are actually zfs file system
 mounted.
 
 It is something I expected with NFSv3 .. but not with nfs v4.
 
Yes, to access the file volumes via any version of NFS, they need to
be exported. (I don't think it would make sense to allow access to all
of the server's data without limitations for NFSv4?)

What is different (and makes it confusing for folks familiar with NFSv2,3)
is the fact that it is a single mount tree for NFSv4 that has to be rooted
somewhere.
Solaris10 - always roots it at / but somehow works around the ZFS case,
so any exported share can be mounted with the same path used
by NFSv2,3.
Linux - Last I looked (which was a couple of years ago), it exported a
single volume for NFSv4 and the rest of the server's volumes
could only be accessed via NFSv2,3. (I don't know if they've
changed this yet?)

So, I chose to allow a little more flexibility than Solaris10 and allow
/etc/exports to set the location of the mount root. I didn't anticipate
the glitch that ZFS introduced (where all ZFS volumes in the mount path
must be exported for mount to work) because it does its own exporting.
(Obviously, the glitch/inconsistency needs to be resolved at some point.)

rick
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to freebsd-stable-unsubscr...@freebsd.org


Re: NFSv4 - how to set up at FreeBSD 8.1 ?

2011-01-05 Thread Rick Macklem
 Yes, to access the file volumes via any version of NFS, they need to
 be exported. (I don't think it would make sense to allow access to all
 of the server's data without limitations for NFSv4?)
 
 What is different (and makes it confusing for folks familiar with
 NFSv2,3)
 is the fact that it is a single mount tree for NFSv4 that has to be
 rooted
 somewhere.
 Solaris10 - always roots it at / but somehow works around the ZFS
 case,
 so any exported share can be mounted with the same path used
 by NFSv2,3.
 Linux - Last I looked (which was a couple of years ago), it exported a
 single volume for NFSv4 and the rest of the server's volumes
 could only be accessed via NFSv2,3. (I don't know if they've
 changed this yet?)
 
 So, I chose to allow a little more flexibility than Solaris10 and
 allow
 /etc/exports to set the location of the mount root. I didn't
 anticipate
 the glitch that ZFS introduced (where all ZFS volumes in the mount
 path
 must be exported for mount to work) because it does its own exporting.
 (Obviously, the glitch/inconsistency needs to be resolved at some
 point.)
 
Perhaps it would help to show what goes on the wire when a mount is done.
# mount -t nfs -o nfsv4 server:/usr/home /mnt

For NFSv2,3 there will be a Mount RPC with /usr/home as the argument. This
goes directly to mountd and then mountd decides if it is ok and replies with
the file handle (FH) for /usr/home if it is.

For NFSv4, the client will do a compound RPC that looks something like this:
(The exact structure is up to the client implementor.)

PutRooFH  -- set the position to the root mount location as specified by the 
V4: line
Lookup usr
Lookup home
GetFH -- return the file handle at this location

As such, there can only be one root mount location and at least Lookup
operations must work for all elements of the path from there to the client's
mount point. (For non-ZFS, it currently allows Lookup plus a couple of others 
that
some clients use during mounting to work for non-exported file systems, so that
setting root mount location == / works without exporting the entire file
server's tree.)

For all other operations, the file system must be exported just like for 
NFSv2,3.

Hope this helps, rick
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to freebsd-stable-unsubscr...@freebsd.org


Re: NFSv4 - how to set up at FreeBSD 8.1 ?

2011-01-04 Thread Jean-Yves Avenard
Hi

On 4 January 2011 10:50, Rick Macklem rmack...@uoguelph.ca wrote:

 If the above 2 lines are in your /etc/exports file and / is a ufs
 file system, then the above should work. For a zfs / you must either:
 - export / as well as /data
 or
 - use v4: /data so that the nfsv4 root is at /data

 Also, make sure you are running the experimental server:
 - either start both mountd and nfsd with the -e option or specify
 nfsv4_server_enable=YES
 nfs_server_enable=YES

 in your /etc/rc.conf.

 Also, you need to create an empty /var/db/nfs-stablerestart file before
 the experimental NFS server will start up the first time. (A fix for that
 is in the works, but isn't even in head yet.)

 Try looking at man nfsv4 and checking that the daemons are running and
 that nothing got logged in /var/log/messages when they started up.

 Good luck with it, rick


After reading this thread, I tried NFSv4 today..

Whenever I tried to mount from a linux client, I get:
 mount -o vers=4 server4:/pool/backup/sites/m /mnt
NFS compound failed for server server4: error 7 (RPC: Authentication error)
NFS compound failed for server server4: error 7 (RPC: Authentication error)
NFS compound failed for server server4: error 7 (RPC: Authentication error)
NFS compound failed for server server4: error 7 (RPC: Authentication error)
NFS compound failed for server server4: error 7 (RPC: Authentication error)
NFS compound failed for server server4: error 7 (RPC: Authentication error)
nfs mount: mount: /mnt: Permission denied

with NFS v3 it mounts just fine

any ideas?
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to freebsd-stable-unsubscr...@freebsd.org


Re: NFSv4 - how to set up at FreeBSD 8.1 ?

2011-01-04 Thread Rick Macklem
 
 
 After reading this thread, I tried NFSv4 today..
 
 Whenever I tried to mount from a linux client, I get:
 mount -o vers=4 server4:/pool/backup/sites/m /mnt
 NFS compound failed for server server4: error 7 (RPC: Authentication
 error)
 NFS compound failed for server server4: error 7 (RPC: Authentication
 error)
 NFS compound failed for server server4: error 7 (RPC: Authentication
 error)
 NFS compound failed for server server4: error 7 (RPC: Authentication
 error)
 NFS compound failed for server server4: error 7 (RPC: Authentication
 error)
 NFS compound failed for server server4: error 7 (RPC: Authentication
 error)
 nfs mount: mount: /mnt: Permission denied
 
 with NFS v3 it mounts just fine
 
 any ideas?

Hmm, try adding sec=sys and a network specification to the V4: line
in /etc/exports. I had thought the default was sec=sys and the world,
but maybe I'm wrong w.r.t. the defaults. (I always specify them in my
V4: lines.) For example:
V4: / -sec=sys -network 192.168.138.0 -netmask 255.255.255.0

(You'll need to send a HUP signal to mountd after the change.)

If that doesn't work, capture a packet trace of the mount attempt via:
  tcpdump -s 0 -w xxx host server4
and email me xxx (or look at it yourself with wireshark) to see what
Linux is attempting that is failing. (If for some reason Linux is trying
to use krb5, that would also explain the failure. I have no idea if Linux
might decide krb5 should be the default for NFSv4.)

Good luck with it and let us know how it goes, rick
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to freebsd-stable-unsubscr...@freebsd.org


Re: NFSv4 - how to set up at FreeBSD 8.1 ?

2011-01-04 Thread Freddie Cash
On Tue, Jan 4, 2011 at 3:42 AM, Jean-Yves Avenard jyaven...@gmail.com wrote:
 On 4 January 2011 10:50, Rick Macklem rmack...@uoguelph.ca wrote:
 After reading this thread, I tried NFSv4 today..

 Whenever I tried to mount from a linux client, I get:
  mount -o vers=4 server4:/pool/backup/sites/m /mnt
 NFS compound failed for server server4: error 7 (RPC: Authentication error)
 NFS compound failed for server server4: error 7 (RPC: Authentication error)
 NFS compound failed for server server4: error 7 (RPC: Authentication error)
 NFS compound failed for server server4: error 7 (RPC: Authentication error)
 NFS compound failed for server server4: error 7 (RPC: Authentication error)
 NFS compound failed for server server4: error 7 (RPC: Authentication error)
 nfs mount: mount: /mnt: Permission denied

 with NFS v3 it mounts just fine

 any ideas?

NFSv4 mounts are relative to the filesystem being exported.  NFSv3
mounts are absolute paths on the server.

IOW, if you export /pool/backup/sites/m/ on the server, then the mount
line on the client is just:
  mount -o vers=4 server4:/ /mnt

If you export / on the server, then the mount line on the client would be:
  mount -o vers=4 server4:/pool/backup/sites/m/ /mnt

This tripped me up when I tried converting my NFSv3 setup at home to NFSv4.


-- 
Freddie Cash
fjwc...@gmail.com
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to freebsd-stable-unsubscr...@freebsd.org


Re: NFSv4 - how to set up at FreeBSD 8.1 ?

2011-01-04 Thread Marek Salwerowicz

Hi,

so it slowly starts working:

nfs4-server# cat /etc/exports
V4: /
/ -maproot=root -network 192.168.183.0 -mask 255.255.255.0
nfs4-server#

nfs4-server# ps aux | grep mountd
root857  0.0  0.6  3348  1520  ??  Is   11:53PM   0:00.01 
/usr/sbin/mountd -e -r

nfs4-server# ps aux | grep nfsd
root   1303  0.0  0.5  3288  1324  ??  Is   12:04AM   0:00.03 nfsd: master 
(nfsd)
root   1304  0.0  0.5  3288  1260  ??  S12:04AM   0:00.02 nfsd: server 
(nfsd)

nfs4-server#


I am able to mount the root '/' from nfs4-server:

nfs4-client# mount_nfs -o nfsv4 192.168.183.131:/ /marek_nfs4/
nfs4-client# ls /marek_nfs4/
.cshrc  cdrom   homeprocusr
.profilecompat  lib rescue  var
.snap   dev libexec root
COPYRIGHT   distmedia   sbin
bin entropy mnt sys
bootetc pliktmp
nfs4-client# mount
/dev/ad0s1a on / (ufs, local)
devfs on /dev (devfs, local, multilabel)
/dev/ad0s1e on /tmp (ufs, local, soft-updates)
/dev/ad0s1f on /usr (ufs, local, soft-updates)
/dev/ad0s1d on /var (ufs, local, soft-updates)
192.168.183.131:/ on /marek_nfs4 (newnfs)
nfs4-client#

it works also on different partition:

nfs4-server# cat /etc/exports
V4: /usr
/usr/home -maproot=root -network 192.168.183.0 -mask 255.255.255.0
nfs4-server#


nfs4-client# mount_nfs -o nfsv4 192.168.183.131:/home /marek_nfs4/
nfs4-client# ls /marek_nfs4/
marek
nfs4-client#


What I noticed is that in 'V4: ' line we have to specify the mount point of 
the WHOLE partition we want to export


Regards

--
Marek Salwerowicz





___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to freebsd-stable-unsubscr...@freebsd.org


Re: NFSv4 - how to set up at FreeBSD 8.1 ?

2011-01-04 Thread Rick Macklem
 Hi,
 
 so it slowly starts working:
 
 nfs4-server# cat /etc/exports
 V4: /
 / -maproot=root -network 192.168.183.0 -mask 255.255.255.0
 nfs4-server#
 
 nfs4-server# ps aux | grep mountd
 root 857 0.0 0.6 3348 1520 ?? Is 11:53PM 0:00.01
 /usr/sbin/mountd -e -r
 nfs4-server# ps aux | grep nfsd
 root 1303 0.0 0.5 3288 1324 ?? Is 12:04AM 0:00.03 nfsd: master
 (nfsd)
 root 1304 0.0 0.5 3288 1260 ?? S 12:04AM 0:00.02 nfsd: server
 (nfsd)
 nfs4-server#
 
 
 I am able to mount the root '/' from nfs4-server:
 
 nfs4-client# mount_nfs -o nfsv4 192.168.183.131:/ /marek_nfs4/
 nfs4-client# ls /marek_nfs4/
 .cshrc cdrom home proc usr
 .profile compat lib rescue var
 .snap dev libexec root
 COPYRIGHT dist media sbin
 bin entropy mnt sys
 boot etc plik tmp
 nfs4-client# mount
 /dev/ad0s1a on / (ufs, local)
 devfs on /dev (devfs, local, multilabel)
 /dev/ad0s1e on /tmp (ufs, local, soft-updates)
 /dev/ad0s1f on /usr (ufs, local, soft-updates)
 /dev/ad0s1d on /var (ufs, local, soft-updates)
 192.168.183.131:/ on /marek_nfs4 (newnfs)
 nfs4-client#
 
 it works also on different partition:
 
 nfs4-server# cat /etc/exports
 V4: /usr
 /usr/home -maproot=root -network 192.168.183.0 -mask 255.255.255.0
 nfs4-server#
 
 
 nfs4-client# mount_nfs -o nfsv4 192.168.183.131:/home /marek_nfs4/
 nfs4-client# ls /marek_nfs4/
 marek
 nfs4-client#
 
 
 What I noticed is that in 'V4: ' line we have to specify the mount
 point of
 the WHOLE partition we want to export
 
Yes, the NFSv4 protocol does not use the mount protocol (mountd) and
only handles a single exported tree (with the root defined at the
location specified by the V4: line). The protocol has an Op called
Put Root File Handle, which sets the RPC to the location of the root
and then Lookup Ops traverse down from there.

Early in NFSv4 development, one of the authors said NFSv4 is NFS in
name only and that is fairly accurate, imho. For example, one of the
fundamental principals for NFSv2, 3 was a stateless server, whereas
NFSv4 uses a statefull server and does lock state recovery after a
server crash.

rick
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to freebsd-stable-unsubscr...@freebsd.org


Re: NFSv4 - how to set up at FreeBSD 8.1 ?

2011-01-04 Thread Rick Macklem
 Hi,
 
 so it slowly starts working:
 
 nfs4-server# cat /etc/exports
 V4: /
 / -maproot=root -network 192.168.183.0 -mask 255.255.255.0
 nfs4-server#
 
 nfs4-server# ps aux | grep mountd
 root 857 0.0 0.6 3348 1520 ?? Is 11:53PM 0:00.01
 /usr/sbin/mountd -e -r
 nfs4-server# ps aux | grep nfsd
 root 1303 0.0 0.5 3288 1324 ?? Is 12:04AM 0:00.03 nfsd: master
 (nfsd)
 root 1304 0.0 0.5 3288 1260 ?? S 12:04AM 0:00.02 nfsd: server
 (nfsd)
 nfs4-server#
 
 
 I am able to mount the root '/' from nfs4-server:
 
 nfs4-client# mount_nfs -o nfsv4 192.168.183.131:/ /marek_nfs4/
 nfs4-client# ls /marek_nfs4/
 .cshrc cdrom home proc usr
 .profile compat lib rescue var
 .snap dev libexec root
 COPYRIGHT dist media sbin
 bin entropy mnt sys
 boot etc plik tmp
 nfs4-client# mount
 /dev/ad0s1a on / (ufs, local)
 devfs on /dev (devfs, local, multilabel)
 /dev/ad0s1e on /tmp (ufs, local, soft-updates)
 /dev/ad0s1f on /usr (ufs, local, soft-updates)
 /dev/ad0s1d on /var (ufs, local, soft-updates)
 192.168.183.131:/ on /marek_nfs4 (newnfs)
 nfs4-client#
 
 it works also on different partition:
 
 nfs4-server# cat /etc/exports
 V4: /usr
 /usr/home -maproot=root -network 192.168.183.0 -mask 255.255.255.0
 nfs4-server#
 
 
 nfs4-client# mount_nfs -o nfsv4 192.168.183.131:/home /marek_nfs4/
 nfs4-client# ls /marek_nfs4/
 marek
 nfs4-client#
 
You can also do the following:
For /etc/exports
V4: /
/usr/home -maproot=root -network 192.168.183.0 -mask 255.255.255.0

Then mount:
# mount_nfs -o nfsv4 192.168.183.131:/usr/home /marek_nfs4/
(But only if the file system for / is ufs and not zfs and, admittedly
there was a debate that has to be continued someday that might make it
necessary to export / as well for ufs like zfs requires.)

rick
ps: And some NFSv4 clients can cross server mount points, unlike NFSv2, 3.
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to freebsd-stable-unsubscr...@freebsd.org


Re: NFSv4 - how to set up at FreeBSD 8.1 ?

2011-01-04 Thread Rick Macklem
 On Tue, Jan 4, 2011 at 3:42 AM, Jean-Yves Avenard
 jyaven...@gmail.com wrote:
  On 4 January 2011 10:50, Rick Macklem rmack...@uoguelph.ca wrote:
  After reading this thread, I tried NFSv4 today..
 
  Whenever I tried to mount from a linux client, I get:
   mount -o vers=4 server4:/pool/backup/sites/m /mnt
  NFS compound failed for server server4: error 7 (RPC: Authentication
  error)
  NFS compound failed for server server4: error 7 (RPC: Authentication
  error)
  NFS compound failed for server server4: error 7 (RPC: Authentication
  error)
  NFS compound failed for server server4: error 7 (RPC: Authentication
  error)
  NFS compound failed for server server4: error 7 (RPC: Authentication
  error)
  NFS compound failed for server server4: error 7 (RPC: Authentication
  error)
  nfs mount: mount: /mnt: Permission denied
 
  with NFS v3 it mounts just fine
 
  any ideas?
 
 NFSv4 mounts are relative to the filesystem being exported. NFSv3
 mounts are absolute paths on the server.
 
Well, they are actually relative to where the NFSv4 root is specified
in the V4: line. For ZFS, the entire server file tree from that point
down must be exported (each volume requiring at least one line in /etc/exports).
For UFS, it can traverse down to the exported volume, but only by
specifying the path to the exported volume in the mount command.
(This may someday change, since it is questionable that it should have
 different behaviour than ZFS and could be argued a security risk.)

Since there can only be one root point specified by the V4: line,
you can get to multiple volumes, but they must be within the subtree.
For example, if the following three directories are roots of mounted
volumes on the server:
/usr
/usr/home
/usr/sub1

and the exports file looks like:
/usr -maproot=root -network 131.104.48.0 -mask 255.255.255.0
/usr/home -maproot=root -network 131.104.48.0 -mask 255.255.255.0
/usr/sub1 -maproot=root -network 131.104.48.0 -mask 255.255.255.0
V4: /usr

Then anywhere within /usr, /usr/home and /usr/sub1 can be mounted,
but the client specifies a path relative to /usr, such as:
# mount -t nfs -o nfsv4 server:/home /home
to mount /usr/home on the client.

By using:
V4: /
you can make the client mount paths look like what would be done
for NFSv3, but if the / file system isn't UFS, you must export
it as well as all the others or it can't be traversed.

rick

 IOW, if you export /pool/backup/sites/m/ on the server, then the mount
 line on the client is just:
 mount -o vers=4 server4:/ /mnt
 
 If you export / on the server, then the mount line on the client would
 be:
 mount -o vers=4 server4:/pool/backup/sites/m/ /mnt
 
 This tripped me up when I tried converting my NFSv3 setup at home to
 NFSv4.
 
Just trying to clarify what was good useful information, rick
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to freebsd-stable-unsubscr...@freebsd.org


Re: NFSv4 - how to set up at FreeBSD 8.1 ?

2011-01-04 Thread Jean-Yves Avenard
Hi

On 5 January 2011 12:09, Rick Macklem rmack...@uoguelph.ca wrote:

 You can also do the following:
 For /etc/exports
 V4: /
 /usr/home -maproot=root -network 192.168.183.0 -mask 255.255.255.0

 Then mount:
 # mount_nfs -o nfsv4 192.168.183.131:/usr/home /marek_nfs4/
 (But only if the file system for / is ufs and not zfs and, admittedly
 there was a debate that has to be continued someday that might make it
 necessary to export / as well for ufs like zfs requires.)

 rick
 ps: And some NFSv4 clients can cross server mount points, unlike NFSv2, 3.


I've done that (exporting V4: /)

but then when I mount a sub zfs filesystem (e.g. /pool/backup/sites/m)
then it appears empty on the client.

If I export /pool/backup/sites/m , then I see the content of the directory.

Most of the sub-directory in /pool are actually zfs file system mounted.

It is something I expected with NFSv3 .. but not with nfs v4.

JY
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to freebsd-stable-unsubscr...@freebsd.org


NFSv4 - how to set up at FreeBSD 8.1 ?

2011-01-03 Thread Marek Salwerowicz
Hi all,

I have installed two VMs (server and client), regular installation with 
GENERIC kernel.
I cannot manage to set up NFSv4 working on them.

Configuration of server:

/etc/rc.conf:
keymap=pl_PL.ISO8859-2
hostname=nfs4-server
ifconfig_em0=dhcp
sshd_enable=YES
nfs_server_enable=YES
nfsv4_server_enable=YES
nfsuserd_enable=YES

/etc/exports:
V4: /


Configuration of client:
/etc/rc.conf:
keymap=pl_PL.ISO8859-2
hostname=nfs4-client
ifconfig_em0=dhcp
sshd_enable=YES
nfsuserd_enable=YES
nfscbd_enable=YES

Trying to mount '/' server share at client:
nfs4-client# mount_nfs -o nfsv4 192.168.183.131:/ /marek_nfs4/
nfs4-client# ls /marek_nfs4/
ls: /marek_nfs4/: Input/output error
nfs4-client#


What am I doing wrong? My aim is to mount home directories from server 
to client but currently I am unable to mount any share.

--
Marek Salwerowicz


___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to freebsd-stable-unsubscr...@freebsd.org


Re: NFSv4 - how to set up at FreeBSD 8.1 ?

2011-01-03 Thread Maciej Milewski
Monday 03 of January 2011 23:48:16 Marek Salwerowicz napisał(a):
 /etc/exports:
 V4: /

 What am I doing wrong? My aim is to mount home directories from server
 to client but currently I am unable to mount any share.
Maybe it's only incorrect exports file??
In my case (NFSv3) it looks:
/data -maproot=root 192.168.0.10
--
Maciej
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to freebsd-stable-unsubscr...@freebsd.org


Re: NFSv4 - how to set up at FreeBSD 8.1 ?

2011-01-03 Thread Rick Macklem
 Hi all,
 
 I have installed two VMs (server and client), regular installation
 with
 GENERIC kernel.
 I cannot manage to set up NFSv4 working on them.
 
 Configuration of server:
 
 /etc/rc.conf:
 keymap=pl_PL.ISO8859-2
 hostname=nfs4-server
 ifconfig_em0=dhcp
 sshd_enable=YES
 nfs_server_enable=YES
 nfsv4_server_enable=YES
 nfsuserd_enable=YES
 
 /etc/exports:
 V4: /
This only states where the root of the nfsv4 tree is. You also need to
export the volume(s) just like for nfsv3. If you are mounting / as below
you'd also need something like the line:
/ -maproot=root -network 192.168.183.1 -mask 255.255.255.0
 
 
 Configuration of client:
 /etc/rc.conf:
 keymap=pl_PL.ISO8859-2
 hostname=nfs4-client
 ifconfig_em0=dhcp
 sshd_enable=YES
 nfsuserd_enable=YES
 nfscbd_enable=YES
 
 Trying to mount '/' server share at client:
 nfs4-client# mount_nfs -o nfsv4 192.168.183.131:/ /marek_nfs4/
 nfs4-client# ls /marek_nfs4/
 ls: /marek_nfs4/: Input/output error
 nfs4-client#
 
 
 What am I doing wrong? My aim is to mount home directories from server
 to client but currently I am unable to mount any share.
 
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to freebsd-stable-unsubscr...@freebsd.org


Re: NFSv4 - how to set up at FreeBSD 8.1 ?

2011-01-03 Thread Rick Macklem
 Monday 03 of January 2011 23:48:16 Marek Salwerowicz napisał(a):
  /etc/exports:
  V4: /
 
  What am I doing wrong? My aim is to mount home directories from
  server
  to client but currently I am unable to mount any share.
 Maybe it's only incorrect exports file??
 In my case (NFSv3) it looks:
 /data -maproot=root 192.168.0.10
 --
If the above 2 lines are in your /etc/exports file and / is a ufs
file system, then the above should work. For a zfs / you must either:
- export / as well as /data
or
- use v4: /data so that the nfsv4 root is at /data

Also, make sure you are running the experimental server:
- either start both mountd and nfsd with the -e option or specify
nfsv4_server_enable=YES
nfs_server_enable=YES

in your /etc/rc.conf.

Also, you need to create an empty /var/db/nfs-stablerestart file before
the experimental NFS server will start up the first time. (A fix for that
is in the works, but isn't even in head yet.)

Try looking at man nfsv4 and checking that the daemons are running and
that nothing got logged in /var/log/messages when they started up.

Good luck with it, rick
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to freebsd-stable-unsubscr...@freebsd.org