Re: nfs mounts don't work through fstab

From: Eygene Ryabinkin <rea-fbsd_at_codelabs.ru>
Date: Wed, 20 Feb 2008 15:36:12 +0300
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_at_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?
-- 
Eygene
Received on Wed Feb 20 2008 - 11:36:16 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:27 UTC