Deleting the old release version

Inxsible

Guru
Joined
Aug 14, 2017
Messages
1,123
I am trying to delete the old 11.1-RELEASE version from my iocage download & release folders. For this I tried
Code:
iocage destroy -r 11.1-RELEASE
However it resulted in telling me that 2 of my jails are dependent on that release even though I have upgraded those jails to 11.2-RELEASE
Why is it warning me about the jails depending on 11.1 even when they have been upgraded?
Code:
root@nas:/mnt/tank/home/inxsible # iocage list
+-----+--------------+-------+--------------+-------------+
| JID |     NAME     | STATE |   RELEASE    |     IP4     |
+=====+==============+=======+==============+=============+
| 40  | couchpotato  | up    | 11.2-RELEASE |  |
+-----+--------------+-------+--------------+-------------+
| 42  | emby         | up    | 11.2-RELEASE |  |
+-----+--------------+-------+--------------+-------------+
| 43  | radarr       | up    | 11.2-RELEASE |  |
+-----+--------------+-------+--------------+-------------+
| 21  | transmission | up    | 11.2-RELEASE |  |
+-----+--------------+-------+--------------+-------------+
root@nas:/mnt/tank/home/inxsible # iocage destroy -r 11.1-RELEASE

This will destroy RELEASE: 11.1-RELEASE

Are you sure? [y/N]: y

11.1-RELEASE has dependent jails (who may also have dependents), use --recursive to destroy:
  emby
  transmission

root@nas:/mnt/tank/home/inxsible # 
emby and transmission jails were created using CLI under 11.1-U5 whereas the couchpotato and radarr jails were created under 11.2.

although during upgrade of emby and transmission I do get the following
Code:
root@nas:/mnt/tank/home/inxsible # iocage update transmission
Snapshotting transmission...
Updating plugin INDEX...
Removing old pkgs...
Installing new pkgs...

Testing SRV response to iocage-plugins
Testing DNSSEC response to iocage-plugins

Installing plugin packages:
  - net-p2p/transmission-daemon...
  - www/transmission-web...
Updating plugin artifact...

Branch 11.2-RELEASE does not exist at https://github.com/freenas/iocage-plugin-transmission.git!
Using "master" branch for plugin, this may not work with your RELEASE

transmission has been updated successfully.
Note the bolded italic line. (emphasis mine)

Would using -recursive flag be safe? I really don't want to have to recreate my emby jail -- it's a pain to research all the meta data for my movies all over again.
 
Last edited:

meku

Dabbler
Joined
May 4, 2014
Messages
34
It seems pretty clear that recursively deleting your 11.1-RELEASE would delete some of your jails.

Iocage jails are zfs clones from a snapshot of the release jail they were created from. It appears that using zfs promote can break the dependency, allowing the release jail to be deleted.
 

Inxsible

Guru
Joined
Aug 14, 2017
Messages
1,123
It seems pretty clear that recursively deleting your 11.1-RELEASE would delete some of your jails.
I know that but I have upgraded all the jails to 11.2-RELEASE as shown by iocage list. so why would there still be a dependency to 11.1-RELEASE?

calling @dlavigne or any other experts
 

meku

Dabbler
Joined
May 4, 2014
Messages
34
The dependency is not in iocage, it is the underlying zfs datasets.

When you first created the jail it cloned the 11.1-RELEASE be your jail. Later you upgraded the contents of your jail to 11.2-RELEASE but the zfs dataset is still a dependent clone of that original 11.1-RELEASE. Read the Docs about zfs clones and their usage.
 

Inxsible

Guru
Joined
Aug 14, 2017
Messages
1,123
Ok, so how would I upgrade the ZFS dataset to 11.2-RELEASE? By upgrading the ZFS dataset, would it then be possible to break the dependency of the jail on a particular release version?
 

Inxsible

Guru
Joined
Aug 14, 2017
Messages
1,123
I never updated this thread --- but here's what I did thanks to @meku

Here's my zfs list before I did zfs promote
Code:
root@nas:/mnt/tank/home/inxsible # zfs list
NAME                                                    USED  AVAIL  REFER  MOUNTPOINT
freenas-boot                                           2.32G  4.65G    64K  none
freenas-boot/ROOT                                      2.30G  4.65G    29K  none
freenas-boot/ROOT/11.2-RELEASE                          239K  4.65G   762M  /
freenas-boot/ROOT/11.2-U4.1                            2.30G  4.65G   757M  /
freenas-boot/ROOT/Initial-Install                         1K  4.65G   835M  legacy
freenas-boot/ROOT/default                               195K  4.65G   836M  legacy
freenas-boot/grub                                      7.02M  4.65G  7.02M  legacy
tank                                                   1.45T  3.82T   104K  /mnt/tank
tank/.system                                           58.1M  3.82T    96K  legacy
tank/.system/configs-b3147af497d748f98f845f65b942be53  38.4M  3.82T  38.4M  legacy
tank/.system/cores                                     1.40M  3.82T  1.40M  legacy
tank/.system/rrd-b3147af497d748f98f845f65b942be53      16.5M  3.82T  16.5M  legacy
tank/.system/samba4                                     164K  3.82T   164K  legacy
tank/.system/syslog-b3147af497d748f98f845f65b942be53   1.49M  3.82T  1.49M  legacy
tank/.system/webui                                       88K  3.82T    88K  legacy
tank/documents                                         1.62G  18.4G  1.62G  /mnt/tank/documents
tank/iocage                                            10.7G  3.82T  5.02M  /mnt/iocage
tank/iocage/download                                    532M  3.82T    88K  /mnt/iocage/download
tank/iocage/download/11.1-RELEASE                       260M  3.82T   260M  /mnt/iocage/download/11.1-RELEASE
tank/iocage/download/11.2-RELEASE                       272M  3.82T   272M  /mnt/iocage/download/11.2-RELEASE
tank/iocage/images                                       88K  3.82T    88K  /mnt/iocage/images
tank/iocage/jails                                      8.26G  3.82T    96K  /mnt/iocage/jails
tank/iocage/jails/couchpotato                           272M  3.82T   184K  /mnt/iocage/jails/couchpotato
tank/iocage/jails/couchpotato/root                      272M  3.82T   833M  /mnt/iocage/jails/couchpotato/root
tank/iocage/jails/emby                                 6.83G  3.82T   176K  /mnt/iocage/jails/emby
tank/iocage/jails/emby/root                            6.82G  3.82T  3.36G  /mnt/iocage/jails/emby/root
tank/iocage/jails/radarr                                953M  3.82T   200K  /mnt/iocage/jails/radarr
tank/iocage/jails/radarr/root                           952M  3.82T  1.28G  /mnt/iocage/jails/radarr/root
tank/iocage/jails/transmission                          242M  3.82T   172K  /mnt/iocage/jails/transmission
tank/iocage/jails/transmission/root                     241M  3.82T   739M  /mnt/iocage/jails/transmission/root
tank/iocage/log                                         112K  3.82T   112K  /mnt/iocage/log
tank/iocage/releases                                   1.92G  3.82T    88K  /mnt/iocage/releases
tank/iocage/releases/11.1-RELEASE                       986M  3.82T    88K  /mnt/iocage/releases/11.1-RELEASE
tank/iocage/releases/11.1-RELEASE/root                  986M  3.82T   973M  /mnt/iocage/releases/11.1-RELEASE/root
tank/iocage/releases/11.2-RELEASE                       981M  3.82T    88K  /mnt/iocage/releases/11.2-RELEASE
tank/iocage/releases/11.2-RELEASE/root                  981M  3.82T   972M  /mnt/iocage/releases/11.2-RELEASE/root
tank/iocage/templates                                    88K  3.82T    88K  /mnt/iocage/templates
tank/jails                                               88K  3.82T    88K  /mnt/tank/jails
tank/media                                             1.20T  3.82T  1.20T  /mnt/tank/media
tank/memories                                           228G  3.82T   228G  /mnt/tank/memories
tank/work                                              9.79G  40.2G  9.79G  /mnt/tank/work


Then because it was complaining that emby and transmission were dependent on 11.1-RELEASE, I promoted tank/iocage/jails/transmission/root. Promoting tank/iocage/jails/transmission gave an error indicating that the jail was not a clone
Code:
root@nas:/mnt/tank/home/inxsible # zfs promote tank/iocage/jails/transmission
cannot promote 'tank/iocage/jails/transmission': not a cloned filesystem
root@nas:/mnt/tank/home/inxsible # zfs promote tank/iocage/jails/transmission/root


Once I did that, I thought of trying to destroy the 11.1-RELEASE . I was expecting that it would now only complain about emby being dependent on that release since I had promoted the transmission jail. However it just went ahead and destroyed the 11.1-RELEASE.
Code:
root@nas:/mnt/tank/home/inxsible # iocage destroy -d -r 11.1-RELEASE

This will destroy RELEASE: 11.1-RELEASE

Are you sure? [y/N]: y
Destroying RELEASE dataset: 11.1-RELEASE
Destroying RELEASE download dataset: 11.1-RELEASE
root@nas:/mnt/tank/home/inxsible # iocage list


And finally, here's my zfs list after destroying the 11.1-RELEASE
Code:
root@nas:/mnt/tank/home/inxsible # zfs list
NAME                                                    USED  AVAIL  REFER  MOUNTPOINT
freenas-boot                                           2.32G  4.65G    64K  none
freenas-boot/ROOT                                      2.30G  4.65G    29K  none
freenas-boot/ROOT/11.2-RELEASE                          239K  4.65G   762M  /
freenas-boot/ROOT/11.2-U4.1                            2.30G  4.65G   757M  /
freenas-boot/ROOT/Initial-Install                         1K  4.65G   835M  legacy
freenas-boot/ROOT/default                               195K  4.65G   836M  legacy
freenas-boot/grub                                      7.02M  4.65G  7.02M  legacy
tank                                                   1.45T  3.82T   104K  /mnt/tank
tank/.system                                           58.1M  3.82T    96K  legacy
tank/.system/configs-b3147af497d748f98f845f65b942be53  38.4M  3.82T  38.4M  legacy
tank/.system/cores                                     1.40M  3.82T  1.40M  legacy
tank/.system/rrd-b3147af497d748f98f845f65b942be53      16.5M  3.82T  16.5M  legacy
tank/.system/samba4                                     164K  3.82T   164K  legacy
tank/.system/syslog-b3147af497d748f98f845f65b942be53   1.49M  3.82T  1.49M  legacy
tank/.system/webui                                       88K  3.82T    88K  legacy
tank/documents                                         1.62G  18.4G  1.62G  /mnt/tank/documents
tank/iocage                                            10.4G  3.82T  5.02M  /mnt/iocage
tank/iocage/download                                    272M  3.82T    88K  /mnt/iocage/download
tank/iocage/download/11.2-RELEASE                       272M  3.82T   272M  /mnt/iocage/download/11.2-RELEASE
tank/iocage/images                                       88K  3.82T    88K  /mnt/iocage/images
tank/iocage/jails                                      9.21G  3.82T    96K  /mnt/iocage/jails
tank/iocage/jails/couchpotato                           272M  3.82T   184K  /mnt/iocage/jails/couchpotato
tank/iocage/jails/couchpotato/root                      272M  3.82T   833M  /mnt/iocage/jails/couchpotato/root
tank/iocage/jails/emby                                 6.83G  3.82T   176K  /mnt/iocage/jails/emby
tank/iocage/jails/emby/root                            6.82G  3.82T  3.36G  /mnt/iocage/jails/emby/root
tank/iocage/jails/radarr                                953M  3.82T   200K  /mnt/iocage/jails/radarr
tank/iocage/jails/radarr/root                           952M  3.82T  1.28G  /mnt/iocage/jails/radarr/root
tank/iocage/jails/transmission                         1.19G  3.82T   172K  /mnt/iocage/jails/transmission
tank/iocage/jails/transmission/root                    1.18G  3.82T   739M  /mnt/iocage/jails/transmission/root
tank/iocage/log                                         112K  3.82T   112K  /mnt/iocage/log
tank/iocage/releases                                    981M  3.82T    88K  /mnt/iocage/releases
tank/iocage/releases/11.2-RELEASE                       981M  3.82T    88K  /mnt/iocage/releases/11.2-RELEASE
tank/iocage/releases/11.2-RELEASE/root                  981M  3.82T   972M  /mnt/iocage/releases/11.2-RELEASE/root
tank/iocage/templates                                    88K  3.82T    88K  /mnt/iocage/templates
tank/jails                                               88K  3.82T    88K  /mnt/tank/jails
tank/media                                             1.20T  3.82T  1.20T  /mnt/tank/media
tank/memories                                           228G  3.82T   228G  /mnt/tank/memories
tank/work                                              9.79G  40.2G  9.79G  /mnt/tank/work


I achieved what I wanted, but I am not sure why it kept saying that both emby and transmission were dependent on 11.1-RELEASE, but then allowed me to destroy the 11.1-RELEASE only after promoting the transmission jail. Oh well !
 

f00b4r00

Dabbler
Joined
Jan 5, 2020
Messages
41
I'm resurrecting this thread as I stumbled upon the same question/problem while wanting to free my pool from the 11.2-RELEASE after moving to 11.3, and it turns out that the post above probably didn't do what @Inxsible expected: as evidenced by the last output of zfs list, no space was freed from the pool.

If I read the doc properly, zfs promote simply reverse the clone and source relationship: the jail becomes the source and the clone can be removed, but this is purely cosmetic: the jail still depends on the data that was in the previous release.

From my very limited understanding of iocage operation and interaction with zfs clones, what would be needed for this to work correctly is for iocage upgrade to basically "rebase" the upgraded jail onto the new release, i.e. to make it a proper clone of the new release, so that all ties to the previous one are severed. I'm not sure if that's what it is supposed to do (it looks as if it were instead upgrading the jail "in place"), but as evidenced in my failure to remove 11.2-RELEASE despite upgrading all my jails to 11.3-RELEASE, it doesn't work.

HTH

EDIT: I reinstalled my jails from scratch on the new release, and deleted the old jails from the GUI. After doing that, iocage destroy -R -f -d -r 11.2-RELEASE would now complain that the old jails where not found. It turned out that this was due to snapshots still being there. Which makes me wonder if the upgrade was in fact correct in the first place and iocage destroy was simply complaining about these snapshots in a very non-obvious way.
 
Last edited:

Inxsible

Guru
Joined
Aug 14, 2017
Messages
1,123
When I upgraded from 11.2 to 11.3 and then to 11.3-U2, all my jails were upgraded correctly in that I don't have the 11.2 entries in my zfs list at all without me having to intervene.

I believe that it was a bug that was fixed between 11.1 and 11.3
 

itet

Dabbler
Joined
Aug 19, 2020
Messages
26
I upgraded from 11.3 to TrueNAS 12.1 BETA2. I also upgraded all jails to new release but I cannot clean my system to delete old jails because of dependencies and jail not found.

Code:
root@TRUENAS01:~ # iocage destroy -r -d 11.2-RELEASE
This will destroy RELEASE: 11.2-RELEASE

Are you sure? [y/N]: y

11.2-RELEASE has dependent jails (who may also have dependents), use --recursive to destroy:
  nextcloud
  plex
  rslsync


Code:
root@TRUENAS01:~ # iocage destroy -r -d -R 11.2-RELEASE

This will destroy RELEASE: 11.2-RELEASE

Are you sure? [y/N]: y
jail '  nextcloud
' not found!
 

ChrisChros

Patron
Joined
Nov 24, 2018
Messages
218
@itet any updates on that, have the same problem.
 

ChrisChros

Patron
Joined
Nov 24, 2018
Messages
218
OK after deleting the related snapshots I am still not able to delete the dataset for the old releases
 

Alecmascot

Guru
Joined
Mar 18, 2014
Messages
1,177
move to base jails
 

ChrisChros

Patron
Joined
Nov 24, 2018
Messages
218

Inxsible

Guru
Joined
Aug 14, 2017
Messages
1,123

Alecmascot

Guru
Joined
Mar 18, 2014
Messages
1,177

ChrisChros

Patron
Joined
Nov 24, 2018
Messages
218
got it. I had to delete all my snapshots and then I was able to delete all my old release versions.
 
Top