Hello Friends,
I tried enabling ZRam on my debian 12.8 KDE 64 bits desktop computer (Dell Otiplex op3020 CFF). Installation was succesful. I cooul see zramswap service status as active. But on reboot, I see a message - [FAILED] - Failed to start zramswap.service - Linux zramswap setup. I am not sure what is causing this. On login, I tried to check the service status. Here is the output -
I had refered to documentation available at https://wiki.debian.org/ZRam and some other online material to configure ZRam. Here is the bash script I had used to install and configure -
I am not sure if I missed something important in the above script. I remember seeing a error while executing the command - insserv zramswap in above script. Here is the error message when I reproduced it from konsole -
Any advise to fix this issue would be very helpful. Thanks in advance.
Regards
Ganesh
I tried enabling ZRam on my debian 12.8 KDE 64 bits desktop computer (Dell Otiplex op3020 CFF). Installation was succesful. I cooul see zramswap service status as active. But on reboot, I see a message - [FAILED] - Failed to start zramswap.service - Linux zramswap setup. I am not sure what is causing this. On login, I tried to check the service status. Here is the output -
Code:
ganeshp@aga-op3020:~$ systemctl status zramswap.service× zramswap.service - Linux zramswap setup Loaded: loaded (/lib/systemd/system/zramswap.service; enabled; preset: enabled) Active: failed (Result: exit-code) since Sun 2024-12-08 11:28:14 IST; 5min ago Docs: man:zramswap(8) Process: 866 ExecStart=/usr/sbin/zramswap start (code=exited, status=1/FAILURE) Main PID: 866 (code=exited, status=1/FAILURE) CPU: 9msDec 08 11:28:14 aga-op3020 systemd[1]: Starting zramswap.service - Linux zramswap setup...Dec 08 11:28:14 aga-op3020 root[869]: Starting ZramDec 08 11:28:14 aga-op3020 zramswap[869]: <13>Dec 8 11:28:14 root: Starting ZramDec 08 11:28:14 aga-op3020 zramswap[866]: /usr/sbin/zramswap: line 53: echo: write error: Device or resource busyDec 08 11:28:14 aga-op3020 root[896]: Error: setting compression algo to zstdDec 08 11:28:14 aga-op3020 zramswap[896]: <13>Dec 8 11:28:14 root: Error: setting compression algo to zstdDec 08 11:28:14 aga-op3020 systemd[1]: zramswap.service: Main process exited, code=exited, status=1/FAILUREDec 08 11:28:14 aga-op3020 systemd[1]: zramswap.service: Failed with result 'exit-code'.Dec 08 11:28:14 aga-op3020 systemd[1]: Failed to start zramswap.service - Linux zramswap setup.ganeshp@aga-op3020:~$ sudo systemctl restart zramswap.serviceJob for zramswap.service failed because the control process exited with error code.See "systemctl status zramswap.service" and "journalctl -xeu zramswap.service" for details.ganeshp@aga-op3020:~$ sudo journalctl -xeu zramswap.service░░ Defined-By: systemd░░ Support: https://www.debian.org/support░░ ░░ A start job for unit zramswap.service has finished with a failure.░░ ░░ The job identifier is 2215 and the job result is failed.Dec 08 11:35:03 aga-op3020 systemd[1]: Starting zramswap.service - Linux zramswap setup...░░ Subject: A start job for unit zramswap.service has begun execution░░ Defined-By: systemd░░ Support: https://www.debian.org/support░░ ░░ A start job for unit zramswap.service has begun execution.░░ ░░ The job identifier is 2344.Dec 08 11:35:03 aga-op3020 zramswap[2954]: /usr/sbin/zramswap: line 53: echo: write error: Device or resource busyDec 08 11:35:03 aga-op3020 root[2958]: Error: setting compression algo to zstdDec 08 11:35:03 aga-op3020 zramswap[2958]: <13>Dec 8 11:35:03 root: Error: setting compression algo to zstdDec 08 11:35:03 aga-op3020 systemd[1]: zramswap.service: Main process exited, code=exited, status=1/FAILURE░░ Subject: Unit process exited░░ Defined-By: systemd░░ Support: https://www.debian.org/support░░ ░░ An ExecStart= process belonging to unit zramswap.service has exited.░░ ░░ The process' exit code is 'exited' and its exit status is 1.Dec 08 11:35:03 aga-op3020 systemd[1]: zramswap.service: Failed with result 'exit-code'.░░ Subject: Unit failed░░ Defined-By: systemd░░ Support: https://www.debian.org/support░░ ░░ The unit zramswap.service has entered the 'failed' state with result 'exit-code'.Dec 08 11:35:03 aga-op3020 systemd[1]: Failed to start zramswap.service - Linux zramswap setup.░░ Subject: A start job for unit zramswap.service has failed░░ Defined-By: systemd░░ Support: https://www.debian.org/support░░ ░░ A start job for unit zramswap.service has finished with a failure.░░ ░░ The job identifier is 2344 and the job result is failed.
I had refered to documentation available at https://wiki.debian.org/ZRam and some other online material to configure ZRam. Here is the bash script I had used to install and configure -
Code:
#!/bin/bashfunction enable_zram_swap(){# for more details on the below please visit url https://wiki.debian.org/ZRamlocal myResponseprintf "\n\nDo you want to install and enable ZRam on your computer? If yes, please disable any other forms of swap and rerun this option. (y/n) : "read -r -n 1 myResponse# validate user inputif [[ "$myResponse" != 'y' ]]thencancel_function_messagereturn 1fiprintf "\n\nAttempting to install zram-tools.\n\n" apt updateapt install zram-tools -yprintf "\n\nEnter swappiness for ZRam swap. Default value is 60 : "read -r -n 3 myResponse# if invalid valueentered, then assign 60 default valuecheck_valid_number "$myResponse" || myResponse=60# configure zram printf "ALGO=zstd\nPERCENT=%s\n" "$myResponse" | tee -a /etc/default/zramswapsystemctl restart zramswap || return# refer to Debian documentation for details.printf "\n\nAttempting to install insserv.\n\n"apt install insserv -yinsserv zramswap# install systemd-zram-generatorprintf "\n\nAttempting to install systemd-zram-generator.\n\n"apt install systemd-zram-generator -y# reload the deamonsystemctl daemon-reloadsystemctl start /dev/zram0 || returnsystemctl enable --now zramswap# display the zram statusprintf "\n\nZRam enabled successfully. Showing the ZRam status.\n\n"zramctl || returnprintf "\n showing output of lsblk.\n"lsblkprintf "\n\n"return 0}enable_zram_swap
Code:
ganeshp@aga-op3020:~$ sudo insserv zramswapinsserv: zramswap: No such file or directoryganeshp@aga-op3020:~$ lsblkNAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTSsda 8:0 0 953.9G 0 disk ├─sda1 8:1 0 512M 0 part /boot/efi├─sda2 8:2 0 1.9G 0 part /boot└─sda3 8:3 0 951.5G 0 part └─sda3_crypt 253:0 0 951.5G 0 crypt ├─aga--vg-lv--home 253:1 0 107.9G 0 lvm /home ├─aga--vg-lv--root 253:2 0 139.7G 0 lvm / └─aga--vg-lv--data 253:3 0 703.8G 0 lvm /datazram0 252:0 0 4G 0 disk [SWAP]ganeshp@aga-op3020:~$ sudo swapon --showNAME TYPE SIZE USED PRIO/dev/zram0 partition 4G 0B 100
Regards
Ganesh
Statistics: Posted by ganeshmallyap — 2024-12-08 06:12 — Replies 1 — Views 45