mount_nullfs in fstab failed at boot

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:

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

Thanks for any suggestion.
 
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.
Code:
thejail {
                path = "/usr/jails/thejail";
                ....
                mount.fstab="/etc/fstab.thejail";
           }
Create /etc/fstab.thejail with the contant as
Code:
/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.
 
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.
 
Right, I didn't use the late option:

Code:
/tank/srv        /usr/jails/back1/mnt/srv  nullfs  rw  0   0
 
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).
 
I would try to use the jail conf way. But after:

Code:
cat /var/run/jail.*.conf >> /etc/jail.conf

still have this warning:

Code:
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.
 
I would try to use the jail conf way. But after:

Code:
cat /var/run/jail.*.conf >> /etc/jail.conf

still have this warning:

Code:
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.
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:

Code:
/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.
 
Back
Top