Initrd out of memory error after upgrade to 22.04

Bug #1970402 reported by Michal Zubkowicz
166
This bug affects 33 people
Affects Status Importance Assigned to Milestone
initramfs-tools
New
Undecided
Unassigned
initramfs-tools (Ubuntu)
Confirmed
High
Unassigned
Jammy
Confirmed
High
Unassigned

Bug Description

After upgrading to 22.04 system is unbootable because of "out of memory" error when loading initial ramdisk. I was able to fix it by editing cat /etc/initramfs-tools/initramfs.conf
and changing configuration to:
MODULES=dep
COMPRESS=xz
RUNSIZE=15%

Not sure which one helped, but I can test it if needed.

System information:
Description: Ubuntu 22.04 LTS
Release: 22.04

initramfs-tools:
  Installed: 0.140ubuntu13
  Candidate: 0.140ubuntu13
  Version table:
 *** 0.140ubuntu13 500
        500 http://pl.archive.ubuntu.com/ubuntu jammy/main amd64 Packages
        500 http://pl.archive.ubuntu.com/ubuntu jammy/main i386 Packages
        100 /var/lib/dpkg/status

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. It seems that your bug report is not filed about a specific source package though, rather it is just filed against Ubuntu in general. It is important that bug reports be filed about source packages so that people interested in the package can find the bugs about it. You can find some hints about determining what package your bug might be about at https://wiki.ubuntu.com/Bugs/FindRightPackage. You might also ask for help in the #ubuntu-bugs irc channel on Libera.chat.

To change the source package that this bug is filed about visit https://bugs.launchpad.net/ubuntu/+bug/1970402/+editstatus and add the package name in the text box next to the word Package.

[This is an automated message. I apologize if it reached you inappropriately; please just reply to this message indicating so.]

tags: added: bot-comment
affects: ubuntu → initramfs-tools (Ubuntu)
tags: added: rls-jj-incoming
Revision history for this message
Heinrich Schuchardt (xypron) wrote :

How much memory does your machine have? How big was the extracted initramfs?

Changed in initramfs-tools (Ubuntu):
status: New → Incomplete
Changed in initramfs-tools (Ubuntu):
importance: Undecided → High
Revision history for this message
Michal Zubkowicz (michalzubkowicz) wrote :

I've got 16GB of RAM. It's a pretty new laptop - LG Gram 17Z90p

Before my changes initrd had size 118MB, after changes: 27MB.
file command output was: ASCII cpio archive (SVR4 with no CRC)

Revision history for this message
Edgardo Marchi (edgardo-marchi) wrote :

I can confirm this issue after upgrading from 21.10 to 22.04.
In my case, the fix only comprised changing MODULES=most for MODULES=dep in /etc/initramfs-tools/initramfs.conf. Changing the compression algorithm doesn't seem to have impact on my setup.
Before the change, initrd had 234 MiB in size versus 106 MiB after. I have 64GB of RAM.

Revision history for this message
Michal Zubkowicz (michalzubkowicz) wrote :

I've checked it - compression setting was also not taken into account on my installation.

Revision history for this message
Edgardo Marchi (edgardo-marchi) wrote :

Attached apport information

Revision history for this message
Rich Johnson (nixternal) wrote (last edit ):

I'm also experiencing the Out of Memory error on a fresh install of Ubuntu Server 22.04 on an Intel NUC BXNUC10i5FNK1 with 8GB of memory. After pressing any key it boots to a kernel panic stating not syncing VFS, unable to mount root fs.

I changed only COMPRESS to gzip and it worked.

Lukas Märdian (slyon)
tags: added: fr-2355
tags: removed: fr-2355 rls-jj-incoming
Revision history for this message
Mar Kus (ubuntukus) wrote :

Save behavior after upgrading from 21.10 to 22.04 system is unbootable because of "out of memory".
Live image Ubuntu 21.10 still works (btw. Fedora 36 beta works too).
Live image Ubuntu 22.04 "out of memory"

Hardware: LG Gram 16Z90P
Ram: 16 GB
Harddisk: 1 TB (Uefi and LUKS disk encryption)

Is there a solution in plan with a new daily ubuntu desktop iso?

Revision history for this message
Ben Lel (lelben) wrote :

I also can’t install it on my i9 12900k system. Some people have suggested that it might help do deactivate TPM but as I am using Windows 11 for gaming this is not an option for me unfortunately. Also on my T14 no problem with TPM! (i5 10310u)

Revision history for this message
Colby Butler (popejamal) wrote :

Running on a laptop with 32GB of RAM. I noticed that my ramdisk was well over 100MB and I was getting this error. I'm not sure what the exact cause is, but I changed these two settings in /etc/initramfs-tools/initramfs.conf to the following values:

MODULES=dep
COMPRESS=lz4 (requires running "sudo apt install lz4" first)

That decreased the size significantly, but it was still over 100MB. I ultimately had to uninstall the proprietary Nvidia driver and now my ramdisk is down to 60MB and I can boot normally.

Revision history for this message
Sébastien Le Callonnec (tychobrailleur) wrote :

I had the same issue compiling a 5.15.36 kernel on Ubuntu 22.04, initrd.img (.tmp) below was causing Out of memory:

-rw-r--r-- 1 root root 13628696 May 23 22:58 initrd.img-5.15.36+
-rw-r--r-- 1 root root 515731970 May 23 22:58 initrd.img-5.15.36+.tmp

Switching MODULES=most (which produced .tmp above) to MODULES=dep in /etc/initramfs-tools/initramfs.conf produced the smaller initrd.img, and fixed the issue.

$ cat /proc/meminfo
MemTotal: 16065036 kB
...

Revision history for this message
Mar Kus (ubuntukus) wrote :

This problem exists still. It looks like to be an "old" problem. https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1842320 describe that grub 2.06 memory management has a problem. http://savannah.gnu.org/bugs/?61058

I can't belive that iso ubuntu 21.10 is booting and working, but for 22.04 is no enduser solution.

Where can we get a fixed iso download with ubuntu 22.04?

Status: Incomplete (what is missing?)

and Unassigned

Revision history for this message
Steve Kowalik (stevenk) wrote :

This bug is actually quite irritating. I've been unable to boot a new laptop using the 22.04 media, *and* after successfully installing 21.10 and then upgrading to 22.04 results in this same error. Editing initramfs.conf to switch to MODULES=dep with cryptsetup and lvm then results in an initramfs that can not mount the root filesystem.

Now, I understand issues like this happen, but initramfs-tools is an integral part of the install, and this bug has received ZERO attention in two months. Surely we can do better.

Changed in initramfs-tools (Ubuntu):
status: Incomplete → Confirmed
tags: added: rls-jj-incoming
Revision history for this message
p (saraswat40) wrote :

If using nvidia drivers, it is impossible to get past this problem by making any kind of changes to initramfs.conf. I tried:
MODULES=dep
COMPRESS=lz4
RUNSIZE=16G

I still get the out of memory. The only way around this is to use nouveau driver.

But then I can't use my nvidia card for machine learning purposes.

Lukas Märdian (slyon)
tags: added: fr-2355
removed: rls-jj-incoming
Changed in initramfs-tools (Ubuntu Jammy):
importance: Undecided → High
status: New → Confirmed
milestone: none → ubuntu-22.04.1
tags: added: jammy kinetic
Revision history for this message
Antoine M (antmfra) wrote :

I guess the problem hasn't been fixed in ubuntu-22.04.1. I'm having the same exact issue when trying to install ubuntu-22.04.1 from USB on a computer with large memory (32GB of RAM).

Revision history for this message
Nicholas Stommel (nstommel) wrote :

I am getting the same error and cannot even boot Ubuntu 22.04.1 from a live USB. I am using an HP Elite Dragonfly G2 with 16GB of RAM. I get an error: out of memory message then a kernel panic. Please fix this, I would very much like to try running Ubuntu but I have to run Fedora 36 instead.

Revision history for this message
Scott Buchanan (inthebrilliantblue) wrote :

I am getting this error on a workstation with 128GB of RAM. Compression does nothing to fix, especially with how big the nvidia driver is.

Revision history for this message
yinpeijun (johnniev5) wrote :

I confirmed that the problem still exists on 22.04.1, please focus on this, thank you.

Revision history for this message
tommes (gondwanadigital) wrote :

Bug present on laptop model HP Pavilion Laptop 15-cs3xxx

tags: added: foundations-todo
Revision history for this message
Salman Hasni (salmanhasni) wrote :

I have the similar issue on LG Gram 16 inch 11 Generation ram 16GB 512SSD

Revision history for this message
Srinath (srinath) wrote :

Workaround: Disable Secure Boot and SGX.

Revision history for this message
nico (tuxibuntu) wrote :

For me Disable Secure Boot and SGX also worked and was able to install it on my nuc pc.
I switched back to fedora 36 as there is no need to disable the Disable Secure Boot and SGX to run or install Fedora.

Revision history for this message
Nivard (niviej) wrote :

Same issue occurs when using Ubuntu live boot 22.04 on a HP Elitebook 850 G8.

Revision history for this message
AndresR (andres-r-reina) wrote :

In case it helps: I just want to add that I had similar issues due to debug symbols present in my kernel modules (15x initrd size).

Revision history for this message
Trip Ericson (rovfan) wrote :

I have an Asus G752VY and encountered this issue when upgrading from Kubuntu 20.04 to 22.04 this morning. Neither my new kernel nor my old one would boot, whether into recovery mode or not. I ended up spending a lot of time figuring out how to fix it through the USB live disk.

While I know this is a bug tracker and not a how-to guide, I'm posting the steps I used to recover because this is one of the first results that comes up in Google for this problem and I'd hope to save others from my hours of frustration this morning. My root partition is on /dev/nvme0n1p1, so you'll need to adjust if yours is elsewhere.

1) Boot USB disk and select Try It.
2) Open a command line.
3) sudo mount /dev/nvme0n1p1 /mnt
4) sudo mount --bind /dev /mnt/dev && sudo mount --bind /proc /mnt/proc && sudo mount --bind /sys /mnt/sys && sudo chroot /mnt
5) Use your favorite command line text editor to edit /etc/initramfs-tools/initramfs.conf as noted above. I used:

MODULES=dep
COMPRESS=xz

6) For safety, I made a backup copy of my existing init file, not that it worked in the first place, but it seemed smart.
7) update-initramfs -c -k all
8) update-grub
9) Reboot system.

With all of that, it booted successfully. Hope it helps someone.

Revision history for this message
José Vélez (jose-velez) wrote :

Workaround: In HP elitebook G8 laptop, the error disappear when you reduce the Video Memory Size to 64 MB in the BIOS setup.

Revision history for this message
bryn1u (m-bryn1u) wrote (last edit ):

Same here i get on 22.10.

Does someone know when this bug will be fixed?? I get the same sh... in 22.04 ubuntu too

Revision history for this message
Eduardo Vicente Wolf Trentini (duwolf) wrote :

I had the same issue
Trip Ericson (rovfan) tutorial solved it.
Thank you so much;

Revision history for this message
TomaszChmielewski (mangoo-wpkg) wrote :

I see the same when booting on Ubuntu 23.04 on LG Gram 17Z90R (32 GB RAM).

Loading initial ramdisk
error: out of memory

Then, it complains something about zstd image being corrupted.

However, after a few seconds, booting continues and everything seems to work correctly.

information type: Public → Public Security
information type: Public Security → Public
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.