From owner-freebsd-current@FreeBSD.ORG Wed Feb 20 12:54:05 2008 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3B6AA16A407 for ; Wed, 20 Feb 2008 12:54:05 +0000 (UTC) (envelope-from kamikaze@bsdforen.de) Received: from mail.bsdforen.de (bsdforen.de [212.204.60.79]) by mx1.freebsd.org (Postfix) with ESMTP id AECA513C461 for ; Wed, 20 Feb 2008 12:54:04 +0000 (UTC) (envelope-from kamikaze@bsdforen.de) Received: from mobileKamikaze.norad (nat-wh-1.rz.uni-karlsruhe.de [129.13.72.169]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.bsdforen.de (Postfix) with ESMTP id 37144405486; Wed, 20 Feb 2008 13:54:03 +0100 (CET) Message-ID: <47BC22EA.4020708@bsdforen.de> Date: Wed, 20 Feb 2008 13:54:02 +0100 From: Dominic Fandrey User-Agent: Thunderbird 2.0.0.9 (X11/20080205) MIME-Version: 1.0 To: Eygene Ryabinkin References: <47BADE07.9020402@gmx.de> <7CZsNG/ix1SXULta6Bdgf51ZwDE@TqmFlxFMySuiJ36EgnrGRgt6KQ8> <47BB01BE.4010309@gmx.de> <0FD9F726-6E45-4A81-9DE1-E3F0AAF3668B@gothic.net.au> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-current@freebsd.org Subject: Re: nfs mounts don't work through fstab X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 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: Wed, 20 Feb 2008 12:54:05 -0000 Eygene Ryabinkin wrote: > Me again. > > Wed, Feb 20, 2008 at 12:15:57PM +1100, Sean wrote: >> From FreeBSD 5.5 (the earliest I can check readily) >> >> fstab(5) >> >> The fourth field, (fs_mntops), describes the mount options associated >> with the file system. It is formatted as a comma separated list of >> options. It contains at least the type of mount (see fs_type below) >> plus >> any additional options appropriate to the file system type. See the > [...] >> So the fs_type (rw, ro, etc.) has always been documented as obligatory, >> though in slightly less than obvious wording. > > Good point. Moreover, I can not make it work even on 6.2-STABLE: > ----- > $ tail -1 /etc/fstab > test:/usr/src /usr/src nfs noauto 0 0 > > $ mount /usr/src > fstab: /etc/fstab:13: Inappropriate file type or format > fstab: /etc/fstab:13: Inappropriate file type or format > mount: /usr/src: unknown special file or file system > > $ mount -t nfs -a > fstab: /etc/fstab:13: Inappropriate file type or format > > $ uname -a > FreeBSD XXX 6.2-STABLE FreeBSD 6.2-STABLE #1: Mon Feb 12 16:31:48 MSK 2007 root@XXX:/usr/obj/usr/src/sys/XXX i386 > ----- > >>> These 2 lines have been in use since 6.0 release: >>> >>> mobileKamikaze:/usr/src /usr/src nfs -b,-T,-R=5,noauto 0 0 >>> mobileKamikaze:/usr/obj /usr/obj nfs -b,-T,-R=5,noauto 0 0 >>> >>> They stopped working with the switch to RELENG_7. >>> >>> # mount /usr/src/ 0 /root >>> fstab: /etc/fstab:27: Inappropriate file type or format >>> fstab: /etc/fstab:28: Inappropriate file type or format >>> fstab: /etc/fstab:27: Inappropriate file type or format >>> fstab: /etc/fstab:28: Inappropriate file type or format >>> >>> mount: /usr/src: unknown special file or file system >>> >>> fstabscan() is the place where the "Inappropriate file type or format" >>> error is printed. The pointer char* cp either points to a string "rw", >>> "ro" or "sw". If none of these are present cp is a NULL-pointer when the >>> final check in line 207 is reached. So error(EFTYPE) is called. > > So, Dominic, something might had changed in your fstab. Because > the code that checks for options exists in the fstab.c since revision > 1.1, see http://www.freebsd.org/cgi/cvsweb.cgi/src/lib/libc/gen/fstab.c?rev=1.1;content-type=text%2Fplain > And the code in question had not been changed substantially since > revision 1.3, see http://www.freebsd.org/cgi/cvsweb.cgi/src/lib/libc/gen/fstab.c?annotate=1.15 > > May be some other utility (like mount) had extracted NFS mounts from > the /etc/fstab by itself, but > 1. it is silly, especially when fstab parsing functions are in libc; > 2. I can not find such changes on the transition path 6.2 -> 7. > While both of the arguments are not very convincing ;)), it may be > well that you missed something about your system. > > Could you, please, recheck? I'm quite certain that I used to not need this. I have checked the history of Wiki articles where I documented this. The mount command has undergone significant changes with the switch to nmount, I suppose whatever happened, happened there. Apparently nobody else had this problem. I interpreted the error message in a way that I thought mount had problems with the host:/mountpoint syntax for nfs mounts. A clearer error message might be appropriate. Inappropriate file type or format doesn't make me consider options. Only by tracking it down in the code was I able to determine what's going on.