# nullfs fstab not working



## d3ahtsd00r (Sep 9, 2013)

Every time I try to put this in my fstab, I get an "inappropriate file type or format" error. I've looked everywhere and cannot figure out what the problem is.

Can someone tell me where to look? I'm having no luck. Thanks.


```
/path/to/folder/  /guests/ftproot/folder/   nullfs   ro      0       0
```

I'm on 9.2-PRERELEASE.


----------



## ShelLuser (Sep 9, 2013)

What happens when you try to perform the mount command on the command line (so without using /etc/fstab)?

The first thing which comes to my mind is wondering if you loaded the nullfs.ko kernel module. You can check using the `kldstat` command. If the module isn't present (and you haven't setup any specific security settings) then `# kldload nullfs` might be able to help out.


----------



## SirDice (Sep 9, 2013)

Also note that neither directory can be a symlink.


----------



## d3ahtsd00r (Sep 10, 2013)

nullfs was already loaded and the mount_nullfs works fine. Weird, right? And neither directory is a symlink. They are both actual directories.


----------



## ShelLuser (Sep 10, 2013)

I think this could be a two-faced problem. First I'd remove the trailing slashes from the /etc/fstab file. Because if I add those myself then I can reproduce an error message.

The other possible option, but the only reason I noticed is because Linux does this differently, is that you also need to supply the absolute path to the mount point when using the commandline.


```
root@smtp2:/usr/jails/dogma/usr # cat /etc/fstab
/usr/ports/     /usr/jails/dogma/usr/ports/     nullfs  rw      0 0
root@smtp2:/usr/jails/dogma/usr # mount `pwd`/ports
mount: /usr/jails/dogma/usr/ports: unknown special file or file system
```
However if I remove the trailing slashes I get the expected behaviour:


```
root@smtp2:/usr/jails/dogma/usr # cat /etc/fstab
/usr/ports      /usr/jails/dogma/usr/ports      nullfs  rw      0 0
root@smtp2:/usr/jails/dogma/usr # mount `pwd`/ports
root@smtp2:/usr/jails/dogma/usr # mount | grep -e "ports.*dogma"
/usr/ports on /usr/jails/dogma/usr/ports (nullfs, local)
```

Hope this can help.


----------



## d3ahtsd00r (Sep 10, 2013)

I figured out what the issue is. My source path has spaces in it. I thought escaping the spaces with \ would work but it doesn't. It also doesn't like "" around the src path.

How am I supposed to escape spaces?


----------



## ShelLuser (Sep 10, 2013)

d3ahtsd00r said:
			
		

> I figured out what the issue is. My source path has spaces in it. I thought escaping the spaces with \ would work but it doesn't. It also doesn't like "" around the src path.


A small side comment, but it would have helped if you had made sure that the example you gave us in the first message actually matched your situation.



			
				d3ahtsd00r said:
			
		

> How am I supposed to escape spaces?


According to this problem report the problem is known, has been patched, but the solution hasn't been implemented yet ("something is still pending").

So my suggestion at this time would be to avoid spaces in directory names.


----------



## d3ahtsd00r (Sep 10, 2013)

Thanks. I didn't realize that I had spaces in the path until I actually looked at it earlier. Guess I'm going to have to figure something else out.

Thanks.


----------

