fix: zram should have high priority so it is prefered over any other swap, also use a more realistic size for rpi zero 2 w

This commit is contained in:
frederik
2024-03-30 17:30:27 +01:00
parent cb2969fd39
commit 4f38aabcea
+2 -2
View File
@@ -5,7 +5,7 @@ echo 'zram' | sudo tee /etc/modules-load.d/zram.conf
sudo touch /etc/modprobe.d/zram.conf sudo touch /etc/modprobe.d/zram.conf
echo 'options zram num_devices=1' | sudo tee /etc/modprobe.d/zram.conf echo 'options zram num_devices=1' | sudo tee /etc/modprobe.d/zram.conf
sudo touch /etc/udev/rules.d/99-zram.rules sudo touch /etc/udev/rules.d/99-zram.rules
echo 'KERNEL=="zram0", ATTR{disksize}="2G",TAG+="systemd"' \ echo 'KERNEL=="zram0", ATTR{comp_algorithm}="zstd", ATTR{disksize}="500M", TAG+="systemd"' \
| sudo tee /etc/udev/rules.d/99-zram.rules | sudo tee /etc/udev/rules.d/99-zram.rules
sudo touch /etc/systemd/system/zram.service sudo touch /etc/systemd/system/zram.service
echo "Installing zram.service" echo "Installing zram.service"
@@ -17,7 +17,7 @@ After=multi-user.target
Type=oneshot Type=oneshot
RemainAfterExit=true RemainAfterExit=true
ExecStartPre=/sbin/mkswap /dev/zram0 ExecStartPre=/sbin/mkswap /dev/zram0
ExecStart=/sbin/swapon /dev/zram0 ExecStart=/sbin/swapon -p 15 /dev/zram0
ExecStop=/sbin/swapoff /dev/zram0 ExecStop=/sbin/swapoff /dev/zram0
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target