Skip to content

Conversation

ppawlowski
Copy link
Contributor

Description

This pull request adds a free disk space validation to the Device Agent Installer pre-install check.
As a result, Installer will verify if the installation and temporary directories have enough disk space to perform an installation.

To validate this solution:

On Windows

Fill up a C:\ disk drive by creating large file and leaving ~200M of free disk space.
Following command will create a 10G file on c: drive:

fsutil file createnew C:\largefile.dat 10737418240

Run the installer afterwards - it should fail if there is less than 512M of free disk space

Cleanup:

del C:\largefile.dat

On Linux

  • create a 128MB file
  • format file with ext4 filesystem
  • mount file
truncate -s 128M /tmp/loopback.img
mkfs.ext4 /tmp/loopback.img
mkdir /mnt/smallfs
mount -o loop /tmp/loopback.img /mnt/smallfs
  • use the installer to install the device agent into the mounted filesystem:
./flowfuse-device-agent-installer --otc come-code-here --dir /mnt/smallfs/flowfuse-agent
  • Set TMPDIR to the mounted filesystem:
export TMPDIR=/mnt/smallfs
  • run the installer again, without the --dir flag to validate TMP disk space validation.
/flowfuse-device-agent-installer --otc come-code-here 

Cleanup:

sudo umount /mnt/smallfs
rm /tmp/loopback.img
rm -rf /mnt/smallfs
unset TMPDIR

Related Issue(s)

Closes #494

Checklist

  • I have read the contribution guidelines
  • Suitable unit/system level tests have been added and they pass
  • Documentation has been updated
    • Upgrade instructions
    • Configuration details
    • Concepts
  • Changes flowforge.yml?
    • Issue/PR raised on FlowFuse/helm to update ConfigMap Template
    • Issue/PR raised on FlowFuse/CloudProject to update values for Staging/Production
  • Link to Changelog Entry PR, or note why one is not needed.

Labels

  • Includes a DB migration? -> add the area:migration label

@Steve-Mcl
Copy link
Contributor

@ppawlowski did you notice conflicts?

@ppawlowski
Copy link
Contributor Author

@ppawlowski did you notice conflicts?

Fixed

Copy link
Contributor

@hardillb hardillb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ERROR] Disk space check failed: insufficient disk space in install directory (/mnt/smallfs/dev): need at least 524288000 bytes, available 99553280 bytes

only niggle and not worth stopping shipping would be to convert bytes to megabytes as it's easier to read.

@ppawlowski
Copy link
Contributor Author

ppawlowski commented Sep 22, 2025

@Steve-Mcl can you take a look at this PR, please?

@Steve-Mcl Steve-Mcl merged commit e8afdc3 into main Sep 22, 2025
7 checks passed
@Steve-Mcl Steve-Mcl deleted the feat-validate-disk-space branch September 22, 2025 11:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Installer: validate available disk space before proceeding with installation

3 participants