This time I show how to leverage Incus block oriented custom volumes for applications both inside and outside Incus. Understanding how to leverage Home Lab Intrastructure tools improves your problem solving skills.
In December of 2024, I presented Custom Rescuezilla Bootable USB where I showed how to create a Rescuezilla bootable disk with persistent storage. In June 2025, I presented Home Assistant OS in Incus 101 where I showed how to create an Incus VM for a Home Assistant OS which is an appliance image.
There is an increasing number of pre-installed appliance images meant to be simply imaged to devices. Incus can make use of these appliance images and Incus also has tools to manipulate them.
Incus virtual machines are well suited to work with block oriented images and this presentation shows one example with commands useful in operating with other images. I am using Rescuezilla as an example once again because it is an awesome tool to image your hard drives whether physical or virtual.
Most people download the Rescuezilla ISO and write it to a bootable USB using a tool like Balena Etcher or Rufus if you are using Windows. I previously demonstrated how to create an image for Rescuezilla with persistent storage and I used it to add iSCSI support to Rescuezilla. The problem was that my Rescuezilla .img file was 15GB whereas the ISO was a mere 1.4GB.
Rather than recreate the disk from scratch, I decided to leverage custom block storage disks in my Incus ZFS virtual storage pool.
Since Incus custom volumes are created in your Storage Pool, make sure you have enough free space to accomodate your work by running the following command on your Incus server:
sudo zpool list
At the time of this presentation, I am running Incus 6.14.
incus version
To have all of the tools to make disk conversion with Incus easier, install the QEMU Virtual Machine manager on your Incus server (at the server level, not in a container).
sudo apt install qemu-kvm virt-manager libvirt-daemon-system virtinst libvirt-clients bridge-utils -y
You also need the incus-extra package installed in order to use the migration tool.
sudo apt install incus-extra
Unlike the Home Assistant video, we are not creating a virtual machine from the image that I created in the Rescuezilla video. Instead, we are importing the image we created (not the ISO) into an Incus custom volume. Note this time I used option 4 in the incus-migrate tool to create a custom volume.
Rather than being a specific set of instructions, I am teaching you the tools through examples. Here’s how i used the incus-migrate tool to import my image:
I listed the volume I just imported.
incus storage volume list default myvolume
I created an incus virtual machine without starting it to use as a temporary tool to work with the disk image. Note that Ubuntu 24.04 requires a minimum of 4GB of memory and 2 virtual CPUs.
incus init images:ubuntu/24.04/desktop --vm Test -c limits.memory=4GiB -c limits.cpu=2
Connect the volume I imported with incus-migrate to the new virtual machine.
incus config device add Test myvolume disk pool=default source=myvolume
Since my goal is to make my Rescuezilla bootable disk smaller, i need to create another custom volume in the incus storage tool of the desired size. I decided that the new image would be 5GB and I creatively named it “myvolume-shrunk”:
incus storage volume create default myvolume-shrunk --type=block size=5GiB
I also want to attach this new empty volume to my incus virtual machine.
incus config device add Test myvolume-shrunk disk pool=default source=myvolume-shrunk
In the tutorial, I started the VM and connected to the GUI console. Since my incus VM is on a remote machine (mondo) and I have an incus trust to it, I moved back to my desktop (mondo-2) and ran the command.
incus start mondo:Test --console=vga
This opens the virtual machine viewer and starts to boot the VM.
In the tutorial, created myself a user account and added it to the sudo group and I logged out and back into my new user account and I deleted the default ubuntu username for security reasons.
I did an “lsblk” to show the “sda” disk which is the system disk for the VM, the “sdb” disk which is the 15GB Rescuezilla image that I imported into an incus custom volume, and “sdc” which is the 5GB incus custom volume that I have not yet configured.
Since we are working on a GUI desktop, let’s install the gparted tool to make things easier and lets install partclone as well which is a tool to copy partitions.
sudo apt install gparted partclone -y
Next, I launched gparted from the app drawer and selected the “/dev/sdb” disk which is the 15GB disk we imported via incus-migrate.
Notice above the sdb1 is the Rescuezilla partition and sdb2 is the persistent partition. We are going to resize the persistent partition down to just slightly larger than its currently used space to make it much smaller, but still offer us some headroom.
Once I click the Resize and then the Apply buttons, the resizing takes place.
Once the partition is resized, you will notice that there is a large chunk of unallocated space. If we were to just copy this resulting disk, it would still consume the full 15GB despite the smaller partition.
Heading back to the terminal, you will note that sdb1 & sdb2 together use less than 5GB. However, sdb is still 14.3GB.
To overcome this, we will be preparing the sdc disk and then copying the sdb1 and sdb2 partitions to it.
Create the partition table:
sudo parted /dev/sdc --script mklabel gpt
Take a look at the existing partition table on sdb.
sudo parted /dev/sdb print
Create a fat32 partition on sdc for the sdb1 partition.
sudo parted /dev/sdc --script mkpart fat32 1MiB 2520MiB
Likewise, create an ext3 partition on sdc for the sdb2 partition:
sudo parted /dev/sdc --script mkpart ext3 2520MiB 4788MiB
Show the resulting disk.
sudo parted /dev/sdc print
Use partclone to copy the Rescuezilla partition.
sudo partclone.vfat -C -b -s /dev/sdb1 -o /dev/sdc1
Use partclone to copy the persistent storage partition.
sudo partclone.ext3 -C -b -s /dev/sdb2 -o /dev/sdc2
The resulting sdc disk in gparted is pictured below.
At this point, I powered the virtual machine off by shutting it down.
Once the VM is shutdown, I used my trust with the incus server to perform additional commands. I started by removing the attachment of the newly created 5GB drive from the VM.
incus config device remove mondo:Test myvolume-shrunk
I re-add the volume back to the VM with a boot priority which will override the Ubuntu system disk on the VM causing our new rescuezilla disk to boot up.
incus config device add mondo:Test rescue-disk disk pool=default source=myvolume-shrunk boot.priority=10
Now when I start the VM, Rescuezilla will boot.
incus start mondo:Test --console=vga
Since the test worked, I shutdown the Virtual Machine again and I moved over to a terminal on my incus server. On the incus server, I disconnected the newly tested 5GB disk from the virtual machine:
incus config device remove Test rescue-disk
To list all of the storage volumes on the incus server.
incus storage volume list default
To get a copy of the new disk image outside of the zfs storage pool in incus, we must first example the volume mode:
sudo zfs get volmode default/custom/default_myvolume-shrunk
To access the data, we must convert the volume mode to development.
sudo zfs set volmode=dev default/custom/default_myvolume-shrunk
We can now see where it is stored:
ls -l /dev/zvol/default/custom/default_myvolume-shrunk
To extract a copy of the disk image from the zfs pool:
sudo dd if=/dev/zvol/default/custom/default_myvolume-shrunk of=Rescuezilla-shrunk.img bs=4M status=progress
List the disk image.
ls -alh
Notice that the resulting and tested image is 5GB in size. As shown in the video, I wanted a smaller Rescuezilla image with persistent data so I could use it with my JetKVM device and it works great and most importantly, it fits on the limited JetKVM storage space.
Be sure to change your volume mode for your custom volume back to none from dev if you are going to keep using it in incus.
sudo zfs set volmode=none default/custom/default_myvolume-shrunk
If you want to delete custom volumes from your storage pool, you have to either disconnect them from the VM or delete the VM before you delete the custom storage volumes.
incus stop Test
incus delete Test
Then you can delete the volumes:
incus storage volume delete default myvolume
incus storage volume delete default myvolume-shrunk
Head on over to the chat server if you have any unique applications for incus custom volumes and let me know what you are doing.