From owner-freebsd-current@FreeBSD.ORG Fri Aug 23 13:32:43 2013 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 1A5E04CC for ; Fri, 23 Aug 2013 13:32:43 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from esa-annu.net.uoguelph.ca (esa-annu.mail.uoguelph.ca [131.104.91.36]) by mx1.freebsd.org (Postfix) with ESMTP id C5DEA276E for ; Fri, 23 Aug 2013 13:32:42 +0000 (UTC) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AqMEAOJjF1KDaFve/2dsb2JhbABSCIM8UYMbvGOBNXSCJAEBAQQBAQEgBCcgCwUWDgoCAg0ZAikBCSYGCAcEARoCBIdvDKRMkjqBKY4ABIEFNAeCaIEuA5Ueg3WIfocvgzsgMoEEOQ X-IronPort-AV: E=Sophos;i="4.89,941,1367985600"; d="scan'208";a="46231534" Received: from muskoka.cs.uoguelph.ca (HELO zcs3.mail.uoguelph.ca) ([131.104.91.222]) by esa-annu.net.uoguelph.ca with ESMTP; 23 Aug 2013 09:32:35 -0400 Received: from zcs3.mail.uoguelph.ca (localhost.localdomain [127.0.0.1]) by zcs3.mail.uoguelph.ca (Postfix) with ESMTP id 74654B3F4E; Fri, 23 Aug 2013 09:32:35 -0400 (EDT) Date: Fri, 23 Aug 2013 09:32:35 -0400 (EDT) From: Rick Macklem To: Slawa Olhovchenkov Message-ID: <1503899038.12819687.1377264755464.JavaMail.root@uoguelph.ca> In-Reply-To: <20130822133520.GA75880@zxy.spb.ru> Subject: Re: Diskless setup with NFS_V4 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [172.17.91.203] X-Mailer: Zimbra 7.2.1_GA_2790 (ZimbraWebClient - FF3.0 (Win)/7.2.1_GA_2790) Cc: current@freebsd.org X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Aug 2013 13:32:43 -0000 Slawa Olhovchenkov wrote: > Its posible use currentle FreeBSD on NFS_V4 root? > > Explain: > > pxeboot do NFS_v3 (not NFS_v4) mount and pass fd to kernel. > In this setup kernel can use only configured (established) nfs fh. > This is not allowed to switch version or some options. > > When pxeboot use TFTP (not NFS) kernel (in nfs/bootp_subr.c) do DHCP > discover and don't allow (in nfs/nfs_diskless.c:nfs_parse_options) > 'nfsv4' option. > > nfs/nfs_diskless.c:nfs_setup_diskless also initialy set > > nd3->root_args.flags = (NFSMNT_NFSV3 | NFSMNT_WSIZE | NFSMNT_RSIZE | > NFSMNT_RESVPORT); > > and don't allow 'nfsv4' option. > > Where I be wrong? > How I can use diskless setup with R/O root on NFS_V4 share? No. There are a couple of problems that would need to be resolved for an NFSv4 root fs to work. 1 - An NFSv4 mount needs a unique identifier for the client machine. It currently uses the host uuid, but that is filled in by a userland utility run from the root fs (ie. not available soon enough). Linux uses the ip host address for this, which I believe is bogus and inappropriate. 2 - Without the nfsuserd daemon running, there is currently no uid/gid<-->name mappings available. This might work, but there would be a lot of "file owned by nobody" situations that could cause problems. I suspect this can be fixed by hardwiring a few mappings (root, bin,...), but there is currently no code to do this. The Linux solution for this is to put the number in a string on the wire and the updated draft of RFC3530 (called rfc3530bis, not yet an RFC) allows this, so eventually this will be supported by most/all servers. Until 1 and 2 are resolved, doing an NFSv4 root fs mount is not practical. To be honest, I don't see a need for it, since I'm "old fashioned" and still believe that the root fs should be a small volume of critical system utilities only, so an NFSv3 mount of it should be sufficient. (ie. If /var and any other subtrees where files might get byte range locked are on separate volumes, I think it should be fine with a NFSv3 root fs mount, even without running rpc.lockd.) rick > _______________________________________________ > freebsd-current@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to > "freebsd-current-unsubscribe@freebsd.org" >