TrueNAS: Tool to Mount Images for ZFS RAW Copy on Write

I recently setup UrBackup on a TrueNAS custom app to allow for ZFS RAW Copy on Write image backups (the stock app doesn’t give ZFS access). One issue I found is there was no easy way to mount images. It is not supported via the UI. However, it is possible to mount the images via iscsi, but the snapshots must be cloned and the extents must be created manually.

I created a docker image to do just this. The code and instructions can be found here, as well as an example docker-compose.yml. You do need to manually turn on the iscsi service, but the target, extent, and initiator group will be automatically created.

To use:
Launch the url, Select a client, then a snapshot, then hit “Restore snapshot”. This will create an iscsi target/extent for the snapshot.

Then go to your start menu, type “iscsi” and hit enter on “iSCSI Initiator”. In the “Target” field, enter the server hostname and hit Quick Connect. Uncheck the box about favorite targets as you don’t want to auto reconnect. (Second time around, just click “Connect” on the selected urbackup-restore-target)
This should then open up the drive as a new drive attached to your PC. You can copy whatever files off of it you need. Not sure if you can edit it - you shouldn’t even if you can, but it shouldn’t matter if you do.

When done, Hit “Disconnect” in the iSCSI Initiator, then back in the web UI, click “Clean up last restore”. This will delete the iscsi extent and clean up the temporary snapshot clone.

Hope this is helpful!