According to `man swap.conf`, and this post you should be able to create /etc/rpi/swap.conf.d/myswap.conf that configures zram to be sized as you want.
I haven't tried this, but this could be a good starting point.Later on in the man page for swap.conf it also says:Please update us all with the magic incantation that works for you.
I haven't tried this, but this could be a good starting point.
Code:
[Zram]FixedSizeMiB=0MaxSizeMiB=0Code:
Example 2. Disabling swap entirely To disable all swap functionality, create a drop-in configuration file: sudo mkdir -p /etc/rpi/swap.conf.d/ sudo tee /etc/rpi/swap.conf.d/90-disable-swap.conf > /dev/null <<EOF [Main] Mechanism=none EOF This will disable all swap mechanisms and remove any existing swap file to free up disk space. This is useful for systems with abundant RAM where swap is not required.Statistics: Posted by bls — Sun Nov 16, 2025 3:29 pm