Suspend/Battery Problems: Commands for Testing

Hello. I have reached out to support. I also want to see if anyone here can help. As reported here: (Librem 5 system crashes - #65 by flanders51), I am having a lot of problems with suspending when on battery power. I am also not able to access the “applications” or “settings” app when on battery.

I re-flashed the device with the latest LUKS variant and that has not improved the issue (although it did improve some other problems I was having). I also enabled ZRAM but that has not helped.

I noticed that the journalctl also gets filled-up relatively quickly with 800mb-1gb of files, but I am unsure what the persistent file dump is related to.

Given the above, can anyone help me show the error logs for what might be going on? Are there any commands that might help?

Also, the last thing I might mention is that I replaced the screen a month or two ago. I had no problems, but the screen I was sent did not have a new USB power unit. There are some connections from the screen to the USB. I am on the same USB unit as I had previously and I wonder if that might have some effect on things related to power?

Any help would be most appreciated.

1 Like

For limiting journalctl, see: Reclaim disk space - #11 by Rhodez-x (other threads too but this seems best)

journalctl | grep <something> is what you need. Just replace “<something>” with relevant keywords or strings. Like “suspend” or “max170xx_battery” or “error” etc. you may find some interesting tidbits in those strings that it spits out and may want to check those too.

If it’s too much/long, use for example:
journalctl | grep "error" > something.txt

edit to add: another way to go about this is to grep for time if you know when you were suspending and waking up: journalctl | grep 11:25 (or something; or see what time your “error” line has)

2 Likes

See also Tips & Tricks · Wiki · Librem5 / Librem 5 Community Wiki · GitLab

3 Likes

Ok! I am getting somewhere. I was able to get my phone to suspend but only when ZRAM swap was enabled (I believe). I am having trouble making it persistent.

I tried this command to make ZRAM swap persistent:

sudo systemctl restart systemd-zram-setup@zram0

Job for systemd-zram-setup@zram0.service failed because the control process exited with error code.
See “systemctl status systemd-zram-setup@zram0.service” and “journalctl -xe” for details.

I tried

journalctl -xe

and I received this:

lines 1987-2022/2022 (END)
Jul 24 12:13:37 pureos avahi-daemon[572]: Registering new address record for fe80::33d2:b7c6:81af:a62c on usb0..
Jul 24 12:13:38 pureos NetworkManager[584]: [1721841218.1732] device (usb0): carrier: link connected
Jul 24 12:13:38 pureos login[4723]: pam_unix(login:auth): check pass; user unknown
Jul 24 12:13:38 pureos login[4723]: pam_unix(login:auth): authentication failure; logname=LOGIN uid=0 euid=0 tty=/dev/ttyGS0 ruser= rhost=
Jul 24 12:13:39 pureos systemd-networkd[460]: usb0: Gained IPv6LL
Jul 24 12:13:42 pureos login[4723]: FAILED LOGIN (1) on ‘/dev/ttyGS0’ FOR ‘UNKNOWN’, Authentication failure
Jul 24 12:13:45 pureos login[4723]: pam_unix(login:auth): check pass; user unknown
Jul 24 12:13:45 pureos login[4723]: pam_unix(login:auth): authentication failure; logname=LOGIN uid=0 euid=0 tty=/dev/ttyGS0 ruser= rhost=
Jul 24 12:13:48 pureos login[4723]: FAILED LOGIN (2) on ‘/dev/ttyGS0’ FOR ‘UNKNOWN’, Authentication failure
Jul 24 12:13:54 pureos login[4723]: pam_unix(login:auth): check pass; user unknown
Jul 24 12:13:56 pureos login[4723]: FAILED LOGIN (3) on ‘/dev/ttyGS0’ FOR ‘UNKNOWN’, Authentication failure
Jul 24 12:14:01 pureos kernel: edt_ft5x06 2-0038: Unable to fetch data, error: -6
Jul 24 12:14:01 pureos gsd-xsettings[1084]: Failed to get current UI legacy scaling factor
Jul 24 12:14:01 pureos gsd-xsettings[1084]: Failed to get current UI legacy scaling factor
Jul 24 12:14:01 pureos gsd-color[1082]: unable to get EDID for xrandr-DSI-1: unable to get EDID for output
Jul 24 12:14:22 pureos NetworkManager[584]: [1721841262.7474] dhcp4 (usb0): request timed out
Jul 24 12:14:22 pureos NetworkManager[584]: [1721841262.7476] dhcp4 (usb0): state changed unknown → timeout
Jul 24 12:14:22 pureos NetworkManager[584]: [1721841262.7479] device (usb0): state change: ip-config → failed (reason ‘ip-config-unavailable’, sys-iface-state: ‘managed’)
Jul 24 12:14:22 pureos NetworkManager[584]: [1721841262.7538] device (usb0): Activation: failed for connection ‘Wired connection 1’
Jul 24 12:14:22 pureos NetworkManager[584]: [1721841262.7555] device (usb0): state change: failed → disconnected (reason ‘none’, sys-iface-state: ‘managed’)
Jul 24 12:14:22 pureos avahi-daemon[572]: Withdrawing address record for fe80::33d2:b7c6:81af:a62c on usb0.
Jul 24 12:14:22 pureos avahi-daemon[572]: Leaving mDNS multicast group on interface usb0.IPv6 with address fe80::33d2:b7c6:81af:a62c.
Jul 24 12:14:22 pureos avahi-daemon[572]: Interface usb0.IPv6 no longer relevant for mDNS.
Jul 24 12:14:22 pureos NetworkManager[584]: [1721841262.7868] dhcp4 (usb0): canceled DHCP transaction
Jul 24 12:14:22 pureos NetworkManager[584]: [1721841262.7870] dhcp4 (usb0): state changed timeout → terminated
Jul 24 12:14:22 pureos NetworkManager[584]: [1721841262.7919] policy: auto-activating connection ‘Wired connection 1’ (213909bf-9dc1-30aa-b4b1-6a59da98be79)
Jul 24 12:14:22 pureos NetworkManager[584]: [1721841262.7956] device (usb0): Activation: starting connection ‘Wired connection 1’ (213909bf-9dc1-30aa-b4b1-6a59da98be79)
Jul 24 12:14:22 pureos NetworkManager[584]: [1721841262.8247] device (usb0): state change: disconnected → prepare (reason ‘none’, sys-iface-state: ‘managed’)
Jul 24 12:14:22 pureos NetworkManager[584]: [1721841262.8265] device (usb0): state change: prepare → config (reason ‘none’, sys-iface-state: ‘managed’)
Jul 24 12:14:22 pureos NetworkManager[584]: [1721841262.8293] device (usb0): state change: config → ip-config (reason ‘none’, sys-iface-state: ‘managed’)
Jul 24 12:14:22 pureos NetworkManager[584]: [1721841262.8313] dhcp4 (usb0): activation: beginning transaction (timeout in 45 seconds)
Jul 24 12:14:22 pureos avahi-daemon[572]: Joining mDNS multicast group on interface usb0.IPv6 with address fe80::33d2:b7c6:81af:a62c.
Jul 24 12:14:22 pureos avahi-daemon[572]: New relevant interface usb0.IPv6 for mDNS.
Jul 24 12:14:22 pureos avahi-daemon[572]: Registering new address record for fe80::33d2:b7c6:81af:a62c on usb0.
.
Jul 24 12:14:22 pureos rygel[4181]: Error creating GUPnP context: Failed to bind socketError binding to address [fe80::33d2:b7c6:81af:a62c%2]:1900: Cannot assign requested address
Jul 24 12:14:24 pureos systemd-networkd[460]: usb0: Gained IPv6LL
~

Can anyone parse this and maybe help with what I can try to fix?

1 Like

I’m not saying I have any clue about this or that I can help, but lets start by adding a bit of context to this:

  • What’s happening when you’re doing this (shut down, suspend, login…?) and are there some apps running?
  • What do you experience vs. what do you expect to happen (and does not)?

Is this output just for the ZRAM or are you experiencing something else too (as per first post)? It seems like you didn’t authenticate with that sudo command (did it ask for your pw?). I’m ignoring the network related stuff for now.

(edit: do you get anything with journalctl | grep zram ?)

1 Like

Thank you. I will try.

When I start the device without ZRAM swap enabled it will not suspend while on battery. I have to enable ZRAM to make the device suspend (but only on battery not when plugged-in).

When I do not have ZRAM enabled, I either wait for the device to suspend or I ask it to suspend via the menu. It tries to suspend but then wakes up right away to the login-screen. It also connects to the Wifi and anything else available in what I presume to be Network-Manager.

If ZRAM is enabled it will suspend most of the time but not all the time.

I was hoping that it was a memory issue and that if I could make ZRAM persistent each time I rebooted the device, that suspend would work again. I cannot make ZRAM persistent due to the error code I gave previously.

1 Like

(edit: do you get anything with journalctl | grep zram ?)

I get a lot messages - too many to copy and paste here. Is there anything specific you might like to see?

1 Like

This is unknown territory for me. I hope someone here can jump in. Only time I’ve had similar behavior was with a desktop that refused to stay suspended when RAID disc had partially failed.

Use time stamp to select relevant - let’s say, gather messages for when you are suspending (and it wakes up) - for now. And you can also check the output that you forward (>) to txt and grep that in turn for “error” strings (or anything else interesting).

1 Like

Got it.

Here is the message:

purism@pureos:~$ journalctl | grep 12:52
Jul 24 12:52:04 pureos systemd[1]: serial-getty@ttyGS0.service: Succeeded.
Jul 24 12:52:05 pureos systemd[1]: serial-getty@ttyGS0.service: Scheduled restart job, restart counter is at 84.
Jul 24 12:52:05 pureos systemd[1]: Stopped Serial Getty on ttyGS0.
Jul 24 12:52:05 pureos systemd[1]: Started Serial Getty on ttyGS0.
Jul 24 12:52:05 pureos systemd[1]: Starting Create swap on /dev/zram0…
Jul 24 12:52:05 pureos zram_generator::config[8424]: /usr/lib/systemd/zram-generator.conf.d/librem5.conf: ignoring settings outside of section: Properties { data: {“zram-fraction”: “2 (accepts decimal number, and seems unlimited (i tried 6 with no problems))”, “max-zram-size”: “none (or 4096)”} }
Jul 24 12:52:05 pureos kernel: zram: Cannot change disksize for initialized device
Jul 24 12:52:05 pureos zram-generator[8424]: Error: Failed to configure disk size into /sys/block/zram0/disksize
Jul 24 12:52:05 pureos zram-generator[8424]: Caused by:
Jul 24 12:52:05 pureos zram-generator[8424]: Device or resource busy (os error 16)
Jul 24 12:52:05 pureos systemd[1]: systemd-zram-setup@zram0.service: Main process exited, code=exited, status=1/FAILURE
Jul 24 12:52:05 pureos systemd[1]: systemd-zram-setup@zram0.service: Failed with result ‘exit-code’.
Jul 24 12:52:05 pureos systemd[1]: Failed to start Create swap on /dev/zram0.
Jul 24 12:52:05 pureos systemd[1]: Dependency failed for Compressed Swap on /dev/zram0.
Jul 24 12:52:05 pureos systemd[1]: dev-zram0.swap: Job dev-zram0.swap/start failed with result ‘dependency’.
Jul 24 12:52:12 pureos NetworkManager[584]: [1721843532.4950] dhcp4 (usb0): request timed out
Jul 24 12:52:12 pureos NetworkManager[584]: [1721843532.4953] dhcp4 (usb0): state changed unknown → timeout
Jul 24 12:52:12 pureos NetworkManager[584]: [1721843532.4955] device (usb0): state change: ip-config → failed (reason ‘ip-config-unavailable’, sys-iface-state: ‘managed’)
Jul 24 12:52:12 pureos NetworkManager[584]: [1721843532.5000] device (usb0): Activation: failed for connection ‘Wired connection 1’
Jul 24 12:52:12 pureos NetworkManager[584]: [1721843532.5013] device (usb0): state change: failed → disconnected (reason ‘none’, sys-iface-state: ‘managed’)
Jul 24 12:52:12 pureos avahi-daemon[572]: Withdrawing address record for fe80::33d2:b7c6:81af:a62c on usb0.
Jul 24 12:52:12 pureos avahi-daemon[572]: Leaving mDNS multicast group on interface usb0.IPv6 with address fe80::33d2:b7c6:81af:a62c.
Jul 24 12:52:12 pureos avahi-daemon[572]: Interface usb0.IPv6 no longer relevant for mDNS.
Jul 24 12:52:12 pureos NetworkManager[584]: [1721843532.5320] dhcp4 (usb0): canceled DHCP transaction
Jul 24 12:52:12 pureos NetworkManager[584]: [1721843532.5322] dhcp4 (usb0): state changed timeout → terminated
Jul 24 12:52:12 pureos NetworkManager[584]: [1721843532.5596] policy: auto-activating connection ‘Wired connection 1’ (213909bf-9dc1-30aa-b4b1-6a59da98be79)
Jul 24 12:52:12 pureos NetworkManager[584]: [1721843532.5644] device (usb0): Activation: starting connection ‘Wired connection 1’ (213909bf-9dc1-30aa-b4b1-6a59da98be79)
Jul 24 12:52:12 pureos NetworkManager[584]: [1721843532.5663] device (usb0): state change: disconnected → prepare (reason ‘none’, sys-iface-state: ‘managed’)
Jul 24 12:52:12 pureos NetworkManager[584]: [1721843532.5700] device (usb0): state change: prepare → config (reason ‘none’, sys-iface-state: ‘managed’)
Jul 24 12:52:12 pureos NetworkManager[584]: [1721843532.5751] device (usb0): state change: config → ip-config (reason ‘none’, sys-iface-state: ‘managed’)
Jul 24 12:52:12 pureos NetworkManager[584]: [1721843532.5781] dhcp4 (usb0): activation: beginning transaction (timeout in 45 seconds)
Jul 24 12:52:12 pureos avahi-daemon[572]: Joining mDNS multicast group on interface usb0.IPv6 with address fe80::33d2:b7c6:81af:a62c.
Jul 24 12:52:12 pureos avahi-daemon[572]: New relevant interface usb0.IPv6 for mDNS.
Jul 24 12:52:12 pureos rygel[6596]: Error creating GUPnP context: Failed to bind socketError binding to address [fe80::33d2:b7c6:81af:a62c%2]:1900: Cannot assign requested address
Jul 24 12:52:12 pureos avahi-daemon[572]: Registering new address record for fe80::33d2:b7c6:81af:a62c on usb0..
Jul 24 12:52:14 pureos systemd-networkd[460]: usb0: Gained IPv6LL
Jul 24 12:52:37 pureos systemd-logind[598]: Power key pressed.
Jul 24 12:52:38 pureos gsd-xsettings[1084]: Failed to get current UI legacy scaling factor
Jul 24 12:52:38 pureos gsd-xsettings[1084]: Failed to get current UI legacy scaling factor
Jul 24 12:52:38 pureos gsd-color[1082]: unable to get EDID for xrandr-DSI-1: unable to get EDID for output
Jul 24 12:52:38 pureos kernel: dwc3 38100000.usb: request 00000000a41c0fb5 was not queued to ep1in
Jul 24 12:52:38 pureos systemd-networkd[460]: usb0: Lost carrier
Jul 24 12:52:38 pureos systemd[1]: serial-getty@ttyGS0.service: Succeeded.
Jul 24 12:52:38 pureos systemd[1]: serial-getty@ttyGS0.service: Scheduled restart job, restart counter is at 85.
Jul 24 12:52:38 pureos systemd[1]: Stopped Serial Getty on ttyGS0.
Jul 24 12:52:38 pureos systemd[1]: Started Serial Getty on ttyGS0.
Jul 24 12:52:38 pureos systemd[1]: Starting Create swap on /dev/zram0…
Jul 24 12:52:38 pureos zram-generator[8469]: Error: Failed to configure disk size into /sys/block/zram0/disksize
Jul 24 12:52:38 pureos zram-generator[8469]: Caused by:
Jul 24 12:52:38 pureos zram-generator[8469]: Device or resource busy (os error 16)
Jul 24 12:52:38 pureos zram_generator::config[8469]: /usr/lib/systemd/zram-generator.conf.d/librem5.conf: ignoring settings outside of section: Properties { data: {“zram-fraction”: “2 (accepts decimal number, and seems unlimited (i tried 6 with no problems))”, “max-zram-size”: “none (or 4096)”} }
Jul 24 12:52:38 pureos kernel: zram: Cannot change disksize for initialized device
Jul 24 12:52:38 pureos systemd[1]: systemd-zram-setup@zram0.service: Main process exited, code=exited, status=1/FAILURE
Jul 24 12:52:38 pureos systemd[1]: systemd-zram-setup@zram0.service: Failed with result ‘exit-code’.
Jul 24 12:52:38 pureos systemd[1]: Failed to start Create swap on /dev/zram0.
Jul 24 12:52:38 pureos systemd[1]: Dependency failed for Compressed Swap on /dev/zram0.
Jul 24 12:52:38 pureos systemd[1]: dev-zram0.swap: Job dev-zram0.swap/start failed with result ‘dependency’.
Jul 24 12:52:38 pureos systemd-networkd[460]: usb0: Gained carrier
Jul 24 12:52:38 pureos NetworkManager[584]: [1721843558.9062] device (usb0): carrier: link connected
Jul 24 12:52:39 pureos kernel: dwc3 38100000.usb: request 00000000e5e80684 was not queued to ep1in
Jul 24 12:52:39 pureos systemd-networkd[460]: usb0: Lost carrier
Jul 24 12:52:39 pureos systemd[1]: serial-getty@ttyGS0.service: Succeeded.
Jul 24 12:52:39 pureos systemd[1]: serial-getty@ttyGS0.service: Scheduled restart job, restart counter is at 86.
Jul 24 12:52:39 pureos systemd[1]: Stopped Serial Getty on ttyGS0.
Jul 24 12:52:39 pureos systemd[1]: Started Serial Getty on ttyGS0.
Jul 24 12:52:39 pureos systemd[1]: Starting Create swap on /dev/zram0…
Jul 24 12:52:39 pureos zram-generator[8473]: Error: Failed to configure disk size into /sys/block/zram0/disksize
Jul 24 12:52:39 pureos zram-generator[8473]: Caused by:
Jul 24 12:52:39 pureos zram-generator[8473]: Device or resource busy (os error 16)
Jul 24 12:52:39 pureos zram_generator::config[8473]: /usr/lib/systemd/zram-generator.conf.d/librem5.conf: ignoring settings outside of section: Properties { data: {“zram-fraction”: “2 (accepts decimal number, and seems unlimited (i tried 6 with no problems))”, “max-zram-size”: “none (or 4096)”} }
Jul 24 12:52:39 pureos kernel: zram: Cannot change disksize for initialized device
Jul 24 12:52:39 pureos systemd[1]: systemd-zram-setup@zram0.service: Main process exited, code=exited, status=1/FAILURE
Jul 24 12:52:39 pureos systemd[1]: systemd-zram-setup@zram0.service: Failed with result ‘exit-code’.
Jul 24 12:52:39 pureos systemd[1]: Failed to start Create swap on /dev/zram0.
Jul 24 12:52:39 pureos systemd[1]: Dependency failed for Compressed Swap on /dev/zram0.
Jul 24 12:52:39 pureos systemd[1]: dev-zram0.swap: Job dev-zram0.swap/start failed with result ‘dependency’.
Jul 24 12:52:40 pureos systemd-networkd[460]: usb0: Gained carrier
Jul 24 12:52:40 pureos NetworkManager[584]: [1721843560.4320] device (usb0): carrier: link connected
Jul 24 12:52:42 pureos login[8472]: pam_unix(login:auth): check pass; user unknown
Jul 24 12:52:42 pureos login[8472]: pam_unix(login:auth): authentication failure; logname=LOGIN uid=0 euid=0 tty=/dev/ttyGS0 ruser= rhost=
Jul 24 12:52:44 pureos login[8472]: FAILED LOGIN (1) on ‘/dev/ttyGS0’ FOR ‘UNKNOWN’, Authentication failure
Jul 24 12:52:48 pureos login[8472]: pam_unix(login:auth): check pass; user unknown
Jul 24 12:52:48 pureos login[8472]: pam_unix(login:auth): authentication failure; logname=LOGIN uid=0 euid=0 tty=/dev/ttyGS0 ruser= rhost=
Jul 24 12:52:51 pureos login[8472]: FAILED LOGIN (2) on ‘/dev/ttyGS0’ FOR ‘UNKNOWN’, Authentication failure
Jul 24 12:52:57 pureos NetworkManager[584]: [1721843577.5102] dhcp4 (usb0): request timed out
Jul 24 12:52:57 pureos NetworkManager[584]: [1721843577.5103] dhcp4 (usb0): state changed unknown → timeout
Jul 24 12:52:57 pureos NetworkManager[584]: [1721843577.5105] device (usb0): state change: ip-config → failed (reason ‘ip-config-unavailable’, sys-iface-state: ‘managed’)
Jul 24 12:52:57 pureos NetworkManager[584]: [1721843577.5148] device (usb0): Activation: failed for connection ‘Wired connection 1’
Jul 24 12:52:57 pureos NetworkManager[584]: [1721843577.5157] device (usb0): state change: failed → disconnected (reason ‘none’, sys-iface-state: ‘managed’)
Jul 24 12:52:57 pureos avahi-daemon[572]: Withdrawing address record for fe80::33d2:b7c6:81af:a62c on usb0.
Jul 24 12:52:57 pureos avahi-daemon[572]: Leaving mDNS multicast group on interface usb0.IPv6 with address fe80::33d2:b7c6:81af:a62c.
Jul 24 12:52:57 pureos avahi-daemon[572]: Interface usb0.IPv6 no longer relevant for mDNS.
Jul 24 12:52:57 pureos NetworkManager[584]: [1721843577.5598] dhcp4 (usb0): canceled DHCP transaction
Jul 24 12:52:57 pureos NetworkManager[584]: [1721843577.5599] dhcp4 (usb0): state changed timeout → terminated
Jul 24 12:52:57 pureos login[8472]: pam_unix(login:auth): check pass; user unknown
Jul 24 12:52:57 pureos NetworkManager[584]: [1721843577.5778] policy: auto-activating connection ‘Wired connection 1’ (213909bf-9dc1-30aa-b4b1-6a59da98be79)
Jul 24 12:52:57 pureos NetworkManager[584]: [1721843577.5812] device (usb0): Activation: starting connection ‘Wired connection 1’ (213909bf-9dc1-30aa-b4b1-6a59da98be79)
Jul 24 12:52:57 pureos NetworkManager[584]: [1721843577.5822] device (usb0): state change: disconnected → prepare (reason ‘none’, sys-iface-state: ‘managed’)
Jul 24 12:52:57 pureos NetworkManager[584]: [1721843577.5838] device (usb0): state change: prepare → config (reason ‘none’, sys-iface-state: ‘managed’)
Jul 24 12:52:57 pureos NetworkManager[584]: [1721843577.5870] device (usb0): state change: config → ip-config (reason ‘none’, sys-iface-state: ‘managed’)
Jul 24 12:52:57 pureos NetworkManager[584]: [1721843577.5889] dhcp4 (usb0): activation: beginning transaction (timeout in 45 seconds)
Jul 24 12:52:57 pureos avahi-daemon[572]: Joining mDNS multicast group on interface usb0.IPv6 with address fe80::33d2:b7c6:81af:a62c.
Jul 24 12:52:57 pureos avahi-daemon[572]: New relevant interface usb0.IPv6 for mDNS.
Jul 24 12:52:57 pureos avahi-daemon[572]: Registering new address record for fe80::33d2:b7c6:81af:a62c on usb0.
.
Jul 24 12:52:57 pureos rygel[6596]: Error creating GUPnP context: Failed to bind socketError binding to address [fe80::33d2:b7c6:81af:a62c%2]:1900: Cannot assign requested address
Jul 24 12:52:58 pureos systemd-networkd[460]: usb0: Gained IPv6LL
purism@pureos:~$

1 Like

Ok. I copien that to a text editor for more convenience and immediately see zram problem reported in lines 6-16. It’s not very helpful but seems that it’s clearly marked.

Something curious on line 7 though. Did you perhaps copy-paste and leave some comments where they shouldn’t (I’m not sure if those are causing error or just ignored comments that get reported)? “(accepts decimal number, and seems unlimited (i tried 6 with no problems))” [this was after the value 2 set for zram-fraction]
[edit to add: also “(or 4096)”]

Nothing else stand out for me. Anyone else?

1 Like

Yep, I saw that. I suspect that perhaps I installed it wrong.

1 Like

Well, I keep trying. I “may” have it narrowed down to NetworkManager or ZRAM.

How might I test whether NetworkManager is somehow causing problems?

I notice this also and I am trying to follow up on the below errors:

Jul 24 12:52:04 pureos systemd[1]: serial-getty@ttyGS0.service: Succeeded.
Jul 24 12:52:05 pureos systemd[1]: serial-getty@ttyGS0.service: Scheduled restart job, restart counter is at 84.
Jul 24 12:52:05 pureos systemd[1]: Stopped Serial Getty on ttyGS0.
Jul 24 12:52:05 pureos systemd[1]: Started Serial Getty on ttyGS0.
Jul 24 12:52:05 pureos systemd[1]: Starting Create swap on /dev/zram0…
Jul 24 12:52:05 pureos zram_generator::config[8424]: /usr/lib/systemd/zram-generator.conf.d/librem5.conf: ignoring settings outside of section: Properties { data: {“zram-fraction”: “2 (accepts decimal number, and seems unlimited (i tried 6 with no problems))”, “max-zram-size”: “none (or 4096)”} }
Jul 24 12:52:05 pureos kernel: zram: Cannot change disksize for initialized device
Jul 24 12:52:05 pureos zram-generator[8424]: Error: Failed to configure disk size into /sys/block/zram0/disksize
Jul 24 12:52:05 pureos zram-generator[8424]: Caused by:
Jul 24 12:52:05 pureos zram-generator[8424]: Device or resource busy (os error 16)
Jul 24 12:52:05 pureos systemd[1]: systemd-zram-setup@zram0.service: Main process exited, code=exited, status=1/FAILURE
Jul 24 12:52:05 pureos systemd[1]: systemd-zram-setup@zram0.service: Failed with result ‘exit-code’.
Jul 24 12:52:05 pureos systemd[1]: Failed to start Create swap on /dev/zram0.
Jul 24 12:52:05 pureos systemd[1]: Dependency failed for Compressed Swap on /dev/zram0.
Jul 24 12:52:05 pureos systemd[1]: dev-zram0.swap: Job dev-zram0.swap/start failed with result ‘dependency’.
Jul 24 12:52:12 pureos NetworkManager[584]: [1721843532.4950] dhcp4 (usb0): request timed out
Jul 24 12:52:12 pureos NetworkManager[584]: [1721843532.4953] dhcp4 (usb0): state changed unknown → timeout
Jul 24 12:52:12 pureos NetworkManager[584]: [1721843532.4955] device (usb0): state change: ip-config → failed (reason ‘ip-config-unavailable’, sys-iface-state: ‘managed’)

1 Like

Interestingly, I note that I cannot suspend while on battery and doing a task such as listening to a podcast via Lollypop. The suspend function will “trigger” and try to suspend the device but something is not allowing it to suspend. The podcast will kind of stagger and try to shutdown but then the device just stutters and starts the phone and podcast back up again.

1 Like

I’d focus first on something more “tangible” in this mess. The “error: failed to configure disksize…” seems like there is something blocking that from happening. Is there enough free space? Do all the steps ZRAM process does have permissions to do so? What’s that dependency? Make sure you’re not missing a journal line between 12:52:05 and 12:52:12 (something relevant may not have “zram” on it; anything to do with folders/mount points or devices? or try “systemd” from that timeframe?).
Something to search online… (there are a few threads there)

I’m, not sure what’s going on with the suspend issue. You may want to open a separate thread just for sanity.

2 Likes

If you want help from the big brothers, here’s what they had to say about ZRAM, based on your last journalctl:

Copilot

The error messages indicate that the system is trying to change the disk size of an already initialized zRAM device, which is not allowed¹. This could be due to a conflict with another process or service that is using the device.

To resolve this issue, you can try the following steps:

  1. Disable the current zRAM device: You can disable the current zRAM device using the command sudo swapoff /dev/zram0³.

  2. Reset the zRAM device: After disabling the zRAM device, you can reset it using the command sudo zramctl --reset /dev/zram0³.

  3. Reconfigure zRAM: Once the zRAM device has been reset, you can reconfigure it according to your needs.

To verify whether zRAM is enabled or not on your system, you can run the command cat /proc/swaps. If you see an output that contains /dev/zram0 or similar then you have zRAM already enabled on your system¹. If not, you may need to enable it.

Please note that these commands should be executed with root privileges. If the problem persists, it might be worth checking if the zRAM module is properly installed⁴. If not, you may need to install it using the appropriate package manager for your distribution.

Remember to always back up important data before making significant changes to your system configuration.

Source: Conversation with Copilot, 7/25/2024
(1) Enable Zram on Linux For Better System Performance - FOSS Post. Enable Zram On Linux For Better System Performance.
(2) Hi all! got this error on Linux— /dev/zram0: write error: Text file … Hi all! got this error on Linux— /dev/zram0: write error: Text file busy - Super User.
(3) Has zram been removed in the latest ubuntu (17.10)?. swap - Has zram been removed in the latest ubuntu (17.10)? - Ask Ubuntu.
(4) How to enable the zRAM module for faster swapping on Linux. How to enable the zRAM module for faster swapping on Linux | TechRepublic.
(5) zram: Compressed RAM based block devices — The Linux Kernel documentation. zram: Compressed RAM based block devices — The Linux Kernel documentation.
(6) undefined. https://assets.techrepublic.com/uploads/2021/02/20210225-zRAM-Jack.mp4?_=2.

GPT-4o

Diagnosing the ZRAM Installation Issue

The error messages from journalctl indicate that there is an issue with configuring the ZRAM device. Here are the key points from the log:

  1. Initialization Error:

    Jul 24 12:52:05 pureos kernel: zram: Cannot change disksize for initialized device
    Jul 24 12:52:05 pureos zram-generator[8424]: Error: Failed to configure disk size into /sys/block/zram0/disksize
    Jul 24 12:52:05 pureos zram-generator[8424]: Caused by:
    Jul 24 12:52:05 pureos zram-generator[8424]: Device or resource busy (os error 16)
    
  2. Configuration File Issue:

    Jul 24 12:52:05 pureos zram_generator::config[8424]: /usr/lib/systemd/zram-generator.conf.d/librem5.conf: ignoring settings outside of section: Properties { data: {“zram-fraction”: “2 (accepts decimal number, and seems unlimited (i tried 6 with no problems))”, “max-zram-size”: “none (or 4096)”} }
    

Possible Causes and Solutions

1. Device Already Initialized

The error Cannot change disksize for initialized device suggests that the ZRAM device /dev/zram0 is already initialized and cannot be reconfigured without resetting it first.

Solution:

  • Reset the ZRAM device before reconfiguring it:
    sudo zramctl --reset /dev/zram0
    

2. Configuration File Syntax

The log indicates that the configuration file /usr/lib/systemd/zram-generator.conf.d/librem5.conf has settings outside the expected section. This might be causing the generator to ignore important settings.

Solution:

  • Ensure that the configuration file follows the correct syntax. The settings should be within the [zram0] section:
    [zram0]
    zram-fraction=2
    max-zram-size=4096
    

3. Resource Busy Error

The Device or resource busy (os error 16) error indicates that the device is in use or locked by another process.

Solution:

  • Ensure no other process is using the ZRAM device. You can check the current status with:
    sudo zramctl
    

Verification Steps

  1. Check ZRAM Status:

    sudo zramctl
    

    This command will show the current status of ZRAM devices, including their size, compression algorithm, and usage.

  2. Review Configuration:
    Ensure the configuration file is correctly formatted and located in the appropriate directory:

    cat /usr/lib/systemd/zram-generator.conf.d/librem5.conf
    
  3. Reset and Reconfigure ZRAM:

    sudo zramctl --reset /dev/zram0
    sudo systemctl restart systemd-zram-setup@zram0.service
    
  4. Check Logs:
    After making changes, check the logs again to ensure there are no errors:

    journalctl -xe
    

By following these steps, you should be able to diagnose and resolve the issues with your ZRAM installation. If the problem persists, consider reviewing the systemd and ZRAM documentation for further troubleshooting tips.

What about the network messages…?

Copilot

This could be due to a variety of reasons such as a problem with the DHCP server, a network connectivity issue, or a configuration problem on the usb0 interface1.

To troubleshoot this issue, you can try the following steps:

  1. Check the Network Configuration: Ensure that the usb0 interface is configured to use DHCP and that the configuration is correct.
  2. Check the DHCP Server: If the DHCP server is under your control, check its configuration and logs to see if there are any issues.
  3. Check Network Connectivity: Ensure that the usb0 interface is properly connected to the network and that it can reach the DHCP server.
  4. Restart the Network Service: Sometimes, simply restarting the network service can resolve the issue. You can do this with the command sudo systemctl restart NetworkManager.

Remember to execute these commands with root privileges. If the problem persists, you may need to delve deeper into network troubleshooting or consider reaching out to your network administrator or ISP for assistance. Always remember to back up important data before making significant changes to your system configuration.

GPT-4o

Understanding the Network Messages in journalctl

The network-related messages in your journalctl logs indicate issues with the DHCP (Dynamic Host Configuration Protocol) process on the usb0 interface. Here are the key points from the log:

  1. DHCP Request Timeout:

    Jul 24 12:52:12 pureos NetworkManager[584]: [1721843532.4950] dhcp4 (usb0): request timed out
    Jul 24 12:52:12 pureos NetworkManager[584]: [1721843532.4953] dhcp4 (usb0): state changed unknown → timeout
    
  2. IP Configuration Failure:

    Jul 24 12:52:12 pureos NetworkManager[584]: [1721843532.4955] device (usb0): state change: ip-config → failed (reason ‘ip-config-unavailable’, sys-iface-state: ‘managed’)
    

Possible Causes and Solutions

1. DHCP Server Unavailability

The DHCP request timeout suggests that the DHCP server did not respond to the request from the usb0 interface. This could be due to the DHCP server being down or unreachable.

Solution:

  • Verify that the DHCP server is running and accessible. You can check the status of the DHCP server on your network or contact your network administrator.

2. Network Interface Issues

The usb0 interface might be experiencing issues that prevent it from communicating with the DHCP server.

Solution:

  • Restart the network interface:
    sudo ifdown usb0 && sudo ifup usb0
    
  • Alternatively, restart the NetworkManager service:
    sudo systemctl restart NetworkManager
    

3. Configuration Problems

There might be a misconfiguration in the network settings for the usb0 interface.

Solution:

  • Check the network configuration for usb0 in /etc/network/interfaces or the NetworkManager configuration files.
  • Ensure that the interface is set to use DHCP:
    auto usb0
    iface usb0 inet dhcp
    

Verification Steps

  1. Check Network Interface Status:

    ip addr show usb0
    

    This command will show the current status and configuration of the usb0 interface.

  2. Review NetworkManager Logs:

    journalctl -u NetworkManager
    

    This will provide more detailed logs from NetworkManager, which can help diagnose the issue further.

  3. Ping the DHCP Server:
    If you know the IP address of the DHCP server, try pinging it to ensure it is reachable:

    ping <DHCP_SERVER_IP>
    
  4. Check DHCP Client Logs:

    sudo journalctl -u dhclient
    

    This will show logs related to the DHCP client, which can provide more insights into why the DHCP request is timing out.

By following these steps, you should be able to diagnose and resolve the network issues indicated by the journalctl logs. If the problem persists, consider consulting the documentation for your specific network setup or seeking assistance from your network administrator.

And analysing also the previous log, with combo answer:

Copilot

The log shows two main issues:

  1. ZRAM Configuration Error: The system is trying to create a swap on /dev/zram0, but it’s failing because the device is busy¹⁸. This could be due to an attempt to change the disk size of an initialized ZRAM device⁹. To resolve this, you can try the following steps:

    • Modify the ZRAM configuration file located at /etc/systemd/zram-generator.conf⁹.
    • Ensure that the zram-fraction and max-zram-size are set correctly⁹.
    • If the issue persists, you may need to disable the device, make the necessary changes, and then re-enable it³.
  2. Network Connection Issue: The DHCP request for usb0 is timing out, causing the network connection to fail. This could be due to a problem with the network cable, router, or the network configuration on the system. Here are some troubleshooting steps:

    • Check the physical connection of your network cable.
    • Try restarting your router.
    • Check your network configuration settings.
    • If the issue persists, you may need to contact your Internet Service Provider.

Please note that these are general suggestions based on the provided log. The exact solution may vary depending on the specific configuration of your system. If the problem persists after trying these steps, I recommend seeking assistance from a system administrator or a technical support professional. They can provide more personalized assistance based on a detailed understanding of your system’s configuration.

Source: Conversation with Copilot, 7/25/2024
(1) [Solved] zram: Can’t change algorithm for initialized device (device or … [Solved] zram: Can't change algorithm for initialized device (device or resource busy) - Debian User Forums.
(2) permissions - How to change zram size? - Ask Ubuntu. permissions - How to change zram size? - Ask Ubuntu.
(3) Serial Getty on ttys0 - causes stalls on system/reboot. Serial Getty on ttys0 - causes stalls on system/reboot - Raspberry Pi Stack Exchange.
(4) Serial Getty error messages - Unix & Linux Stack Exchange. agetty - Serial Getty error messages - Unix & Linux Stack Exchange.
(5) What is the difference between serial-getty@ttyAMA0.service and getty … systemd - What is the difference between serial-getty@ttyAMA0.service and getty@ttyAMA0.service - Unix & Linux Stack Exchange.
(6) serial-getty@ttyS0.service - Technical Support - Toradex Community. serial-getty@ttyS0.service - Technical Support - Toradex Community.
(7) Enabling a Serial Port Console: getty systemd | Linux & Open Source. https://www.rogerirwin.co.nz/linux-open-source/enabling-a-serial-port-console/.
(8) systemd/zram-generator: Systemd unit generator for zram devices - GitHub. GitHub - systemd/zram-generator: Systemd unit generator for zram devices.
(9) zram-generator/man/zram-generator.conf.md at main - GitHub. zram-generator/man/zram-generator.conf.md at main · systemd/zram-generator · GitHub.
(10) GitHub - maximumadmin/zramd: Automatically setup swap on zram with … GitHub - maximumadmin/zramd: Automatically setup swap on zram ✨ with optional systemd support, a simpler alternative to zram-generator and systemd-swap.
(11) How to resize ZRAM (compressed swap) managed by systemd/zram-generator … How to resize ZRAM (compressed swap) managed by systemd/zram-generator | Ctrl blog.
(12) Aruba NetEdit 2.0: service serial-getty@ttyS0.service looping (hold-off … Aruba NetEdit 2.0: service serial-getty@ttyS0.service looping (hold-off time over) | Wired Intelligent Edge.
(13) Gadget serial (ttyGS0) hangs when no host is present; prevents reboot … Gadget serial (ttyGS0) hangs when no host is present; prevents reboot & shutdown · Issue #1929 · raspberrypi/linux · GitHub.
(14) NanoPi R2S - OTG g_serial (ttyGS0) not working - Forums. NanoPi R2S - OTG g_serial(ttyGS0) not working - Rockchip - Armbian Community Forums.
(15) Working with the serial console - ArchWiki. Working with the serial console - ArchWiki.
(16) How to set up properly zram and swap - Unix & Linux Stack Exchange. linux - How to set up properly zram and swap - Unix & Linux Stack Exchange.
(17) How to enable the zRAM module for faster swapping on Linux. How to enable the zRAM module for faster swapping on Linux | TechRepublic.
(18) QA:Testcase SwapOnZRAM stop - Fedora Project Wiki. QA:Testcase SwapOnZRAM stop - Fedora Project Wiki.
(19) zram swap config fails as the device is busy #119 - GitHub. zram swap config fails as the device is busy · Issue #119 · systemd/zram-generator · GitHub.
(20) Apply config changes? · Issue #78 · systemd/zram-generator. Apply config changes? · Issue #78 · systemd/zram-generator · GitHub.
(21) Re-reading the partition table failed with error 16: Device or resource … linux - Re-reading the partition table failed with error 16: Device or resource busy - Unix & Linux Stack Exchange.
(22) fails with 'zram: Cannot change disksize for initialized device … fails with 'zram: Cannot change disksize for initialized device' · Issue #7 · systemd/zram-generator · GitHub.
(23) zram: Compressed RAM-based block devices - Kernel. zram: Compressed RAM-based block devices — The Linux Kernel documentation.
(24) zram swap is not enabled after boot #6511 - GitHub. zram swap is not enabled after boot · Issue #6511 · MichaIng/DietPi · GitHub.
(25) service unit fails when host-memory-limit is set below the … - GitHub. service unit fails when host-memory-limit is set below the host memory · Issue #44 · systemd/zram-generator · GitHub.
(26) Automatically start zram swap device on boot with systemd. Automatically start zram swap device on boot with systemd.
(27) undefined. systemd for Administrators, Part XVI.
(28) undefined. https://github.com/armbian/build/tree/master/patch/kernel/rockchip64-dev.
(29) undefined. https://www.kernel.org/doc/Documentation/blockdev/zram.txt.
(30) undefined. https://assets.techrepublic.com/uploads/2021/02/20210225-zRAM-Jack.mp4?_=2.
(31) undefined. https://debian.nabijaczleweli.xyz/README.
(32) undefined. AUR (en) - zram-generator-git.
(33) undefined. Ubuntu Manpage: zramctl - set up and control zram devices.

2 Likes

Wow. Who are the big brothers? Whoever they are, please tell them I appreciate it and I will get back to them. What wonderful help. I appreciate it very much.

Edit: Whoops. I see you are using the big brothers. I never thought to ask AI. I am fine with it!

2 Likes

Did you get any results with this? Were any of the errors resolved? What steps did you take? (for desperate future needs that some poor user may have)

2 Likes

Hello. I wish I could report more. I received zero support from Purism. That route appears dead. I reflashed my phone twice. That did not help. I have not yet attempted to upgrade firmware but I may.

The thing that mostly resolved the problem was downgrading to an older kernel. I will try to link to that post as a partial “solution”. My device still suspends poorly sometimes and overheats causing random shutdowns. However, the kernel downgrade has mostly solved my problems.

2 Likes