1

I have a Rasperri Pi 5 and I need to increase swap memory to 4GB to self-host PhotoPrism, as explained in their guide.

Details about my operating system:

PRETTY_NAME="Debian GNU/Linux 13 (trixie)" NAME="Debian GNU/Linux" VERSION_ID="13" VERSION="13 (trixie)" VERSION_CODENAME=trixie DEBIAN_VERSION_FULL=13.1 ID=debian 

I wanted to use zram generator for this task.

First of all, I made sure that zram generator is installed by running:

sudo apt install systemd-zram-generator 

Then, I have followed their instructions for the configuration: I have ONLY one config file in this location: /etc/systemd/zram-generator.conf.

The content of the file is:

[zram0] zram-size = 4096 swap-priority = 100 

No matter what I do, but after each reboot of the Raspberri Pi, the swapon --show command displays this:

NAME TYPE SIZE USED PRIO /dev/zram0 partition 2G 0B 100 

which means that the swap memory is just 2GB.

How can I change the swap memory permanently to have 4GB?

1
  • I edit the question with these details. I have trixie 13.1 Commented Nov 22 at 8:06

1 Answer 1

0

On Trixie systemd-zram-generator is installed by default (as a dependancy of rpi-swap) and the swap is controlled by /etc/rpi/swap.conf so editing this should enable a larger size. (The default is MaxSizeMiB=2048).

1
  • Great! That was the right thing to do check! I have executed man 5 swap.conf to read instructions on how rpi-swap works. It is suggested to create a drop-in configuration file. So I have made /etc/rpi/swap.conf.d/set-swap-to-4GB.conf in which, to be sure, I have set both MaxSizeMiB and FixedSizeMiB to 4096. Now swap is set to 4GB even after reboot :) Commented Nov 22 at 8:44

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.