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:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user