# Incus ZFS Block Storage Pools

**URL:** https://discussion.scottibyte.com/t/incus-zfs-block-storage-pools/544
**Category:** Uncategorized
**Created:** [February 14, 2025, 11:20pm UTC](https://discussion.scottibyte.com/t/incus-zfs-block-storage-pools/544 "2025-02-14T23:20:41Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![scott](https://discussion.scottibyte.com/letter_avatar_proxy/v4/letter/s/3e96dc/32.png) [@scott](https://discussion.scottibyte.com/u/scott)
#### Post date: [February 14, 2025, 11:20pm UTC](https://discussion.scottibyte.com/t/incus-zfs-block-storage-pools/544/1 "2025-02-14T23:20:41Z")

</div>

“[Incus Containers Step by Step](https://www.youtube.com/watch?v=ULPuU9aKyoU)” covered creating the default storage pool as a virtual file system. This tutorial shows how to migrate a block oriented zfs file system to a larger disk.

The “incus admin init” command we used in “Incus containers Step by Step” did not use a dedicated disk for the default storage pool. If you have a dedicated empty disk for your zfs storage pool, it is a higher performance alternate instead of the virtual file system.

“incus admin init” is only executed when building a new incus server. Here’s how we created the virtual default zfs pool originally.

 ![image](https://discussion.scottibyte.com/uploads/default/original/2X/2/2dfbe5c65a4ce8854b5c0104a38e8774e0f25c35.jpeg)

I created the virtual storage pool for simplicity. If you were creating a new incus server and you had a spare disk that you could dedicate to a storage pool you would proceed as follows:

 ![image](https://discussion.scottibyte.com/uploads/default/original/2X/c/c65b66700a695c9fde7d6a39dfe8a97393e6881a.jpeg)

An example disk might be:

```auto
/dev/sda

```

Just understand that the disk would be overwritten and dedicated to the zfs file pool.

The user I was helping had an existing 500GB NVMe device named /dev/nvme1n1 and it contained a zfs file system for the incus default storage pool. Our goal was to migrate everything on that drive to /dev/nvme0n1 which is a 2TB NVMe device.

 ![image](https://discussion.scottibyte.com/uploads/default/original/2X/6/630a2ff48b9e599cb954e33c60fdcc5cf5e7a175.jpeg)

The existing system has two zfs storage pools (both on dedicated disks) and one dir storage pool (using the native ext-4 file system).

 ![image](https://discussion.scottibyte.com/uploads/default/original/2X/b/bdb68d6b0d11ce09050d1255724dba44b36f9c5f.jpeg)

Samsung-1TB is a zfs pool on /dev/sde. default is a zfs pool on /dev/nvme1n1. dirpool is a native file system pool. Again, our goal is to migrate the default pool from /dev/nvme1n1 to /dev/nvme0n1.

Stop all of your containers.

```auto
incus stop --all

```

Stop the incus server.

```auto
sudo systemctl stop incus

```

This may result in a warning. Don’t worry about that.

 ![image](https://discussion.scottibyte.com/uploads/default/original/2X/4/45a7524410c19667f30dd222d6ddd632603c524e.jpeg)

Create a zfs pool on the new disk (this is irreversible). Make sure you are using the correct disk!

```auto
sudo zpool create -f default_new /dev/nvme0n1

```

Take a snapshot of your current default storage pool disk.

```auto
sudo zfs snapshot -r default@migration 

```

Copy the snapshot to the new zfs pool on the new device.

```auto
sudo zfs send -Rv default@migration | sudo zfs recv -F default_new

```

 ![image](https://discussion.scottibyte.com/uploads/default/original/2X/4/4c919d1b7710104691d82cca4870ebec2d2fa272.jpeg)

This migration might go on for several minutes depending on how many containers, snapshots, and profiles are in your storage pool.

Now we need to update incus to use the new storage pool.

First, unmount the old pool.

```auto
sudo zpool export default

```

Unmount the new pool.

```auto
sudo zpool export default_new

```

Now import the new pool and name it “default”.

```auto
sudo zpool import default_new default

```

Now restart incus:

```auto
sudo systemctl restart incus

```

I can see that the default pool is now on the larger disk.

```auto
sudo zpool list

```

 ![image](https://discussion.scottibyte.com/uploads/default/original/2X/0/08951b3316e526ceaef4cff9d2167279f73f9348.jpeg)

You should now see that all your containers are running.

```auto
incus list

```

 ![image](https://discussion.scottibyte.com/uploads/default/original/2X/e/eae7eb5d8af93e2665671cda7a7cb14b4c0515d7.jpeg)

At this point, you are done. However, you can re-purpose the old drive and make it a new incus storage pool if you like.

Wipe out the old drive. Again, be very careful that you are addressing the correct drive because this will destroy the contents of the drive you specify.

```auto
sudo wipefs -a /dev/nvme1n1
sudo sgdisk --zap-all /dev/nvme1n1 

```

Create a new zfs pool on the same drive we wiped.

```auto
sudo zpool create -f smallpool /dev/nvme1n1

```

Create an incus pool to use this new zfs pool.

```auto
incus storage create smallpool zfs source=smallpool

```

 ![image](https://discussion.scottibyte.com/uploads/default/original/2X/d/d51500861a5cfff7c3b170ffecff5f226ed3c866.jpeg)
