nfs mounts don't work through fstab

Dominic Fandrey kamikaze at bsdforen.de
Wed Feb 20 12:54:05 UTC 2008


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 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?

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.


More information about the freebsd-current mailing list