You are not logged in.

#1 2022-08-26 19:16:31

ihitmani
Member
Registered: 2021-05-03
Posts: 83

[SOLVED]grub takes too long to boot nvme ssd

Kernel and initramfs loading just takes too much time:
Startup finished in 3.933s (firmware) + 18.245s (loader) + 2.088s (kernel) + 853ms (userspace) = 25.120s
grub config:

#
# 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 ###
insmod part_gpt
insmod part_msdos
if [ -s $prefix/grubenv ]; then
  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
}

terminal_input console
terminal_output console
if [ x$feature_timeout_style = xy ] ; then
  set timeout_style=menu
  set timeout=0
# Fallback normal timeout code in case the timeout_style feature is
# unavailable.
else
  set timeout=0
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Arch Linux' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-4fe2bdc0-a2bb-4311-ba12-a386a4100f70' {
	load_video
	set gfxpayload=keep
	insmod gzio
	insmod part_gpt
	insmod fat
	set root='hd0,gpt5'
	if [ x$feature_platform_search_hint = xy ]; then
	  search --no-floppy --fs-uuid --set=root --hint-ieee1275='ieee1275//disk@0,gpt5' --hint-bios=hd0,gpt5 --hint-efi=hd0,gpt5 --hint-baremetal=ahci0,gpt5 3CD6-FC42 #28FD-A656 #0F37-5012
	else
	  search --no-floppy --fs-uuid --set=root 3CD6-FC42 #28FD-A656 #0F37-5012
	fi
	echo	'grub working...'
	linux	/vmlinuz-linux root=/dev/nvme0n1p2 rootfstype=ext4 rootflags=rw,relatime,commit=60 ibt=off libahci.ignore_sss=1 vt.global_cursor_default=0 raid=noautodetect rw nmi_watchdog=0 vga=current noresume net.ifnames=0 spectre_v2=off nospectre_v1 nospectre_v2 nopti pti=off l1tf=off mds=off audit=0 nospec_store_bypass_disable no_stf_barrier noibrs noibpb noretpoline mitigations=off loglevel=2 rd.systemd.show_status=auto rd.udev.log_priority=2
#	linux	/vmlinuz-linux root=UUID=4fe2bdc0-a2bb-4311-ba12-a386a4100f70 rw nmi_watchdog=0 quiet noresume net.ifnames=0 intel.iommu=off spectre_v2=off nospectre_v1 nospectre_v2 nopti pti=off l1tf=off mds=off audit=0 nospec_store_bypass_disable no_stf_barrier noibrs noibpb noretpoline intel_idle.max_cstate=0 mitigations=off i915.enable_psr=0 i915.enable_fbc=1 i915.enable_guc=3 i915.enable_gvt=0 i915.fastboot=1 i915.enable_ips=0 drm.atomic=1 i915.nuclear_pageflip=1 loglevel=2 rd.systemd.show_status=auto rd.udev.log_priority=2
#	linux	/vmlinuz-linux 
	echo	'Loading initial ramdisk ...'
	initrd	/initramfs-linux.img
}
submenu 'Advanced options for Arch Linux' $menuentry_id_option 'gnulinux-advanced-4fe2bdc0-a2bb-4311-ba12-a386a4100f70' {
	menuentry 'Arch Linux, with Linux linux' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-advanced-4fe2bdc0-a2bb-4311-ba12-a386a4100f70' {
		load_video
		set gfxpayload=keep
		insmod gzio
		insmod part_gpt
		insmod fat
		set root='hd0,gpt5'
		if [ x$feature_platform_search_hint = xy ]; then
		  search --no-floppy --fs-uuid --set=root --hint-ieee1275='ieee1275//disk@0,gpt5' --hint-bios=hd0,gpt5 --hint-efi=hd0,gpt5 --hint-baremetal=ahci0,gpt5  28FD-a656 #0F37-5012
		else
		  search --no-floppy --fs-uuid --set=root 0F37-5012
		fi
		echo	'Loading Linux linux ...'
		linux	/vmlinuz-linux root=UUID=4fe2bdc0-a2bb-4311-ba12-a386a4100f70 rw  nmi_watchdog=0 net.ifnames=0
		echo	'Loading initial ramdisk ...'
		initrd	/initramfs-linux.img
	}
	menuentry 'Arch Linux, with Linux linux (fallback initramfs)' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-fallback-4fe2bdc0-a2bb-4311-ba12-a386a4100f70' {
		load_video
		set gfxpayload=keep
		insmod gzio
		insmod part_gpt
		insmod fat
		set root='hd0,gpt5'
		if [ x$feature_platform_search_hint = xy ]; then
		  search --no-floppy --fs-uuid --set=root --hint-ieee1275='ieee1275//disk@0,gpt5' --hint-bios=hd0,gpt5 --hint-efi=hd0,gpt5 --hint-baremetal=ahci0,gpt5  0F37-5012
		else
		  search --no-floppy --fs-uuid --set=root 0F37-5012
		fi
		echo	'Loading Linux linux ...'
		linux	/vmlinuz-linux root=UUID=4fe2bdc0-a2bb-4311-ba12-a386a4100f70 rw  nmi_watchdog=0 net.ifnames=0 quiet
		echo	'Loading initial ramdisk ...'
		initrd	/initramfs-linux-fallback.img
	}
}

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

### 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/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 ###

Last edited by ihitmani (2022-08-27 12:20:11)

Offline

#2 2022-08-27 01:48:09

jonno2002
Member
Registered: 2016-11-21
Posts: 870

Re: [SOLVED]grub takes too long to boot nvme ssd

whats going on here

linux	/vmlinuz-linux root=/dev/nvme0n1p2 rootfstype=ext4 rootflags=rw,relatime,commit=60 ibt=off libahci.ignore_sss=1 vt.global_cursor_default=0 raid=noautodetect rw nmi_watchdog=0 vga=current noresume net.ifnames=0 spectre_v2=off nospectre_v1 nospectre_v2 nopti pti=off l1tf=off mds=off audit=0 nospec_store_bypass_disable no_stf_barrier noibrs noibpb noretpoline mitigations=off loglevel=2 rd.systemd.show_status=auto rd.udev.log_priority=2

im pretty sure you have at least one error there like " rootflags=rw,relatime,commit=60 " and probably more.
try generating a clean grub config using defaults and see if that speeds things up, you may have to revert changes youve made to /etc/default/grub

EDIT: nope that is not an error

Last edited by jonno2002 (2022-08-27 01:53:21)

Offline

#3 2022-08-27 08:11:22

ihitmani
Member
Registered: 2021-05-03
Posts: 83

Re: [SOLVED]grub takes too long to boot nvme ssd

jonno2002 wrote:

whats going on here

linux	/vmlinuz-linux root=/dev/nvme0n1p2 rootfstype=ext4 rootflags=rw,relatime,commit=60 ibt=off libahci.ignore_sss=1 vt.global_cursor_default=0 raid=noautodetect rw nmi_watchdog=0 vga=current noresume net.ifnames=0 spectre_v2=off nospectre_v1 nospectre_v2 nopti pti=off l1tf=off mds=off audit=0 nospec_store_bypass_disable no_stf_barrier noibrs noibpb noretpoline mitigations=off loglevel=2 rd.systemd.show_status=auto rd.udev.log_priority=2

im pretty sure you have at least one error there like " rootflags=rw,relatime,commit=60 " and probably more.
try generating a clean grub config using defaults and see if that speeds things up, you may have to revert changes youve made to /etc/default/grub

EDIT: nope that is not an error

I tried to do that, it did not work, so I took config from another machine, that does not have such problem, and it still did not help, so problem is in something else but not config....

Offline

#4 2022-08-27 10:09:39

Hamsterkill
Member
Registered: 2009-05-05
Posts: 67

Re: [SOLVED]grub takes too long to boot nvme ssd

Possibly related to this thread: https://bbs.archlinux.org/viewtopic.php?id=279006

Offline

#5 2022-08-27 12:19:24

ihitmani
Member
Registered: 2021-05-03
Posts: 83

Re: [SOLVED]grub takes too long to boot nvme ssd

Hamsterkill wrote:

Possibly related to this thread: https://bbs.archlinux.org/viewtopic.php?id=279006

Reverting to Grub 2.06.r261 fixed my problem.

Offline

Board footer

Powered by FluxBB