Recently I needed to make some more diskspace available to my proxmox system. Specifically to increase the space available on one container.

The proxmox storage is lvm based, on an iSCSI block device (Synology NAS).

I had to use a few different resources to figure out how to increase the space, this is my reminder for how to do it next time.

First step is to make the LUN bigger. This is trivial, just open the GUI on the NAS and increase the size. Literally type a bigger number and press Save. Why can’t everything be this easy?

Synology DSM iSCSI LUN editing
Synology DSM iSCSI LUN editing

lsblk shows the new size immediately, but the proxmox GUI will still show the old size. Below you can see I increased the size to 2TB (the iSCSI LUN is /dev/sdb):

root@proxmox:~# lsblk
NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
sda         8:0      0 476.9G  0 disk
sdb         8:16     0     2T  0 disk

(block device tree trimmed for clarity)

We can use the lvm pvresize tool to let proxmox “see” the rest of the storage:

pvresize /dev/sdb
  Physical volume "/dev/sdb" changed
  1 physical volume(s) resized or updated / 0 physical volume(s) not resized

Now we can resize the VM disk in question. Proxmox provides a handly tool to do all the things needed, including running the appropriate command to resize the filesystem:

root@proxmox:~# pct resize 10011 rootfs 800G

The output shows some error messages but as far as I can tell they are harmless side-effects of trying to reach iSCSI over different IPv6 interfaces.

iscsiadm: Could not login to [iface: default, target: iqn.2000-01.com.synology.hostname.Target-1.af872d0b8b, portal: fe80::838:1234:fe8b:9123,3260].
iscsiadm: initiator reported error (8 - connection timed out)
iscsiadm: Could not login to [iface: default, target: iqn.2000-01.com.synology.hostname.Target-1.af872d0b8b, portal: 2400:1234:4567:43:332:32ff:fe8b:a30b,3260].

The resize part is fine:

resize2fs 1.47.0 (5-Feb-2023)
Filesystem at /dev/sy-lvm/vm-10011-disk-0 is mounted on /tmp; on-line resizing required
old_desc_blocks = 16, new_desc_blocks = 100
The filesystem on /dev/sy-lvm/vm-10011-disk-0 is now 209715200 (4k) blocks long.

And our storage is expanded! Here is the proxmox graph of the storage:

Proxmox graph of storage capacity
Proxmox graph of storage capacity

And my grafana graph of the view of “disk free” from within the VM:

Grafana graph showing disk free
Grafana graph showing disk free

I rebooted once (before I learned about pvresize) but I believe it is unnecessary and all of this can be done online.