Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 3531

Raspberry Pi OS • Re: Trixie and Swap File.

$
0
0
It seems the default does vary on what you have and what you install
That's correct, it scales with 'RamMultiplier' (which is 1 by default). Size is constrained by 'MaxSizeMiB' (2048 by default) and any swap/backing file is constrained by available disk space (MaxDiskPercent (50 by default)).
What are the commands to disable swap and re-enable it, within a logged-in session and persistent across reboots ?
To temporarily disable/re-enable you'd use systemd (example given below). If you wish to make configuration changes then a restart will be required.

Code:

# View which swap units are runningpi@roliver-trixie-img:~ $ systemctl list-units --quiet --type=swap  dev-zram0.swap loaded active active rpi-swap managed swap device (zram+file)# Stop the swap unitpi@roliver-trixie-img:~ $ sudo systemctl stop dev-zram0.swap# Verify that that swap unit is no longer runningpi@roliver-trixie-img:~ $ systemctl list-units --quiet --type=swap# Start swap unit againpi@roliver-trixie-img:~ $ sudo systemctl start dev-zram0.swap# Verify that it's runningpi@roliver-trixie-img:~ $ systemctl list-units --quiet --type=swap  dev-zram0.swap loaded active active rpi-swap managed swap device (zram+file)
To disable swap all together, create /etc/rpi/swap.conf.d/99-disable-swap.conf with the contents:

Code:

[Main]Mechanism=none

Statistics: Posted by roliver — Thu Oct 09, 2025 8:57 am



Viewing all articles
Browse latest Browse all 3531

Trending Articles