You are not logged in.

#1 2023-11-26 12:01:32

pradeepthedemon
Member
From: New Delhi
Registered: 2023-03-19
Posts: 7

failed to initialize zram swap services

i am using arch with linux-lts 6.01 as defaults kernel. i got two errors at time of booting.

failed to start manage swap spaces on zram.
failed to start initialize zram swap service

when i tried to invoke this command. I got

  sudo systemctl status zram-swap.service

× zram-swap.service - Initialize zram swap devices
     Loaded: loaded (/etc/systemd/system/zram-swap.service; enabled; preset: disabled)
     Active: failed (Result: exit-code) since Sun 2023-11-26 17:16:24 IST; 26s ago
    Process: 2354 ExecStart=/usr/bin/bash -c modprobe zram num_devices=2 &&                             mkswap /dev/zram0 -L swap0 -U a34f1b3f-5a07-430d-b42e-785db3297e5f -f --pagesize 4096 --label 4G_swap0 --uuid f52601a7-ccb6-4e3f-a4d3-57d1a524e07>
   Main PID: 2354 (code=exited, status=1/FAILURE)
        CPU: 7ms

Nov 26 17:16:24 archBox systemd[1]: Starting Initialize zram swap devices...
Nov 26 17:16:24 archBox bash[2356]: mkswap: parsing version number failed: '1M'
Nov 26 17:16:24 archBox systemd[1]: zram-swap.service: Main process exited, code=exited, status=1/FAILURE
Nov 26 17:16:24 archBox systemd[1]: zram-swap.service: Failed with result 'exit-code'.
Nov 26 17:16:24 archBox systemd[1]: Failed to start Initialize zram swap devices.

here are the contents of zram file...

[Unit]
Description=Initialize zram swap devices
After=multi-user.target

[Service]
Type=oneshot
RemainAfterExit=true
ExecStart=/usr/bin/bash -c "modprobe zram num_devices=2 && \
                           mkswap /dev/zram0 -L swap0 -U a34f1b3f-5a07-430d-b42e-785db3297e5f -f --pagesize 4096 --label 4G_swap0 --uuid f52601a7-ccb6-4e3f-a4d3-57d1a524e071 --bytes 1048576 && \
                           mkswap /dev/zram1 -L swap1 -U 30c2a05a-1e88-466b-a9ae-d3d35f3eaf8f -f --pagesize 4096 --label 4G_swap1 --uuid 2b240654-fc01-4994-bc80-94339913b914 --bytes 1048576 && \
                           swapon /dev/zram0 && \
                           swapon /dev/zram1"

[Install]
WantedBy=multi-user.target

whats going wrong

Last edited by pradeepthedemon (2023-11-27 14:45:33)


Men are mortal. So are ideas. An idea needs propagation as much as a plant needs watering. Otherwise, both will wither and die.-- Dr Bhim Rao Ambetkar

Offline

#2 2023-11-26 18:09:55

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,056

Re: failed to initialize zram swap services

Please use [code][/code] tags, not "quote" tags. Edit your post in this regard.
Also please don't copy and paste out of a pager (see the trailing ">"?)
Something's misssing there and given the error seems like a bad  commandline switch, it's rather likely relevant.

Offline

#3 2023-11-27 14:46:50

pradeepthedemon
Member
From: New Delhi
Registered: 2023-03-19
Posts: 7

Re: failed to initialize zram swap services

Sorry For that...

seth wrote:

Please use [code][/code] tags, not "quote" tags. Edit your post in this regard.
Also please don't copy and paste out of a pager (see the trailing ">"?)
Something's misssing there and given the error seems like a bad  commandline switch, it's rather likely relevant.


Men are mortal. So are ideas. An idea needs propagation as much as a plant needs watering. Otherwise, both will wither and die.-- Dr Bhim Rao Ambetkar

Offline

#4 2023-11-27 15:05:59

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: failed to initialize zram swap services

pradeepthedemon wrote:
ExecStart=/usr/bin/bash -c "modprobe zram num_devices=2 && \
                           mkswap /dev/zram0 -L swap0 -U a34f1b3f-5a07-430d-b42e-785db3297e5f -f --pagesize 4096 --label 4G_swap0 --uuid f52601a7-ccb6-4e3f-a4d3-57d1a524e071 --bytes 1048576 && \
                           mkswap /dev/zram1 -L swap1 -U 30c2a05a-1e88-466b-a9ae-d3d35f3eaf8f -f --pagesize 4096 --label 4G_swap1 --uuid 2b240654-fc01-4994-bc80-94339913b914 --bytes 1048576 && \
                           swapon /dev/zram0 && \
                           swapon /dev/zram1"

Why have you assigned 2 UUIDs and 2 labels to each device? Also, the mkswap man page makes no mention of a "--bytes" option:

empty@archlinux ~ % doas mkswap --bytes 10000 /dev/nvme0n1p2
mkswap: unrecognized option '--bytes'
Try 'mkswap --help' for more information.
1 empty@archlinux ~ %

Have you tried the other methods listed in the relevant ArchWiki page?

And for future reference this would probably have shown more information than the plain "status" query:

journalctl --unit zram-swap

Jin, Jîyan, Azadî

Offline

Board footer

Powered by FluxBB