You are not logged in.

#1 2023-06-15 20:32:16

synacktic
Member
Registered: 2020-09-13
Posts: 4

[SOLVED]Grub boots straight to Windows

Hi,

Grub always worked fine but for a few days now my System boots straight into Windows 10 without showing the Grub Menu or something first(windows is not my default boot entry). I know grub is being loaded as I let it beep before booting, and I even had it show me the debug output before it threw me right to Win again.
I recently found out that inserting any USB-Stick into the system gives me the wanted behavior of showing me the grub menu where I have the option of then regularly booting arch.
I recreated the grub.cfg( more times now than I could count), reinstalled grub, even with the --removable option - to no effect.

someones got an Idea?

$ lsblk
NAME        MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINTS
sda           8:0    0 465.8G  0 disk  
├─sda1        8:1    0   100M  0 part  
├─sda2        8:2    0    16M  0 part  
├─sda3        8:3    0 465.1G  0 part  
└─sda4        8:4    0   530M  0 part  
sdb           8:16   1 119.5G  0 disk  
├─sdb1        8:17   1   200M  0 part  
└─sdb2        8:18   1 119.3G  0 part  
nvme0n1     259:0    0 476.9G  0 disk  
├─nvme0n1p1 259:1    0   400M  0 part  /boot
├─nvme0n1p2 259:2    0   100M  0 part  /boot/efi
├─nvme0n1p3 259:3    0 475.5G  0 part  
│ └─root    254:0    0 475.5G  0 crypt /home
│                                      /
└─nvme0n1p4 259:4    0   973M  0 part  [SWAP]

win10 is on /dev/sda

$ efibootmgr
BootCurrent: 0000
Timeout: 2 seconds
BootOrder: 0000,0001,0002
Boot0000* grub	HD(2,GPT,0ab4bc6b-325b-2b4e-b031-b9ee1c1f5113,0xc8800,0x32000)/File(\EFI\grub\grubx64.efi)
Boot0001* Windows Boot Manager	HD(1,GPT,875b1282-1550-4ace-9b35-016144a7e8c6,0x800,0x32000)/File(\EFI\MICROSOFT\BOOT\BOOTMGFW.EFI)57494e444f5753000100000088000000780000004200430044004f0042004a004500430054003d007b00390064006500610038003600320063002d0035006300640064002d0034006500370030002d0061006300630031002d006600330032006200330034003400640034003700390035007d00000061000100000010000000040000007fff0400
Boot0002  UEFI: Samsung Flash Drive 1100, Partition 1	PciRoot(0x0)/Pci(0x1,0x3)/Pci(0x0,0x0)/USB(2,0)/HD(1,GPT,235fdc36-3500-4a90-baba-be84179a3aa3,0x28,0x64000)0000424f

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

if loadfont unicode ; then
  set gfxmode=auto
  load_video
  insmod gfxterm
  set locale_dir=$prefix/locale
  set lang=en_IE
  insmod gettext
fi
terminal_output gfxterm
if [ x$feature_timeout_style = xy ] ; then
  set timeout_style=menu
  set timeout=-1
# Fallback normal timeout code in case the timeout_style feature is
# unavailable.
else
  set timeout=-1
fi
play 480 440 1
### 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-527d6022-f1d8-4006-8db7-4974120c842b' {
	load_video
	insmod gzio
	insmod part_gpt
	insmod ext2
	search --no-floppy --fs-uuid --set=root 5fd95908-4398-443c-aac2-e61ef4741d73
	echo	'Loading Linux linux ...'
	linux	/vmlinuz-linux root=UUID=527d6022-f1d8-4006-8db7-4974120c842b rw amd_pstate=active loglevel=3 cryptdevice=UUID=fe424fc0-bf22-4cdd-9fe9-7e38f8a6ebe2:root
	echo	'Loading initial ramdisk ...'
	initrd	/amd-ucode.img /initramfs-linux.img
}
submenu 'Advanced options for Arch Linux' $menuentry_id_option 'gnulinux-advanced-527d6022-f1d8-4006-8db7-4974120c842b' {
	menuentry 'Arch Linux, with Linux linux' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-advanced-527d6022-f1d8-4006-8db7-4974120c842b' {
		load_video
		insmod gzio
		insmod part_gpt
		insmod ext2
		search --no-floppy --fs-uuid --set=root 5fd95908-4398-443c-aac2-e61ef4741d73
		echo	'Loading Linux linux ...'
		linux	/vmlinuz-linux root=UUID=527d6022-f1d8-4006-8db7-4974120c842b rw amd_pstate=active loglevel=3 cryptdevice=UUID=fe424fc0-bf22-4cdd-9fe9-7e38f8a6ebe2:root
		echo	'Loading initial ramdisk ...'
		initrd	/amd-ucode.img /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-527d6022-f1d8-4006-8db7-4974120c842b' {
		load_video
		insmod gzio
		insmod part_gpt
		insmod ext2
		search --no-floppy --fs-uuid --set=root 5fd95908-4398-443c-aac2-e61ef4741d73
		echo	'Loading Linux linux ...'
		linux	/vmlinuz-linux root=UUID=527d6022-f1d8-4006-8db7-4974120c842b rw amd_pstate=active loglevel=3 cryptdevice=UUID=fe424fc0-bf22-4cdd-9fe9-7e38f8a6ebe2:root
		echo	'Loading initial ramdisk ...'
		initrd	/amd-ucode.img /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 ###
menuentry 'Windows Boot Manager (on /dev/sda1)' --class windows --class os $menuentry_id_option 'osprober-efi-3E47-44B8' {
	insmod part_gpt
	insmod fat
	set root='hd0,gpt1'
	if [ x$feature_platform_search_hint = xy ]; then
	  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1  3E47-44B8
	else
	  search --no-floppy --fs-uuid --set=root 3E47-44B8
	fi
	chainloader /efi/Microsoft/Boot/bootmgfw.efi
}
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/30_uefi-firmware ###
if [ "$grub_platform" = "efi" ]; then
	fwsetup --is-supported
	if [ "$?" = 0 ]; then
		menuentry 'UEFI Firmware Settings' $menuentry_id_option 'uefi-firmware' {
			fwsetup
		}
	fi
fi
### END /etc/grub.d/30_uefi-firmware ###

Last edited by synacktic (2023-06-16 06:19:44)

Offline

#2 2023-06-15 22:54:33

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,809

Re: [SOLVED]Grub boots straight to Windows

Tried setting the two set timeout=-1 to some positive integer? https://wiki.archlinux.org/title/GRUB#G … wn_at_boot

Last edited by V1del (2023-06-15 22:55:43)

Offline

#3 2023-06-16 06:39:05

synacktic
Member
Registered: 2020-09-13
Posts: 4

Re: [SOLVED]Grub boots straight to Windows

Thats just lets grub wait for user input instead of timeout.
but i just deleted the 40_custom file in /etc/grub.d which is automatically created.
It seems to interfere with os-prober. Recreated the grub.cfg and now its working again as intended.

Last edited by synacktic (2023-06-16 06:48:47)

Offline

Board footer

Powered by FluxBB