Incorrect volume sizes, out of space

I have a container instance for running postgresql, and the database data is stored on a custom volume. Today my database crashed as it thought it was out of available disk space, which makes no sense?

incus storage volume info dpool custom/volume_postgresql17
Name: volume_postgresql17
Type: custom
Content type: filesystem
Usage: 9.73GiB
Created: 2025/11/20 10:54 CET

Yet, if I check this volume from inside the container:

df -h
Filesystem                                               Size  Used Avail Use% Mounted on
dpool/incus/containers/postgresql15                      707G  2.9G  704G   1% /
none                                                     3.2G  4.0K  3.2G   1% /dev
devtmpfs                                                 3.2G     0  3.2G   0% /dev/zfs
efivarfs                                                 128K   39K   85K  32% /sys/firmware/efi/efivars
tmpfs                                                    100K     0  100K   0% /dev/incus
bulk/incus/custom/default_volume_bulk_postgresql_backup   50G  182M   50G   1% /var/backup/postgresql
dpool/incus/custom/default_volume_postgresql17            11G  471M   11G   5% /var/lib/postgresql/17
tmpfs                                                    100K     0  100K   0% /dev/.incus-mounts
tmpfs                                                     32G  1.1M   32G   1% /dev/shm
tmpfs                                                     16G  104K   16G   1% /run
tmpfs                                                     32G  1.2M   32G   1% /run/wrappers

But the volume is 20 GiB:

zfs get quota dpool/incus/custom/default_volume_postgresql17
NAME                                            PROPERTY  VALUE  SOURCE
dpool/incus/custom/default_volume_postgresql17  quota     20G    local

Any ideas why?

I’m using terraform to create the container, the volumes et c but no changes there until I increased the volume size tonight.

How does your pool configuration look like?

Any kind of ZRaid won’t be able to use the RAW disk space reported as certain amount of space is reserved for checksums etc. 17GB is about 85% from 20GB which seems about right for a ZRaid2 pool. At least that is what my ZRaid2 pool on 6 disks uses / reports.

Another data point is that you should never go over 80% of capacity usage to leave space for all the ZFS data optimizations required for optimum speed.

This is what I learned using ZFS best practices by reading docs / block posts etc.

It’s just a single NVMe drive, no mirror, zraid or such. The database is also approx 500 MB, not anywhere near the sizes reported. :frowning:

zpool status dpool
  pool: dpool
 state: ONLINE
  scan: scrub repaired 0B in 00:07:25 with 0 errors on Mon Dec  1 00:52:44 2025
config:

        NAME                                                                                 STATE     READ WRITE CKSUM
        dpool                                                                                ONLINE       0     0     0
          nvme-nvme.c0a9-323333324538364145443545-43543130303050335053534438-00000001-part1  ONLINE       0     0     0

errors: No known data errors

And the db size:

[root@postgresql15:/var/lib/postgresql]# du -hsc 17/
485M    17/
485M    total

Can you show zfs list -t all as well as zfs get all dpool/incus/custom/default_volume_postgresql17?

If the pool is getting pretty full, the total size will shrink, so an almost full pool would be my first guess. But there could also be some other ZFS property at play here on this dataset.

I don’t think it’s the pool being full, but walking to work this morning I realized I hadn’t checked if snapshots was the issue…

I should also add I have three pools, rpool for my root file system, bulk for my HDD pool and dpool which I run incus on. I’m using sanoid for snapshots (which are sent to the bulk pool).

Anyways, some data:

zfs list dpool
NAME    USED  AVAIL  REFER  MOUNTPOINT
dpool   212G   704G    96K  /nvme

Snapshots, I’ve trimmed this a bit (otherwise it was 25k lines! grep -Ev “^(bulk|rpool)” zfs_list_all): gist:a2bea4ccfdf86a2d27f90bfe9f66df0d · GitHub

Finally, zfs list -t all

NAME                                            PROPERTY              VALUE                            SOURCE
dpool/incus/custom/default_volume_postgresql17  type                  filesystem                       -
dpool/incus/custom/default_volume_postgresql17  creation              Thu Nov 20 10:54 2025            -
dpool/incus/custom/default_volume_postgresql17  used                  9.81G                            -
dpool/incus/custom/default_volume_postgresql17  available             10.2G                            -
dpool/incus/custom/default_volume_postgresql17  referenced            492M                             -
dpool/incus/custom/default_volume_postgresql17  compressratio         1.67x                            -
dpool/incus/custom/default_volume_postgresql17  mounted               yes                              -
dpool/incus/custom/default_volume_postgresql17  quota                 20G                              local
dpool/incus/custom/default_volume_postgresql17  reservation           none                             local
dpool/incus/custom/default_volume_postgresql17  recordsize            128K                             default
dpool/incus/custom/default_volume_postgresql17  mountpoint            legacy                           local
dpool/incus/custom/default_volume_postgresql17  sharenfs              off                              default
dpool/incus/custom/default_volume_postgresql17  checksum              on                               default
dpool/incus/custom/default_volume_postgresql17  compression           lz4                              inherited from dpool
dpool/incus/custom/default_volume_postgresql17  atime                 on                               default
dpool/incus/custom/default_volume_postgresql17  devices               on                               default
dpool/incus/custom/default_volume_postgresql17  exec                  on                               default
dpool/incus/custom/default_volume_postgresql17  setuid                on                               default
dpool/incus/custom/default_volume_postgresql17  readonly              off                              default
dpool/incus/custom/default_volume_postgresql17  zoned                 off                              default
dpool/incus/custom/default_volume_postgresql17  snapdir               hidden                           default
dpool/incus/custom/default_volume_postgresql17  aclmode               discard                          default
dpool/incus/custom/default_volume_postgresql17  aclinherit            restricted                       default
dpool/incus/custom/default_volume_postgresql17  createtxg             10382638                         -
dpool/incus/custom/default_volume_postgresql17  canmount              noauto                           local
dpool/incus/custom/default_volume_postgresql17  xattr                 on                               inherited from dpool
dpool/incus/custom/default_volume_postgresql17  copies                1                                default
dpool/incus/custom/default_volume_postgresql17  version               5                                -
dpool/incus/custom/default_volume_postgresql17  utf8only              on                               -
dpool/incus/custom/default_volume_postgresql17  normalization         formD                            -
dpool/incus/custom/default_volume_postgresql17  casesensitivity       sensitive                        -
dpool/incus/custom/default_volume_postgresql17  vscan                 off                              default
dpool/incus/custom/default_volume_postgresql17  nbmand                off                              default
dpool/incus/custom/default_volume_postgresql17  sharesmb              off                              default
dpool/incus/custom/default_volume_postgresql17  refquota              none                             local
dpool/incus/custom/default_volume_postgresql17  refreservation        none                             local
dpool/incus/custom/default_volume_postgresql17  guid                  2126658253175695278              -
dpool/incus/custom/default_volume_postgresql17  primarycache          all                              default
dpool/incus/custom/default_volume_postgresql17  secondarycache        all                              default
dpool/incus/custom/default_volume_postgresql17  usedbysnapshots       9.33G                            -
dpool/incus/custom/default_volume_postgresql17  usedbydataset         492M                             -
dpool/incus/custom/default_volume_postgresql17  usedbychildren        0B                               -
dpool/incus/custom/default_volume_postgresql17  usedbyrefreservation  0B                               -
dpool/incus/custom/default_volume_postgresql17  logbias               latency                          default
dpool/incus/custom/default_volume_postgresql17  objsetid              119241                           -
dpool/incus/custom/default_volume_postgresql17  dedup                 off                              default
dpool/incus/custom/default_volume_postgresql17  mlslabel              none                             default
dpool/incus/custom/default_volume_postgresql17  sync                  standard                         default
dpool/incus/custom/default_volume_postgresql17  dnodesize             auto                             inherited from dpool
dpool/incus/custom/default_volume_postgresql17  refcompressratio      1.81x                            -
dpool/incus/custom/default_volume_postgresql17  written               6.65M                            -
dpool/incus/custom/default_volume_postgresql17  logicalused           16.4G                            -
dpool/incus/custom/default_volume_postgresql17  logicalreferenced     887M                             -
dpool/incus/custom/default_volume_postgresql17  volmode               default                          default
dpool/incus/custom/default_volume_postgresql17  filesystem_limit      none                             default
dpool/incus/custom/default_volume_postgresql17  snapshot_limit        none                             default
dpool/incus/custom/default_volume_postgresql17  filesystem_count      none                             default
dpool/incus/custom/default_volume_postgresql17  snapshot_count        none                             default
dpool/incus/custom/default_volume_postgresql17  snapdev               hidden                           default
dpool/incus/custom/default_volume_postgresql17  acltype               posix                            inherited from dpool
dpool/incus/custom/default_volume_postgresql17  context               none                             default
dpool/incus/custom/default_volume_postgresql17  fscontext             none                             default
dpool/incus/custom/default_volume_postgresql17  defcontext            none                             default
dpool/incus/custom/default_volume_postgresql17  rootcontext           none                             default
dpool/incus/custom/default_volume_postgresql17  relatime              on                               inherited from dpool
dpool/incus/custom/default_volume_postgresql17  redundant_metadata    all                              default
dpool/incus/custom/default_volume_postgresql17  overlay               on                               default
dpool/incus/custom/default_volume_postgresql17  encryption            off                              default
dpool/incus/custom/default_volume_postgresql17  keylocation           none                             default
dpool/incus/custom/default_volume_postgresql17  keyformat             none                             default
dpool/incus/custom/default_volume_postgresql17  pbkdf2iters           0                                default
dpool/incus/custom/default_volume_postgresql17  special_small_blocks  0                                default
dpool/incus/custom/default_volume_postgresql17  snapshots_changed     Wed Dec 17 20:00:50 2025         -
dpool/incus/custom/default_volume_postgresql17  prefetch              all                              default
dpool/incus/custom/default_volume_postgresql17  direct                standard                         default
dpool/incus/custom/default_volume_postgresql17  longname              off                              default
dpool/incus/custom/default_volume_postgresql17  nixos:shutdown-time   Fri Dec  5 11:25:10 AM CET 2025  inherited from dpool

So yeah, ZFS agrees.

Most likely it’s just snapshot handling, so your quota is 20GiB but the snapshots are holding onto 9.8GiB of old data which then causes this behavior.

I have somewhat a similar issue, but I think snapshots should not be the cause of my problem.

I’m using one pool with the TrueNAS driver with a single HDD. I have created two volumes to store my media content. However, the size of the volumes seems to be capped way below the actual limit of the pool.

Screenshot_2025-12-17_23-32-47

I tried to change the size parameter in the different volumes, but it doesn’t seem to impact that much

Am I missing something here?

Is that only affecting that existing volume or also new volumes created with a larger size from the beginning?

With TrueNAS, the volumes are created on the remote TrueNAS storage appliance and then exported to Incus over iSCSI. I don’t recall how the size reporting works though, whether it’s what Incus sees when accessing the volume over iSCSI or if it’s the size reported by the TrueNAS API instead.

I just tried, and here are the conclusions:

  • If I do incus storage volume create truenas-storage test-incus and then increase the size by editing this volume. This update is not reflected in the instance even after a restart.
  • However, if I do incus storage volume create truenas-storage test-incus2 size=2000GiB then the instance sees 1.9Tb available.

Is this the expected behavior?

No, it’s not, I’d expect a storage driver like TrueNAS to either support the live size change or to fail with an error, not pretend that it’s been done and then ignoring it.

Feel free to file a bug about it: Sign in to GitHub · GitHub

Hi, Are there already any news on this? I have the same issue.

Hello, this issue has been fixed: Truenas Driver - Inconsistent Disk Size Update · Issue #2776 · lxc/incus · GitHub

I suppose this will arrive in the next stable release.

Since I couldn’t find an open issue on this and I still have the issue on incus version 6.20, I opened a new issue.

In case the is already fixed for the next stable version, please close the issue.