mount -a problem with /etc/fstab

Ben Woods woodsb02 at gmail.com
Sun Jan 7 02:30:47 UTC 2018


On Sat, 6 Jan 2018 at 3:50 am, Per Gunnarsson via freebsd-questions <
freebsd-questions at freebsd.org> wrote:

> When I try mount -a I get:
>
> fstab: /etc/fstab:9: Inappropriate file type or format
> fstab: /etc/fstab:10: Inappropriate file type or format
>
> My fstab below:
>
>
> /dev/ada0p2     /               ufs     rw      1       1
> /dev/ada0p3     none            swap    sw      0       0
> /dev/ada0p4     /tmp            ufs     rw      2       2
> /dev/ada0p5     /var            ufs     rw      2       2
> /dev/ada0p6     /usr            ufs     rw      2       2
> /dev/ada0p7     /home           ufs     rw      2       2
>
> /dev/linux_lvm/konjak-vg-root   /debian/root ext4
> mountprog=/usr/local/bin/ext4fuse allow_other,ro 0 0
>
> /dev/linux_lvm/konjak-vg-home   /debian/home ext4
> mountprog=/usr/local/bin/ext4fuse allow_other,ro 0 0
>

Whilst I am not sure about the legitimacy of these lines in general, I
believe you should have a comma instead of a space between the end of the
mountprog option and the allow_other option.

See the fstab(5) manpage:

https://man.freebsd.org/fstab

”fields on each line are separated by tabs or spaces.”


“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 options
flag (*-o*) in the mount(8)
<https://www.freebsd.org/cgi/man.cgi?query=mount&sektion=8&apropos=0&manpath=FreeBSD+11.1-RELEASE+and+Ports>
page and the file system specific page, such as mount_nfs(8)
<https://www.freebsd.org/cgi/man.cgi?query=mount_nfs&sektion=8&apropos=0&manpath=FreeBSD+11.1-RELEASE+and+Ports>,
for additional options that may be specified. All options that can be given
to the file system specific mount commands can be used in *fstab* as well.
They just need to be formatted a bit differently. The arguments of the *-o*
option can be used without the preceding *-o* flag. Other options need both
the file system specific flag and its argument, separated by an equal sign.


For example, mounting an msdosfs(5)
<https://www.freebsd.org/cgi/man.cgi?query=msdosfs&sektion=5&apropos=0&manpath=FreeBSD+11.1-RELEASE+and+Ports>
filesystem, the options

    -o sync -o noatime -m 644 -M 755 -u foo -g bar

should be written as

    sync,noatime,-m=644,-M=755,-u=foo,-g=bar

in the option field of *fstab*.”

Regards,
Ben
-- 

--
From: Benjamin Woods
woodsb02 at gmail.com


More information about the freebsd-questions mailing list