Bug#1052528: grub-efi-amd64: Loading initial ramdisk... Error: out of memory

Nick serveremail at hallhome.com
Sat Sep 23 23:42:47 BST 2023


Package: grub-efi-amd64
Version: 2.06-13
Severity: important

After upgrading from Debian 11 to Debian 12 I have been getting the
error when booting my system about 2/3 of the times:

Loading initial ramdisk...
error: out of memory

The other 1/3 of the times I boot, it works fine.

The error happens with the 6.1.0-12 kernel as well as 6.1.0-11. I
still have 5.10.0-23 installed and it doesn't seem to happen with
that kernel.

/boot/initrd.img-6.1.0-12-amd64 (which often failed) was 87 MB.
/boot/initrd.img-5.10.0-23-amd64 (which always worked) was 77 MB.

I found this Ubuntu bug report which shares a lot of similarities:

https://bugs.launchpad.net/oem-priority/+bug/1842320

Similar to others in that bug report, my system is a Dell XPS 9550
with 32 GB of RAM. It has a 4k screen and the nvidia drivers.

Following the advice on that bug report, I checked my
/etc/initramfs-tools/initramfs.conf and found that I was
using "COMPRESS=zstd"

I changed this to "COMPRESS=xz" and "COMPRESSLEVEL=9" and ran
update-initramfs -c to rebuild this kernel's initrd.img.

After doing so, /boot/initrd.img-6.1.0-12-amd64 was compressed
down to 64 MB.

I rebooted the system about 8 times after that and it booted
successfully each time, so I believe this workaround worked.

So it seems like there is a problem booting with initrd.img files
that are bigger than somewhere around 77-87 MB. I'm not sure why
it would sometimes work, though.

-- Package-specific info:


*********************** BEGIN /boot/grub/grub.cfg
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
  set have_grubenv=true
  load_env
fi
if [ "${next_entry}" ] ; then
   set default="${next_entry}"
   set next_entry=
   save_env next_entry
   set boot_once=true
else
   set default="0"
fi

if [ x"${feature_menuentry_id}" = xy ]; then
  menuentry_id_option="--id"
else
  menuentry_id_option=""
fi

export menuentry_id_option

if [ "${prev_saved_entry}" ]; then
  set saved_entry="${prev_saved_entry}"
  save_env saved_entry
  set prev_saved_entry=
  save_env prev_saved_entry
  set boot_once=true
fi

function savedefault {
  if [ -z "${boot_once}" ]; then
    saved_entry="${chosen}"
    save_env saved_entry
  fi
}
function load_video {
  if [ x$feature_all_video_module = xy ]; then
    insmod all_video
  else
    insmod efi_gop
    insmod efi_uga
    insmod ieee1275_fb
    insmod vbe
    insmod vga
    insmod video_bochs
    insmod video_cirrus
  fi
}

if [ x$feature_default_font_path = xy ] ; then
   font=unicode
else
insmod part_gpt
insmod zfs
search --no-floppy --fs-uuid --set=root 0499156567a2c9a6
    font="/BOOT/debian@/grub/unicode.pf2"
fi

if loadfont $font ; then
  set gfxmode=1280x1024x32
  load_video
  insmod gfxterm
  set locale_dir=$prefix/locale
  set lang=en_US
  insmod gettext
fi
terminal_output gfxterm
if [ "${recordfail}" = 1 ] ; then
  set timeout=30
else
  if [ x$feature_timeout_style = xy ] ; then
    set timeout_style=menu
    set timeout=5
  # Fallback normal timeout code in case the timeout_style feature is
  # unavailable.
  else
    set timeout=5
  fi
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
insmod part_gpt
insmod zfs
search --no-floppy --fs-uuid --set=root 0499156567a2c9a6
insmod png
if background_image /BOOT/debian@/grub/.background_cache.png; then
  set color_normal=white/black
  set color_highlight=black/white
else
  set menu_color_normal=cyan/blue
  set menu_color_highlight=white/blue
fi
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
function gfxmode {
	set gfxpayload="${1}"
}
set linux_gfx_mode=
export linux_gfx_mode
menuentry 'Debian GNU/Linux' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-/dev/nvme0n1p7' {
	load_video
	insmod gzio
	if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
	insmod part_gpt
	insmod zfs
	search --no-floppy --fs-uuid --set=root 0499156567a2c9a6
	echo	'Loading Linux 6.1.0-12-amd64 ...'
	linux	/BOOT/debian@/vmlinuz-6.1.0-12-amd64 root=ZFS=/ROOT/debian ro root=ZFS=rpool/ROOT/debian root=ZFS=rpool/ROOT/debian 
	echo	'Loading initial ramdisk ...'
	initrd	/BOOT/debian@/initrd.img-6.1.0-12-amd64
}
submenu 'Advanced options for Debian GNU/Linux' $menuentry_id_option 'gnulinux-advanced-/dev/nvme0n1p7' {
	menuentry 'Debian GNU/Linux, with Linux 6.1.0-12-amd64' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-6.1.0-12-amd64-advanced-/dev/nvme0n1p7' {
		load_video
		insmod gzio
		if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
		insmod part_gpt
		insmod zfs
		search --no-floppy --fs-uuid --set=root 0499156567a2c9a6
		echo	'Loading Linux 6.1.0-12-amd64 ...'
		linux	/BOOT/debian@/vmlinuz-6.1.0-12-amd64 root=ZFS=/ROOT/debian ro root=ZFS=rpool/ROOT/debian root=ZFS=rpool/ROOT/debian 
		echo	'Loading initial ramdisk ...'
		initrd	/BOOT/debian@/initrd.img-6.1.0-12-amd64
	}
	menuentry 'Debian GNU/Linux, with Linux 6.1.0-12-amd64 (recovery mode)' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-6.1.0-12-amd64-recovery-/dev/nvme0n1p7' {
		load_video
		insmod gzio
		if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
		insmod part_gpt
		insmod zfs
		search --no-floppy --fs-uuid --set=root 0499156567a2c9a6
		echo	'Loading Linux 6.1.0-12-amd64 ...'
		linux	/BOOT/debian@/vmlinuz-6.1.0-12-amd64 root=ZFS=/ROOT/debian ro single root=ZFS=rpool/ROOT/debian root=ZFS=rpool/ROOT/debian
		echo	'Loading initial ramdisk ...'
		initrd	/BOOT/debian@/initrd.img-6.1.0-12-amd64
	}
	menuentry 'Debian GNU/Linux, with Linux 5.10.0-23-amd64' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.10.0-23-amd64-advanced-/dev/nvme0n1p7' {
		load_video
		insmod gzio
		if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
		insmod part_gpt
		insmod zfs
		search --no-floppy --fs-uuid --set=root 0499156567a2c9a6
		echo	'Loading Linux 5.10.0-23-amd64 ...'
		linux	/BOOT/debian@/vmlinuz-5.10.0-23-amd64 root=ZFS=/ROOT/debian ro root=ZFS=rpool/ROOT/debian root=ZFS=rpool/ROOT/debian 
		echo	'Loading initial ramdisk ...'
		initrd	/BOOT/debian@/initrd.img-5.10.0-23-amd64
	}
	menuentry 'Debian GNU/Linux, with Linux 5.10.0-23-amd64 (recovery mode)' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.10.0-23-amd64-recovery-/dev/nvme0n1p7' {
		load_video
		insmod gzio
		if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
		insmod part_gpt
		insmod zfs
		search --no-floppy --fs-uuid --set=root 0499156567a2c9a6
		echo	'Loading Linux 5.10.0-23-amd64 ...'
		linux	/BOOT/debian@/vmlinuz-5.10.0-23-amd64 root=ZFS=/ROOT/debian ro single root=ZFS=rpool/ROOT/debian root=ZFS=rpool/ROOT/debian
		echo	'Loading initial ramdisk ...'
		initrd	/BOOT/debian@/initrd.img-5.10.0-23-amd64
	}
}

### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/10_linux_proxy ###

function gfxmode {
	set gfxpayload="${1}"
}
set linux_gfx_mode=
export linux_gfx_mode



### END /etc/grub.d/10_linux_proxy ###

### BEGIN /etc/grub.d/20_linux_xen ###

### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/30_uefi-firmware ###
menuentry 'UEFI Firmware Settings' $menuentry_id_option 'uefi-firmware' {
	fwsetup
}
### END /etc/grub.d/30_uefi-firmware ###

### BEGIN /etc/grub.d/33_linux_proxy ###
menuentry "Debian GNU/Linux" --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-/dev/nvme0n1p7' {
	load_video
	insmod gzio
	if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
	insmod part_gpt
	insmod zfs
	search --no-floppy --fs-uuid --set=root 0499156567a2c9a6
	echo	'Loading Linux 6.1.0-12-amd64 ...'
	linux	/BOOT/debian@/vmlinuz-6.1.0-12-amd64 root=ZFS=/ROOT/debian ro root=ZFS=rpool/ROOT/debian root=ZFS=rpool/ROOT/debian 
	echo	'Loading initial ramdisk ...'
	initrd	/BOOT/debian@/initrd.img-6.1.0-12-amd64
}
submenu "Advanced options for Debian GNU/Linux"{
menuentry "Debian GNU/Linux, with Linux 6.1.0-12-amd64" --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-6.1.0-12-amd64-advanced-/dev/nvme0n1p7' {
		load_video
		insmod gzio
		if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
		insmod part_gpt
		insmod zfs
		search --no-floppy --fs-uuid --set=root 0499156567a2c9a6
		echo	'Loading Linux 6.1.0-12-amd64 ...'
		linux	/BOOT/debian@/vmlinuz-6.1.0-12-amd64 root=ZFS=/ROOT/debian ro root=ZFS=rpool/ROOT/debian root=ZFS=rpool/ROOT/debian 
		echo	'Loading initial ramdisk ...'
		initrd	/BOOT/debian@/initrd.img-6.1.0-12-amd64
}
menuentry "Debian GNU/Linux, with Linux 6.1.0-12-amd64 (recovery mode)" --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-6.1.0-12-amd64-recovery-/dev/nvme0n1p7' {
		load_video
		insmod gzio
		if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
		insmod part_gpt
		insmod zfs
		search --no-floppy --fs-uuid --set=root 0499156567a2c9a6
		echo	'Loading Linux 6.1.0-12-amd64 ...'
		linux	/BOOT/debian@/vmlinuz-6.1.0-12-amd64 root=ZFS=/ROOT/debian ro single root=ZFS=rpool/ROOT/debian root=ZFS=rpool/ROOT/debian
		echo	'Loading initial ramdisk ...'
		initrd	/BOOT/debian@/initrd.img-6.1.0-12-amd64
}
menuentry "Debian GNU/Linux, with Linux 5.10.0-23-amd64" --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.10.0-23-amd64-advanced-/dev/nvme0n1p7' {
		load_video
		insmod gzio
		if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
		insmod part_gpt
		insmod zfs
		search --no-floppy --fs-uuid --set=root 0499156567a2c9a6
		echo	'Loading Linux 5.10.0-23-amd64 ...'
		linux	/BOOT/debian@/vmlinuz-5.10.0-23-amd64 root=ZFS=/ROOT/debian ro root=ZFS=rpool/ROOT/debian root=ZFS=rpool/ROOT/debian 
		echo	'Loading initial ramdisk ...'
		initrd	/BOOT/debian@/initrd.img-5.10.0-23-amd64
}
menuentry "Debian GNU/Linux, with Linux 5.10.0-23-amd64 (recovery mode)" --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.10.0-23-amd64-recovery-/dev/nvme0n1p7' {
		load_video
		insmod gzio
		if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
		insmod part_gpt
		insmod zfs
		search --no-floppy --fs-uuid --set=root 0499156567a2c9a6
		echo	'Loading Linux 5.10.0-23-amd64 ...'
		linux	/BOOT/debian@/vmlinuz-5.10.0-23-amd64 root=ZFS=/ROOT/debian ro single root=ZFS=rpool/ROOT/debian root=ZFS=rpool/ROOT/debian
		echo	'Loading initial ramdisk ...'
		initrd	/BOOT/debian@/initrd.img-5.10.0-23-amd64
}
}
### END /etc/grub.d/33_linux_proxy ###

### BEGIN /etc/grub.d/34_linux_xen ###

### END /etc/grub.d/34_linux_xen ###

### BEGIN /etc/grub.d/35_fwupd ###
### END /etc/grub.d/35_fwupd ###

### BEGIN /etc/grub.d/35_uefi-firmware ###
### END /etc/grub.d/35_uefi-firmware ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f  ${config_directory}/custom.cfg ]; then
  source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f  $prefix/custom.cfg ]; then
  source $prefix/custom.cfg
fi
### END /etc/grub.d/41_custom ###
*********************** END /boot/grub/grub.cfg

*********************** BEGIN /proc/mdstat
cat: /proc/mdstat: No such file or directory
*********************** END /proc/mdstat

*********************** BEGIN /dev/disk/by-id
total 0
lrwxrwxrwx 1 root root 13 Sep 23 16:56 nvme-THNSN51T02DU7_NVMe_TOSHIBA_1024GB_________56BS10HYT61V -> ../../nvme0n1
lrwxrwxrwx 1 root root 15 Sep 23 16:56 nvme-THNSN51T02DU7_NVMe_TOSHIBA_1024GB_________56BS10HYT61V-part1 -> ../../nvme0n1p1
lrwxrwxrwx 1 root root 15 Sep 23 16:56 nvme-THNSN51T02DU7_NVMe_TOSHIBA_1024GB_________56BS10HYT61V-part2 -> ../../nvme0n1p2
lrwxrwxrwx 1 root root 15 Sep 23 16:56 nvme-THNSN51T02DU7_NVMe_TOSHIBA_1024GB_________56BS10HYT61V-part3 -> ../../nvme0n1p3
lrwxrwxrwx 1 root root 15 Sep 23 16:56 nvme-THNSN51T02DU7_NVMe_TOSHIBA_1024GB_________56BS10HYT61V-part4 -> ../../nvme0n1p4
lrwxrwxrwx 1 root root 15 Sep 23 16:56 nvme-THNSN51T02DU7_NVMe_TOSHIBA_1024GB_________56BS10HYT61V-part5 -> ../../nvme0n1p5
lrwxrwxrwx 1 root root 15 Sep 23 16:56 nvme-THNSN51T02DU7_NVMe_TOSHIBA_1024GB_________56BS10HYT61V-part6 -> ../../nvme0n1p6
lrwxrwxrwx 1 root root 15 Sep 23 16:56 nvme-THNSN51T02DU7_NVMe_TOSHIBA_1024GB_________56BS10HYT61V-part7 -> ../../nvme0n1p7
lrwxrwxrwx 1 root root 15 Sep 23 16:56 nvme-THNSN51T02DU7_NVMe_TOSHIBA_1024GB_________56BS10HYT61V-part8 -> ../../nvme0n1p8
lrwxrwxrwx 1 root root 13 Sep 23 16:56 nvme-THNSN51T02DU7_NVMe_TOSHIBA_1024GB_________56BS10HYT61V_1 -> ../../nvme0n1
lrwxrwxrwx 1 root root 15 Sep 23 16:56 nvme-THNSN51T02DU7_NVMe_TOSHIBA_1024GB_________56BS10HYT61V_1-part1 -> ../../nvme0n1p1
lrwxrwxrwx 1 root root 15 Sep 23 16:56 nvme-THNSN51T02DU7_NVMe_TOSHIBA_1024GB_________56BS10HYT61V_1-part2 -> ../../nvme0n1p2
lrwxrwxrwx 1 root root 15 Sep 23 16:56 nvme-THNSN51T02DU7_NVMe_TOSHIBA_1024GB_________56BS10HYT61V_1-part3 -> ../../nvme0n1p3
lrwxrwxrwx 1 root root 15 Sep 23 16:56 nvme-THNSN51T02DU7_NVMe_TOSHIBA_1024GB_________56BS10HYT61V_1-part4 -> ../../nvme0n1p4
lrwxrwxrwx 1 root root 15 Sep 23 16:56 nvme-THNSN51T02DU7_NVMe_TOSHIBA_1024GB_________56BS10HYT61V_1-part5 -> ../../nvme0n1p5
lrwxrwxrwx 1 root root 15 Sep 23 16:56 nvme-THNSN51T02DU7_NVMe_TOSHIBA_1024GB_________56BS10HYT61V_1-part6 -> ../../nvme0n1p6
lrwxrwxrwx 1 root root 15 Sep 23 16:56 nvme-THNSN51T02DU7_NVMe_TOSHIBA_1024GB_________56BS10HYT61V_1-part7 -> ../../nvme0n1p7
lrwxrwxrwx 1 root root 15 Sep 23 16:56 nvme-THNSN51T02DU7_NVMe_TOSHIBA_1024GB_________56BS10HYT61V_1-part8 -> ../../nvme0n1p8
lrwxrwxrwx 1 root root 13 Sep 23 16:56 nvme-eui.00080d020007672a -> ../../nvme0n1
lrwxrwxrwx 1 root root 15 Sep 23 16:56 nvme-eui.00080d020007672a-part1 -> ../../nvme0n1p1
lrwxrwxrwx 1 root root 15 Sep 23 16:56 nvme-eui.00080d020007672a-part2 -> ../../nvme0n1p2
lrwxrwxrwx 1 root root 15 Sep 23 16:56 nvme-eui.00080d020007672a-part3 -> ../../nvme0n1p3
lrwxrwxrwx 1 root root 15 Sep 23 16:56 nvme-eui.00080d020007672a-part4 -> ../../nvme0n1p4
lrwxrwxrwx 1 root root 15 Sep 23 16:56 nvme-eui.00080d020007672a-part5 -> ../../nvme0n1p5
lrwxrwxrwx 1 root root 15 Sep 23 16:56 nvme-eui.00080d020007672a-part6 -> ../../nvme0n1p6
lrwxrwxrwx 1 root root 15 Sep 23 16:56 nvme-eui.00080d020007672a-part7 -> ../../nvme0n1p7
lrwxrwxrwx 1 root root 15 Sep 23 16:56 nvme-eui.00080d020007672a-part8 -> ../../nvme0n1p8
*********************** END /dev/disk/by-id

*********************** BEGIN /dev/disk/by-uuid
total 0
lrwxrwxrwx 1 root root 15 Sep 23 16:56 022EF9D22EF9BEAB -> ../../nvme0n1p5
lrwxrwxrwx 1 root root 15 Sep 23 16:56 331319572863044006 -> ../../nvme0n1p4
lrwxrwxrwx 1 root root 15 Sep 23 16:56 57fc8c0a-b7dd-4e19-92ff-38b81db268d6 -> ../../nvme0n1p8
lrwxrwxrwx 1 root root 15 Sep 23 16:56 836735595572510776 -> ../../nvme0n1p7
lrwxrwxrwx 1 root root 15 Sep 23 16:56 920CC74A0CC72855 -> ../../nvme0n1p3
lrwxrwxrwx 1 root root 15 Sep 23 16:56 9AE2DBE2E2DBC125 -> ../../nvme0n1p6
lrwxrwxrwx 1 root root 15 Sep 23 16:56 F8E4-FDA9 -> ../../nvme0n1p1
lrwxrwxrwx 1 root root  9 Sep 23 16:56 faa8565d-b038-46e5-90d0-7821103f7000 -> ../../zd0
*********************** END /dev/disk/by-uuid

-- System Information:
Debian Release: 12.1
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable-security'), (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 6.1.0-12-amd64 (SMP w/8 CPU threads; PREEMPT)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_USER, TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages grub-efi-amd64 depends on:
ii  debconf [debconf-2.0]  1.5.82
ii  grub-common            2.06-13
ii  grub-efi-amd64-bin     2.06-13
ii  grub2-common           2.06-13
ii  ucf                    3.0043+nmu1

grub-efi-amd64 recommends no packages.

grub-efi-amd64 suggests no packages.

-- debconf information:
  grub2/enable_os_prober: false
  grub2/linux_cmdline_default:
  grub2/update_nvram: true
  grub2/force_efi_extra_removable: false
  grub2/kfreebsd_cmdline_default: quiet
  grub2/linux_cmdline: root=ZFS=rpool/ROOT/debian root=ZFS=rpool/ROOT/debian
  grub2/kfreebsd_cmdline:



More information about the Pkg-grub-devel mailing list