-
Notifications
You must be signed in to change notification settings - Fork 210
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
memory overflow using overlayfs with 256 MB rpi #220
Comments
This area of raspi-config is going to change a lot in bookworm. For now, I think the right thing to do is to disable dphys-swapfile altogether before enabling overlayfs. One problem with adding that fix to bullseye is that we don't know whether the user wants dphys-swapfile enabled. You could end up re-enabling it in situations where the user has previously disabled it manually. If you have a PR that deals with this without being too convoluted, I could take a look at merging it for bullseye, after bookworm is out. |
I agree that disabling dphys-swapfile upon enabling overlay fs is better than reducing swap file size as I did. I also agree that a potential problem is to know whether to enable swap file at the time overlay is disabled. There are two ways I see to deal with this.
Alt 1 might be seen as convoluted, but I think it is the most upfront alternative and I think it could be integrated with the boot partition option as a checklist to reduce number of key presses for the user. The second option is ok from my perspective but I don't know how it is viewed upon to write pkg state information. There might be unforseen consequences with this, but shouldn't be, I think. I also think a message should be added in the dialog for disabling overlay fs that the swap file will be disabled. This will make it less confusing in the enable overlay dialog that swap is mentioned. For alt 2, I think a message indicating enabling of swap is good. |
It seems to me that when overlayfs is enabled, dphys-swapfile service fails regardless, possibly because overlayroot disables swap by default. At least after enabling overlayfs, I observed that there is just no swap in I think it would be good for the script to automatically disable |
Is this on bullseye, bookworm or both? |
Mine is currently on bookworm. I haven't tested bullseye. |
Since you have to boot the pi to enable overlayroot, the swap file gets generated on the actual underlying filesystem. It fails to activate, but the file's presence shouldn't be eating any actual RAM. Yeah, it's not ideal and worth a re-visit next time that area of raspi-config is updated, but it doesn't seem like it causes any actual problems. Or am I missing something? |
That is true.
But this is not. The file definitely appears in the upper filesystem as well. It seems when dphys-swapfile calls This is what I see on my machine:
At least according to |
Oh right, then yeah that's definitely not great. I'll update dphys-swapfile so that it doesn't try to do any of this nonsense. Many thanks for checking |
Just uploaded a new version which seems to work for me. |
@XECDesign Where do you upload the new version? There doesn't seem to be any new commit in this repo. |
It's a change to the dphys-swapfile package. |
For a Raspberry Pi with 256 MB memory, enabling overlayfs causes memory to run out. This causes the boot log to get stuck at the following line (connecting via serial).
[ 19.198210] systemd[1]: Started Journal Service.
The sum of allocated mem is 183496 kB, see below, and the swap file size is 100 MB. When overlay fs is used, the 100 MB of swap will be allocated on the overlay tmpfs, causing the minimum ram requirement to be 184+100=284MB, which is more than what is available.
The issue can be resolved through the following steps (tested on a Raspberry Pi Model B from 2011).
I would appreciate if this gets fixed because I have spent many hours debugging this. I can submit a pull request for the fix if that is wanted, but I cannot test it on any other hardware. I am attaching the boot log.
boot_initrd_raspi_overlay.log
The text was updated successfully, but these errors were encountered: