SOLVED iocage UUID too long for fstab

Joined
Dec 25, 2016
Messages
3
I have been mucking around with iocage and running into problems mounting host shares. When I try:
iocage fstab -a /path/to/the/share

I get

RuntimeError: mount_nullfs: /mnt/iocage/jails/a0a5e528-0198-4342-8058-490e549cc0a8/root/mnt/brouwerNAS/family_movies: File name too long
jail: /sbin/mount -t nullfs -o ro /mnt/brouwerNAS/family_movies /mnt/iocage/jails/a0a5e528-0198-4342-8058-490e549cc0a8/root/mnt/brouwerNAS/family_movies: failed

on starting the jail.

It seems to me that the UUID for the jail is too long so can't mount shares. How can I make the UUID shorter in an existing jail - or a new jail even so I can get stuff mounted.
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
Try to add -s when using iocage create.

Patrick
 

scrappy

Patron
Joined
Mar 16, 2017
Messages
347
iocage has its own way of mounting shares. Use # iocage fstab -a <jail> /path/to/share. That will mount your share to the jail in read only. You can edit your iocage fstab using # iocage fstab -e <jail>
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
@scrappy the OP explicitly stated that he was using iocage fstab -a ...

Patrick
 

scrappy

Patron
Joined
Mar 16, 2017
Messages
347
@scrappy the OP explicitly stated that he was using iocage fstab -a ...

Patrick

Oops, you're absolutely right. Can't believe I glossed over that. One thing I noticed after reading the first part of the OP is that he/she didn't list the jail name before the share to be mounted.
 

pschatz100

Guru
Joined
Mar 30, 2014
Messages
1,184
I've played with iocage quite a bit and never had problems adding storage. As has been previously stated, # iocage fstab -a JAILNAME /the/dir will nullfs mount "/the/dir" into the jail as "/the/dir".

You can also use # iocage fstab -a JAILNAME "/the/source/host/dir /the/dest/dir/in/the/jail nullfs ro 0 0" if you want to specify a particular destination in your jail. And you can replace the ro with rw if you want read/write capability for the mounted volumes.

Replace JAILNAME with the name you assigned to the jail (does not have to be the uuid.)
 
Joined
Dec 25, 2016
Messages
3
Thanks for all the advice. Using -s when creating the jail did the trick - a shorter UUID makes things neater imho!

I did use my JAILNAME with iocage fstab - sorry I left it out in my original post.
 

Philip Robar

Contributor
Joined
Jun 10, 2014
Messages
116
Top