SOLVED Cannot reconfigure jail mounts

hexadecagram

Dabbler
Joined
Jul 15, 2016
Messages
32
Hello all,

So I just upgraded to 11.2-U4.1 from 11.2-U2.1. I have a custom jail with extranl mount points that isn't starting and cannot be upgraded.
When I try to upgrade it, I see this message:
["Malformed fstab at line 0: '/mnt/dionysos/postgres /mnt/dionysos/iocage/jails/phoibe/root/var/db/postgres nullfs rw 0 0'", "Malformed fstab at line 1: '/mnt/dionysos/mysql /mnt/dionysos/iocage/jails/phoibe/root/var/db/mysql nullfs rw 0 0'"]
After looking into the mount configuration I see that yes indeed, those strings are stuffed into the Source field of the two mount point configurations instead of separated into Source and Destination fields. Should be easy enough to fix, but when I try to edit one, I see this message:
CallError
EFAULT] Malformed fstab at line 0: '/mnt/dionysos/postgres /mnt/dionysos/iocage/jails/phoibe/root/var/db/postgres nullfs rw 0 0' Malformed fstab at line 1: '/mnt/dionysos/mysql /mnt/dionysos/iocage/jails/phoibe/root/var/db/mysql nullfs rw
Attempting to delete them gives this:
TypeError
object of type 'NoneType' has no len()
Is there a way to edit my configuration from the command line?
Alternatively, I could delete the jail configuration and re-create the jail entirely but I'm not sure how to do that without deleting the jail data itself. Is that possible?
 

cellardoor

Dabbler
Joined
Jul 21, 2017
Messages
25
Hello,
did you try iocage fstab via console?

[root@freenas ~]# iocage fstab --help
Usage: iocage fstab [OPTIONS] JAIL [FSTAB_STRING]...

Manipulate the specified jails fstab.

Options:
-a, --add Adds an entry to the jails fstab and mounts it.
-r, --remove Removes an entry from the jails fstab and unmounts it.
-e, --edit Opens up the fstab file in your environments EDITOR.
-R, --replace TEXT Replace an entry by index number
-l, --list Lists the jails fstab.
-h, -H, --header For scripting, use tabs for separators.
--help Show this message and exit.

List the entries:
iocage -l myjail
Remove an entry:
iocage -r myjail "the listet entry that you would like to remove"
Example for adding mountpoint:
iocage fstab -a myjail "/mnt/tank/source/folder /destination/folder/in/jail nullfs rw 0 0"
 
Last edited:

hexadecagram

Dabbler
Joined
Jul 15, 2016
Messages
32
Note that removing entries is done with -r not -R.

In any case, I was unable to remove the entry. I got the same message ("Malformed fstab") when I attempted.

I ended up having to use -e, which opened up the fstab in vi. I simply deleted the two lines and :wq'ed. Then -l showed that they were both gone and I reconfigured using the WebUI.

Thanks!
 
Top