Skip to content

Growing a Volume

flexblock update --device-size makes a volume larger. On Linux 6.16 or newer it grows the device while the daemon is serving and the filesystem is mounted; on older kernels you stop the daemon first.

--device-size accepts an absolute size, a delta, or max:

Terminal window
sudo flexblock update /dev/nvme1n1p1 --device-size +1T # grow by a delta
sudo flexblock update /dev/nvme1n1p1 --device-size 4T # or to an absolute size
sudo flexblock update /dev/nvme1n1p1 --device-size max # or to the licensed size

Add --dry-run to print the old and new values without changing anything.

With the daemon serving, update passes the new size to the daemon over its control socket. The daemon records the new size in object storage, then on the cache device, then resizes the live block device. Then you grow the filesystem while it stays mounted.

Live resizing needs Linux 6.16 (UBLK_U_CMD_UPDATE_SIZE). The online resize row in the start banner says whether the host has it.

  1. Grow the volume.

    Terminal window
    sudo flexblock update /dev/nvme1n1p1 --device-size +1T
  2. Grow the filesystem.

    Terminal window
    sudo xfs_growfs /mnt/analytics # XFS
    sudo resize2fs /dev/ublkb0 # ext4

On an older kernel, or with no daemon running, the same command works offline.

  1. Stop cleanly: unmount, then stop the daemon (or sudo systemctl stop flexblock@nvme1n1p1.service). See Stopping Cleanly.

  2. Grow the volume.

    Terminal window
    sudo flexblock update /dev/nvme1n1p1 --device-size 4T
  3. Start the daemon again and mount the filesystem.

  4. Grow the filesystem with xfs_growfs /mnt/analytics (XFS) or resize2fs /dev/ublkb0 (ext4).

  • A failed write to object storage changes nothing locally. Run the command again.
  • A crash between the steps leaves object storage recording the larger size. start reports it, and running the same update again finishes the job.
  • If update reports the device was only partly resized (exit code 4), follow the step the message names: run update --device-size again, or restart the daemon.
  • If update reports the kernel cannot resize a live device (exit code 10), or exits busy because the daemon did not answer on its control socket, grow offline instead.