-
Notifications
You must be signed in to change notification settings - Fork 196
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Log2ram failed to start on boot #175
Comments
That should no append. |
I havent seen any errors, but I havent view all of the logs, just some of them. From what I have remembered, systemctl showed that it was terminated.
Any way for me to view the old logs? If so I could provide them. |
I manage to get it again, somehow
Both lights at ethernet port are on when booting stuck. Green act light of pi is not flashing until 2 minutes after boot. I tried to rsync the backup logs from a old copy of the same drive to |
It's look like the copy stop somewhere.
|
The issue resolved again after I reinstalled, so I could not test it. But I remember that when I was debugging yesterday, I tried to start it manually, by |
It's look like a zram issue in your case, if zram didnt start logs can be heavier the authorized size |
I dont know, but the my log size was kept below 40M, tho I set the capacity to be 80M, but zram bumped that up to maybe 130M or so using lz4 compression? |
I cannot know, lz4 is quite powerful with simple text data. |
I think I'm also hitting this but how can I verify it? I mean, I do get like 5-min bootup times after a reboot, but it doesn't happen consistently. |
@XhmikosR the most simple solution is to check the status of log2ram right after reboot by
If it said Make sure that you dont have any script that restarts log2ram. If any they should be in crontabs. If you dont remember setting any of those, the chances are you dont have any. Or you could check the |
Thanks for the reply. It seems Oh, well, it might be another issue then... |
You may need to use sudo to read boot.log Or you could try to reinstall log2ram, but be reminded that all logs, including the archived ones would be gone. Make sure you dont save anything important there. |
I believe my issue was due to RPi-Distro/raspberrypi-net-mods#6. So, I was getting aprox. 90-100 seconds boot delay due to that and not due to log2ram. Sorry for the mixup, I was trying to pinpoint the cause :) EDIT: now booting is down to 15s for a headless system. |
@azlux I have an idea. Maybe log2ram was configured to start before zram, so it tried to write to a non-existing drive? |
Can you check the zram service on your system ? |
It looks like this now. How should I modify it? I dont quite understand... Also, I think I set up |
That was not the question. |
I had the same problem. |
@clavay sudo systemctl --type=service | grep zram
I dont have a broken log2ram install for testing currently. |
This fix should help with your issue : 6ee7907 To test the fix before I release next version, you can make the same modification than the commit on this file : /etc/systemd/system/log2ram.service |
@azlux no, that does nothing. Maybe you could try setting up /var/www/html as another log2ram to test it urself |
As I don't have zram installed I don't see the difference. |
zram must be causing some problem. I remember not using log2ram with zram before, and nothing special happened. Zram is working properly. Is there any debugging flags for log2ram to use? Like logging the current state? For example logging "waiting for zram to start" or "starting service at [unix timestamp]"? |
I think it's not related to zram but having more than one directory in log2ram conf. |
Maybe both?
Triggering the bug is not entirely obvious yet. I suppose it was due to some apt updates? Sometimes after a apt update I got this bug, but I seldom reboots anyway, so I am not sure. I think it was waiting for something for too long, so including the time for copying files exceeds the 120s limit? If so what is hanging it off? Mounting the disks? Maybe it log2ram isnt designed for more than 1 dir, so the service file does not add the second dir? |
Looking at the service file, shouldnt log2ram starts after zram? If so, why that isnt marked as Looking at the services, i see these services related to zram
The status of The
|
Happy new 2022 first and many thanks for the great tool - I am really addicted to it :) Wanted to ask if any updates here? Jan 1 12:20:38 raspberrypi systemd[1]: Startup finished in 5.246s (kernel) + 2min 39.356s (userspace) = 2min 44.603s. root@raspberrypi[~] # systemctl status log2ram log2ram 144M 33M 112M 23% /var/log Dec 31 11:42:50 raspberrypi log2ram[276]: unattended-upgrades/unattended-upgrades-shutdown.log.2.gz dmesg start manually log2ram 144M 33M 112M 23% /var/hdd.log apt list log2ram Problem is I cant fresh install log2ram, afterwards most of the logs in /var/log are gone My log2ram.conf: Help here is really needed and appreciated Thx, |
Jan 1 12:20:38 raspberrypi systemd[1]: Startup finished in 5.246s (kernel) + 2min 39.356s (userspace) = 2min 44.603s disabling server log2ram: I am runnin Debian Buster - Linux 5.10.63-v7+ armv7l, |
add. info: log2ram 144M 35M 110M 24% /var/hdd.log mount | grep -i log2ram so what is causing this startup crash?????? [ 10.819898] systemd[1]: Starting Log2Ram... |
Timeout apprently. Maybe log2ram is waiting for something to set up? But that "something" is also waiting for log2ram? |
I just obverse a strange thing into your output.
Sorry for the delay, coding is a hobby I don't have at the moment. |
Thx for coming back @azlux :) and no worries, really appreciate ur support cat /etc/fstab cat /etc/log2ram.conf | grep PATH_DISK that one is "killing" me :) |
Just my 2cp. In this view I'd suggest to check with This command will generate a nice svg chart of the full systemd boot timings: systemd-analyze plot >bootup.svg And this will tell you the critical path to the final target (it does not include the full dependency tree, but only the dependencies that are actually delaying the path): systemd-analyze critical-chain Also you can specify a unit to the last command, thus if you run
And finally this one will produce a dot format output of the dependencies of log2ram.service: systemd-analyze dot 'log2ram.service' I think the output is already readable, but if you want it is possible to generate an SVG chart of it running the output through dot: systemd-analyze dot 'log2ram.service' | dot -Tsvg >log2ram.svg Note: to be able to render the chart you need the graphviz package. That can be installed with This should help in reducing the number of possible causes. |
I had what I thought was this same issue and found #146 where log2ram errors if you try to use a directory off the root. I had added /tmp to my path list and that was causing the error. Once I removed it the problem went away. Adding the comment in the hope that it narrows down this fix a bit. |
thx for the hint, but my /etc/log2ram.conf in that case looks clean: |
+1 for me. For all of you: try to start a failed log2ram-boot via Another hint: just restarting log2ram often doesn't solve the mount problem of /log into zram. A I've got two SVGs (faild and ok) but didn't find any hint to an error (but the root cause may be invisible for my knowledge). But according to my experience it seems to be a systemd dependency that is yet unresolved and is triggered by timing constellations that may vary from boot to boot / device to device. |
I digged a little bit deeper and now I can confirm that the rsync call in |
I would love to find a fix on this. I disabled log2ram and start it manually once it's all booted up. I run /var/mysql as a second directory to the default /var/log. However, I need to restart mariadb otherwise it writes into some kind of void and not to ram or the mysql.hdd/ When the power gets cut, it seems like I have half my database, but a few tables that resort back to when I set everything up before log2ram... this is probably the software that's writing to the database instead of log2ram, but it's behaviour is linked to having to start log2ram manually after the database is already loaded. How can we use more than 1 directory and have it successful on boot? I love this little piece of software and it's saved my SD card from a strange database rewrite bug that was writing 30+gb to a 32gb sd card daily!! |
Ok... so after looking further into it and following someone's suggestion with cp instead of rsync, and updating to the newest version (which I think is mainly the cp integration). Seems to be all good. Hopefully this will fix the strange database behaviour. |
Device: raspberry pi 4 2GB
kernel: 5.10.63-v7l+
I noticed that my pi took a very long time to reboot. Then I checked that boot.log and found that log2ram failed to start. When I manually restart log2ram by
it worked totally fine.
Then I removed log2ram via the apt method, then installed it again. The problem was gone.
It might be due to an update that I have done 3 days ago as I haven't rebooted since then.
Anyone who thinks that their raspberry pi failed to boot after reboot or just fails to boot should check if they have log2ram installed. If so, be patient and wait for about 5 minutes after power on to see if it boots up. If that is the case, try doing the following:
Then reboot. The first reboot may take longer, wait for at least 5 minutes before aborting. But the second one is fine.
The text was updated successfully, but these errors were encountered: