From owner-freebsd-questions@FreeBSD.ORG Sat Feb 21 02:59:24 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D7ED216A4CE for ; Sat, 21 Feb 2004 02:59:24 -0800 (PST) Received: from mail019.syd.optusnet.com.au (mail019.syd.optusnet.com.au [211.29.132.73]) by mx1.FreeBSD.org (Postfix) with ESMTP id F3F5C43D39 for ; Sat, 21 Feb 2004 02:59:23 -0800 (PST) (envelope-from tfrank@optushome.com.au) Received: from marvin.home.local (c211-28-241-189.eburwd5.vic.optusnet.com.au [211.28.241.189])i1LAxLB32617; Sat, 21 Feb 2004 21:59:21 +1100 Received: by marvin.home.local (Postfix, from userid 1001) id 28EE63FF; Sat, 21 Feb 2004 21:59:21 +1100 (EST) Date: Sat, 21 Feb 2004 21:59:20 +1100 From: Tony Frank To: dap Message-ID: <20040221105920.GI98919@marvin.home.local> References: <008601c3f829$fd0533b0$6401a8c0@yourqqh4336axf> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <008601c3f829$fd0533b0$6401a8c0@yourqqh4336axf> User-Agent: Mutt/1.4.2.1i cc: questions@freebsd.org Subject: Re: NFS and different exports to the same host X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Feb 2004 10:59:25 -0000 Hi there, On Fri, Feb 20, 2004 at 09:17:37PM -0600, dap wrote: > Per the FreeBSD handbook, I have to follow the rule that for a specific host > I have to export everything the same for a particular filesystem. So let's > say I have one filesystem, /. > > So I can't have: > > /export1 -ro server1 server2 > /export2 server1 > > Instead, I need: > > /export1 \ > /export2 \ > server1 > > Is there a way around this? Each filesystem can only be exported with one set of attributes to a particular host. If both /export1 and /export2 are directories of / then you would do: /export1 /export2 -ro server1 /export1 -ro server2 But note that the same attributes apply - ie both ro or both rw. If you need to give ro on one and rw to the other then you need to make them separate filesystems. See below for a way to do this. >From the handbook: %%%% In /etc/exports, each line represents the export information for one filesystem to one host. A remote host can only be specified once per filesystem, and may only have one default entry. For example, assume that /usr is a single filesystem. The following /etc/exports would be invalid: /usr/src client /usr/ports client One filesystem, /usr, has two lines specifying exports to the same host, client. The correct format for this situation is: /usr/src /usr/ports client The properties of one filesystem exported to a given host must all occur on one line. Lines without a client specified are treated as a single host. This limits how you can export filesystems, but for most people this is not an issue. %%%% eg I have in my /etc/exports file: %%%% /data/ad2 -alldirs -maproot=root -network 192.168.0.0 -mask 255.255.0.0 /data/ad3 -alldirs -maproot=root -network 192.168.0.0 -mask 255.255.0.0 /usr -alldirs -ro -network 192.168.0.0 -mask 255.255.0.0 /usr /usr/local -maproot=0:10 group1 /usr -ro -mapall=nobody /tmp -maproot=root group1 /tmp group2 /cdrom -alldirs,quiet,ro -network 192.168.3.0 -mask 255.255.255.0 %%%% So you can export the one filesystem (/usr or /tmp here) to different places with different attributes. You cannot have different attributes for same filesystem + same host. So if I had a host in both group1 and group2 in this example it would break. > I have found that it works best for us to have a /exports, where we dump > things like /exports/www, /exports/mail, and so on, rather than having > filesystems for each of those. This is important since FreeBSD has a > limitation on the number of possible slices, and we are running with one big > RAID-1 storage system. If you want to break up a single "disk" into many pieces you might want to look at using vinum for this. If you are using hardware raid already you can make the virtual disk a vinum drive and then break it up into as many subdisks as you like. Eg a config like: %%%% drive hwraid1 device /dev/da0s1h volume www plex org concat sd drive hwraid1 len 2G volume mail plex org concat sd drive hwraid1 len 2G %%%% While it adds an extra layer it should not be too much of an overhead. You can also then add as many filesystems as you like, but they cannot share the same total disk. You could however add extra subdisks if more space is needed and run growfs to increase room if it is needed. > Also, I found that this generates errors (by mountd -r): > > /export1 -maproot=nobody \ > /export2 -maproot=root \ > server1 > > While this works: > > /export1 \ > /export2 \ > -maproot=root \ > server1 > > That's no good. Is there a solution to this problem? Each "line" should be made of 3 parts: 1 - directory/filesystems to export 2 - attributes 3 - hosts First one does not follow this layout. You can make each directory it's own filesystem using the vinum idea. > By the way, I have found that FreeBSD is a solid NFS server. Other than this > limitation NFS has worked great. > > Handbook on NFS: > http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/network-nfs.html Hope that helps, Tony