# mount_nullfs in fstab failed at boot



## joggx (Sep 4, 2020)

Hi,

I try to mount a zfs dataset to jails' /mnt folders in host's `/etc/fstab`, the server fails to boot with this error:


```
mount_nullfs: /tank/srv: No such file or directory
```

Thanks for any suggestion.


----------



## chrbr (Sep 4, 2020)

Please mount the jails folder when the jail has been started. This can be done by a fstab file for a jail. Find below an example. In the general jail configuration file /etc/jail.conf add an entry as below.

```
thejail {
                path = "/usr/jails/thejail";
                ....
                mount.fstab="/etc/fstab.thejail";
           }
```
Create /etc/fstab.thejail with the contant as

```
/usr/home/myself/Downloads /usr/jails/thejail/usr/home/myself/Downloads nullfs rw,late 0 0
```
This example mounts the Downloads directory of myself to the same location in the jail to share the content.


----------



## Emrion (Sep 4, 2020)

Normally, you just have to set the `late` option in the corresponding lines of /etc/fstab. 
But you should post the content of your /etc/fstab.


----------



## joggx (Sep 5, 2020)

Right, I didn't use the `late` option:


```
/tank/srv        /usr/jails/back1/mnt/srv  nullfs  rw  0   0
```


----------



## Emrion (Sep 5, 2020)

Seems good for me, providing /tank/srv is the source and /mnt/srv is what you jail sees.
`/tank/srv        /usr/jails/back1/mnt/srv  nullfs  rw,late  0   0`

However, I think that mount the thing when the jail starts is a safer way (as *chrbr* said). Even, I don't use this method. Because if one day, you delete the jail, you will have a problem at startup (and probably dropped in single user mode).


----------



## joggx (Sep 5, 2020)

I would try to use the jail conf way. But after:


```
cat /var/run/jail.*.conf >> /etc/jail.conf
```

still have this warning:


```
Starting jails:/etc/rc.d/jail: WARNING: /var/run/jail.srv.conf is created and used for jail srv.
/etc/rc.d/jail: WARNING: Per-jail configuration via jail_* variables  is obsolete.  Please consider migrating to /etc/jail.conf.
```

if I remove files in `/usr/local/etc/ezjail/` then jail can't be started with not found error.


----------



## Deleted member 63539 (Sep 6, 2020)

joggx said:


> I would try to use the jail conf way. But after:
> 
> 
> ```
> ...


What are you trying to do? Are you using the standard jail tools or ezjail or mixed them up? Are you want to convert your ezjail jails to the standard jail tools? BTW, you don't have to care about this message:


```
/etc/rc.d/jail: WARNING: Per-jail configuration via jail_* variables  is obsolete.  Please consider migrating to /etc/jail.conf.
```

ezjail seemed to be no longer developed: https://www.freshports.org/sysutils/ezjail/ and it's still using the obsolete method.


----------

