From owner-freebsd-stable Sun May 9 0:15:58 1999 Delivered-To: freebsd-stable@freebsd.org Received: from crydee.sai.msu.ru (crydee.sai.msu.ru [195.208.220.203]) by hub.freebsd.org (Postfix) with ESMTP id 070E314D10 for ; Sun, 9 May 1999 00:15:45 -0700 (PDT) (envelope-from asv1@crydee.sai.msu.ru) Received: from localhost (asv1@localhost) by crydee.sai.msu.ru (8.9.2/8.9.2) with ESMTP id KAA00418 for ; Sun, 9 May 1999 10:18:07 +0400 (MSD) (envelope-from asv1@crydee.sai.msu.ru) Date: Sun, 9 May 1999 10:18:07 +0400 (MSD) From: "Sergey Ayukov (mailing lists)" To: freebsd-stable@FreeBSD.ORG Subject: Re: NFS question.. In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Sat, 8 May 1999, Tom wrote: > > > Sorry if this is not apropos for STABLE. > > > > > > I am running 3.1-STABLE, and wish to NFS export the _directory_ /usr/home. > > > > > > Currently, my /var and /usr are directories under /, I dont have a seperate > > > /usr partition. I want to export /usr/home, but do NOT want to have to > > > export /. > > > > > > According to my 4.4BSD SMM "...the kernel information is stored on a per > > > local file system mount point and client host address basis and cannot > > > refer to individiual directories within the local server filesystem." > > > > I was also hit by this idiosyncrasy when switching from Linux to FreeBSD > > (see my previous messages several days ago). Judging from comments by > > several people, FreeBSD NFS server can't export directories and is not > > supposed to; I had to find it hard way, trying to find out what is wrong > > First of all, NFS is only designed to export filesystems. FreeBSD can > indeed export selective directories in a filesystem (see manpage), and > nfsd will do its best to limit access to that directory. However, > clients could guess and probably access stuff outside that directory tree. Yes, that is my concern on this issue. I need to export /var/spool for PCNFS printing, but exporting entire /var makes everybody's mail readable by everybody from the subnet :-( > NFS uses inode numbers which come right out of the filesystems. I understand that. But in reality, NFS client does not care about true inode numbers, right? Therefore NFS server could supply fake inode numbers, just as Linux NFSD does. This will also allow transparent exporting of underlying mountpoints (e.g., if /home/group1 is mounted on separate disk, it will still be visible from NFS-mounted /home) and re-export NFS-mounted subdirectories which I also would like to have. > > with my /etc/exports. Finally today I have tried to take another approach, > > namely use Linux NFSD. I had to make some dirty hacks at the source (but > > not much), but to my surprise, it worked. I am able to export directories > > which are not mountpoints and re-export NFS-mounted directories. The write > > performance difference is also tremendous; with FreeBSD kernel > > implementation I was only getting ridiculous 580K/s over 100MBit full > > duplex cable; with Linux NFSD (user-level!) I get about 2M/sec (I am using > > NFSv2 clients; DOS PC/NFS and OS/2 NFS). > > K is KB or kb? M is MB or Mb? Anyhow, what you are seeing is the KB and MB. > difference between safe NFS and unsafe NFS. Put FreeBSD NFS into unsafe > mode, and you should get similar performance. By default FreeBSD NFS will > not ack a write until the write has been hit the disk. Linux NFS acks > writes as soon as they are received. I do understand that. But how do I put FreeBSD NFS into unsafe mode? I can't seem to find the reference anywhere. > > Unfortunately, it does not work right all of the time. On some > > directories, it seems to report bogus data to clients, so that they hang, > > or crash, or display nonse. I can't make it work correctly. All in all, it > > seems Linux is way better at NFS and probably more suited for my needs. > > Too bad I have already converted 20GB to ffs :-( > > Probably not. You need to understand the issues. Well, I understand the issues (or at least I think so). But I am interested in fast, working NFS implementation (which I know could exist because Linux does it) and not in explanations (system administration is not my primary job). I can trade some bit of stability for performance in case of safe/unsafe NFS write modes. --------------------------------------------------------------------------- Dr. Sergey Ayukov Sternberg Astronomical Institute http://www.ayukov.com Moscow, Russia http://crydee.sai.msu.ru/index-asv.html To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message