Restore deleted images

incus manages a dataset in rpool/incus.

I seem to have plenty of deleted images :slight_smile:

zfs list -t all | grep images

rpool/incus/deleted/images                                                                                  4.53G   187G    96K  legacy
rpool/incus/deleted/images/09830e47159a168e51146f4b550aea57fcfb8883a9328893924b2fd817072d39                  208M   187G   208M  legacy
rpool/incus/deleted/images/09830e47159a168e51146f4b550aea57fcfb8883a9328893924b2fd817072d39@readonly           8K      -   208M  -
rpool/incus/deleted/images/1dfc5a732095bc0713c5ce9409edb3c71245dfa538c3368a8276f0c7023af9ca                  233M   187G   233M  legacy
rpool/incus/deleted/images/1dfc5a732095bc0713c5ce9409edb3c71245dfa538c3368a8276f0c7023af9ca@readonly           8K      -   233M  -
rpool/incus/deleted/images/557ed7fd6333fd1c94e8f5e29dd5b3f8b2587c378c820367211ba7f7f9358fc1                  112K   500M   104K  legacy
rpool/incus/deleted/images/557ed7fd6333fd1c94e8f5e29dd5b3f8b2587c378c820367211ba7f7f9358fc1@readonly           8K      -   104K  -
rpool/incus/deleted/images/557ed7fd6333fd1c94e8f5e29dd5b3f8b2587c378c820367211ba7f7f9358fc1.block            722M   187G   722M  -
rpool/incus/deleted/images/557ed7fd6333fd1c94e8f5e29dd5b3f8b2587c378c820367211ba7f7f9358fc1.block@readonly     8K      -   722M  -
rpool/incus/deleted/images/59e8a3b36bb6c47ced9879dc00e5ca18c2befda66739ea6459a6fef7c224e305                  112K   500M   112K  legacy
rpool/incus/deleted/images/59e8a3b36bb6c47ced9879dc00e5ca18c2befda66739ea6459a6fef7c224e305@readonly           0B      -   112K  -
rpool/incus/deleted/images/59e8a3b36bb6c47ced9879dc00e5ca18c2befda66739ea6459a6fef7c224e305.block           3.17G   187G  3.17G  -
rpool/incus/deleted/images/59e8a3b36bb6c47ced9879dc00e5ca18c2befda66739ea6459a6fef7c224e305.block@readonly     0B      -  3.17G  -
rpool/incus/deleted/images/9f993204acffb3364f405cc901eb433c5cfe01b2b2bc7db53bc75545908a5580                  226M   187G   226M  legacy
rpool/incus/deleted/images/9f993204acffb3364f405cc901eb433c5cfe01b2b2bc7db53bc75545908a5580@readonly           0B      -   226M  -
rpool/incus/images                                                                                           247M   187G    96K  legacy
rpool/incus/images/2d0e467219e6de421a6e6e9a6b1f73ce67b30572413147d1357bb79596caf761                          247M   187G   247M  legacy
rpool/incus/images/2d0e467219e6de421a6e6e9a6b1f73ce67b30572413147d1357bb79596caf761@readonly                   0B      -   247M  -

I understand deleted images are required by containers and vms.

Two questions:

Is there a way to make vm/containers standalone? I guess it is what happens when you use --vm --empty

Is there a way to restore these deleted images so they’re shown again in incus image list?

Thanks for your time

You can’t restore the images as the only thing that’s left of them is their unpacked form as a ZFS dataset. The original image tarball (which is what the image fingerprint is derived from) isn’t conserved and so the image cannot be correctly re-imported.

Now if the image still exists on a remote server, Incus will download the image files once again and will not unpack them given that an unpacked copy already exists.
Instead the dataset will be renamed back to images/ from the current delete/images/