Accidentally deleted Iocage Jail

Status
Not open for further replies.

ric

Contributor
Joined
Dec 22, 2013
Messages
180
The jail that I want to recover is "mycloud", and is not showing from jls command. What is the command on how to restore the "mycloud" jail into the jls? Thanks!
root@freenas:~ # jls
JID IP Address Hostname Path
1 customplugin_1 /mnt/ssd/jails_pool_new/customplugin_1
2 customplugin_2 /mnt/ssd/jails_pool_new/customplugin_2
3 customplugin_3 /mnt/ssd/jails_pool_new/customplugin_3
6 nextcloud /mnt/iocage/jails/nextcloud/root

root@freenas:~ # cd /mnt/iocage/jails/
root@freenas:/mnt/iocage/jails # ls
mycloud nextcloud


root@freenas:~ # iocage list
+-----+-----------+-------+--------------+---------------+
| JID | NAME | STATE | RELEASE | IP4 |
+=====+===========+=======+==============+===============+
| - | mycloud | down | 11.1-RELEASE | 192.168.1.210 |
+-----+-----------+-------+--------------+---------------+
| 6 | nextcloud | up | 11.1-RELEASE | 192.168.1.0 |
+-----+-----------+-------+--------------+---------------+
root@freenas:~ #

root@freenas:~ # iocage restart mycloud
mycloud is not running!
* Starting mycloud
+ Start FAILED
mount_nullfs: /mnt/iocage/jails/mycloud/root/mnt/files: Resource deadlock avoided
jail: /sbin/mount -t nullfs -o rw /mnt/tank/files /mnt/iocage/jails/mycloud/root/mnt/files: failed

root@freenas:~ # iocage restart ALL
* Stopping nextcloud
+ Running prestop OK
+ Stopping services OK
+ Tearing down VNET OK
+ Removing jail process OK
+ Running poststop OK
mycloud is not running!
* Starting nextcloud
+ Started OK
+ Configuring VNET OK
+ Starting services OK
* Starting mycloud
+ Start FAILED
mount_nullfs: /mnt/iocage/jails/mycloud/root/mnt/files: Resource deadlock avoided
jail: /sbin/mount -t nullfs -o rw /mnt/tank/files /mnt/iocage/jails/mycloud/root/mnt/files: failed

root@freenas:~ # iocage console mycloud
mount_nullfs: /mnt/iocage/jails/mycloud/root/mnt/files: Resource deadlock avoided
jail: /sbin/mount -t nullfs -o rw /mnt/tank/files /mnt/iocage/jails/mycloud/root/mnt/files: failed

root@freenas:~ #cat /vat/log/messages
Oct 14 00:00:00 freenas syslog-ng[1837]: Configuration reload request received, reloading configuration;
Oct 14 08:29:51 freenas kernel: vnet0:6: link state changed to DOWN
Oct 14 08:29:51 freenas kernel: vnet0:6: link state changed to DOWN
Oct 14 08:29:51 freenas kernel: epair0b: link state changed to DOWN
Oct 14 08:29:51 freenas kernel: epair0b: link state changed to DOWN
Oct 14 08:29:51 freenas kernel: ifa_maintain_loopback_route: deletion failed for interface lo0: 48
Oct 14 08:29:51 freenas epair4a: Ethernet address: 02:92:50:00:09:0a
Oct 14 08:29:51 freenas epair4b: Ethernet address: 02:92:a0:00:0b:0b
Oct 14 08:29:51 freenas kernel: epair4a: link state changed to UP
Oct 14 08:29:51 freenas kernel: epair4a: link state changed to UP
Oct 14 08:29:51 freenas kernel: epair4b: link state changed to UP
Oct 14 08:29:51 freenas kernel: epair4b: link state changed to UP
Oct 14 08:29:51 freenas kernel: epair4a: changing name to 'vnet0:8'
Oct 14 08:29:51 freenas kernel: epair4b: changing name to 'epair0b'
Oct 14 08:29:51 freenas kernel: vnet0:8: promiscuous mode enabled
root@freenas:~ #

"release": "11.1-RELEASE-p11",
 
Last edited:

Jailer

Not strong, but bad
Joined
Sep 12, 2014
Messages
4,977
Your jail wont show up using the jls command because it's not running. It won't start because you have your mount points wrong. You need to set the destination to a location inside the jail not the path from your pool. You'll have to remove your current mount point and then re do it with the proper path.
 

ric

Contributor
Joined
Dec 22, 2013
Messages
180
The "nextcloud" iocage jail is within same path /mnt/iocage/jails/nextcloud/ as "mycloud" jail, and I can stop, restart nextcloud without any issues.

root@freenas:/mnt/iocage/jails # ls
mycloud nextcloud
root@freenas:/mnt/iocage/jails #
 
Last edited:

8-bit Yoda

Explorer
Joined
Jun 16, 2018
Messages
68
Your jail isn't deleted, it's just not running. jls only shows jails that running.

What's with customplugin_1 through 3? Are these old/warden jails or did you activate a new pool or something?

What is the output of zfs list -r `iocage get --pool`/iocage
 

ric

Contributor
Joined
Dec 22, 2013
Messages
180
Here's the output of "zfs list -r `iocage get --pool`/iocage"
root@freenas:~ # zfs list -r `iocage get --pool`/iocage
NAME USED AVAIL REFER MOUNTPOINT
tank/iocage 5.28G 71.5G 471K /mnt/iocage
tank/iocage/download 261M 71.5G 209K /mnt/iocage/download
tank/iocage/download/11.1-RELEASE 260M 71.5G 260M /mnt/iocage/download/11.1-RELEASE
tank/iocage/images 523K 71.5G 198K /mnt/iocage/images
tank/iocage/jails 3.76G 71.5G 221K /mnt/iocage/jails
tank/iocage/jails/mycloud 3.68G 71.5G 221K /mnt/iocage/jails/mycloud
tank/iocage/jails/mycloud/root 3.68G 71.5G 3.88G /mnt/iocage/jails/mycloud/root
tank/iocage/jails/nextcloud 80.9M 71.5G 221K /mnt/iocage/jails/nextcloud
tank/iocage/jails/nextcloud/root 80.5M 71.5G 1.20G /mnt/iocage/jails/nextcloud/root
tank/iocage/log 988K 71.5G 227K /mnt/iocage/log
tank/iocage/releases 1.26G 71.5G 209K /mnt/iocage/releases
tank/iocage/releases/11.1-RELEASE 1.26G 71.5G 209K /mnt/iocage/releases/11.1-RELEASE
tank/iocage/releases/11.1-RELEASE/root 1.26G 71.5G 1.20G /mnt/iocage/releases/11.1-RELEASE/root
tank/iocage/templates 523K 71.5G 198K /mnt/iocage/templates
root@freenas:~ #
 

8-bit Yoda

Explorer
Joined
Jun 16, 2018
Messages
68
ok, you have two iocage jails mycloud and owncloud on active pool tank.

The likely reason mycloud doesn't like the mount, is either because source folder /mnt/tank/files is already mounted in owncloud, or because the destination directory /mnt/files doesn't exist in your mycloud jail.

Does mycloud start when you stop owncloud?
 

ric

Contributor
Joined
Dec 22, 2013
Messages
180
ok, you have two iocage jails mycloud and owncloud on active pool tank.

The likely reason mycloud doesn't like the mount, is either because source folder /mnt/tank/files is already mounted in owncloud, or because the destination directory /mnt/files doesn't exist in your mycloud jail.

Does mycloud start when you stop nextcloud?

When you say owncloud, I'm assuming that you're referring to the nextcloud.

I stopped "nextcloud", and then finally "mycloud" started but "mycloud" still not listed when I use jls.

root@freenas:~ # iocage stop nextcloud
* Stopping nextcloud
+ Running prestop OK
+ Stopping services OK
+ Tearing down VNET OK
+ Removing jail process OK
+ Running poststop OK
root@freenas:~ # iocage stop mycloud
mycloud is not running!
root@freenas:~ # jls
JID IP Address Hostname Path
2 customplugin_1 /mnt/ssd/jails_pool_new/customplugin_1
3 customplugin_2 /mnt/ssd/jails_pool_new/customplugin_2
4 customplugin_3 /mnt/ssd/jails_pool_new/customplugin_3
5 mineos_1 /mnt/ssd/jails_pool_new/mineos_1
root@freenas:~ # iocage stop nextcloud
nextcloud is not running!
root@freenas:~ # iocage start nextcloud
* Starting nextcloud
+ Started OK
+ Configuring VNET OK
+ Starting services OK
root@freenas:~ # jls
JID IP Address Hostname Path
2 customplugin_1 /mnt/ssd/jails_pool_new/customplugin_1
3 customplugin_2 /mnt/ssd/jails_pool_new/customplugin_2
4 customplugin_3 /mnt/ssd/jails_pool_new/customplugin_3
5 mineos_1 /mnt/ssd/jails_pool_new/mineos_1
6 nextcloud /mnt/iocage/jails/nextcloud/root
root@freenas:~ # iocage start nextcloud
 

8-bit Yoda

Explorer
Joined
Jun 16, 2018
Messages
68
root@freenas:~ # iocage stop mycloud
mycloud is not running!
root@freenas:~ # jls
Is that a typo? The output didn't show where you started mycloud. Try this:
Code:
iocage stop nextcloud
iocage start mycloud
jls
 

ric

Contributor
Joined
Dec 22, 2013
Messages
180
My mistake, "iocage start mycloud" has no change still failed to start.

root@freenas:~ # iocage stop nextcloud
nextcloud is not running!
root@freenas:~ # iocage start mycloud
* Starting mycloud
+ Start FAILED
mount_nullfs: /mnt/iocage/jails/mycloud/root/mnt/files: Resource deadlock avoided
jail: /sbin/mount -t nullfs -o rw /mnt/tank/files /mnt/iocage/jails/mycloud/root/mnt/files: failed

root@freenas:~ #
 

8-bit Yoda

Explorer
Joined
Jun 16, 2018
Messages
68
Try un-mouting whatever is mounted in mycloud and check if the mycloud jail starts. Something is conflicting.
 

ric

Contributor
Joined
Dec 22, 2013
Messages
180
I've deleted "nextcloud" jail but that didnt help at all.

How can I check whatever mounted in "mycloud"?

I checked freenas GUI nothing mounted there with mycloud.
 

8-bit Yoda

Explorer
Joined
Jun 16, 2018
Messages
68
Use iocage fstab -l mycloud to see what it will try to mount in mycloud when starting the jail.
 

ric

Contributor
Joined
Dec 22, 2013
Messages
180
Based on the output below from "ocage restart mycloud", when starting "mycloud" it's tried to mount the following:

/mnt/tank/files /mnt/iocage/jails/mycloud/root /mnt/files

root@freenas:~ # iocage restart mycloud
mycloud is not running!
* Starting mycloud
+ Start FAILED
mount_nullfs: /mnt/iocage/jails/mycloud/root/mnt/files: Resource deadlock avoided
jail: /sbin/mount -t nullfs -o rw /mnt/tank/files /mnt/iocage/jails/mycloud/root /mnt/files: failed



root@freenas:~ # iocage fstab -l mycloud
+-------+------------------------------------------------------------------------+
| INDEX | FSTAB ENTRY |
+=======+========================================================================+
| 0 | /mnt/tank/files /mnt/iocage/jails/mycloud/root/mnt/files nullfs rw 0 0 |
+-------+------------------------------------------------------------------------+
| 1 | /mnt/tank/files /mnt/iocage/jails/mycloud/root/mnt/files nullfs rw 0 0 |
+-------+------------------------------------------------------------------------+
| 2 | /mnt/tank/db /mnt/iocage/jails/mycloud/root/var/db/mysql nullfs rw 0 0 |
+-------+------------------------------------------------------------------------+
 
Last edited:

8-bit Yoda

Explorer
Joined
Jun 16, 2018
Messages
68
OK, it looks like you have the same folder /mnt/tank/files mounted twice to the same location. That could explain the deadlock message.

Remove the duplicate entry by running iocage fstab -r mycloud 1 and try to start mycloud again and/or check if it's gone by running iocage fstab -l mycloud again.
 
Status
Not open for further replies.
Top