Adding persistant grub entry?

Every time I do a system upgrade my windows 10 gets removed because the drive it is using is a nvme using Intel RST. For now whenever it boots straight into manjaro I need to go into the bios change the drive mode and update grub to get it to show up in the menu, is there a way to add the location permanently with the output I get from os-prober?

In theory if you have OS Prober enabled for Grub, it should detect and add the windows entry automatically.

But every system is different and some things work differently depending on the system.

Provide maybe your Grub config file /etc/default/grub and how your systems are setup. How to provide good information

Where? How?

I will provide the grub when i run the update-grub with AHCI mode and with RST mode

AHCI

GRUB_DEFAULT=saved
GRUB_TIMEOUT=5
GRUB_TIMEOUT_STYLE=hidden
GRUB_DISTRIBUTOR="Manjaro"
GRUB_CMDLINE_LINUX_DEFAULT="quiet apparmor=1 security=apparmor resume=UUID=872d771e-97c9-4ca6-8889-31e94bf55948 udev.log_priority=3"
GRUB_CMDLINE_LINUX=""

# If you want to enable the save default function, uncomment the following
# line, and set GRUB_DEFAULT to saved.
GRUB_SAVEDEFAULT=true

# Preload both GPT and MBR modules so that they are not missed
GRUB_PRELOAD_MODULES="part_gpt part_msdos"

# Uncomment to enable booting from LUKS encrypted devices
#GRUB_ENABLE_CRYPTODISK=y

# Uncomment to use basic console
GRUB_TERMINAL_INPUT=console

# Uncomment to disable graphical terminal
#GRUB_TERMINAL_OUTPUT=console

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command 'videoinfo'
GRUB_GFXMODE=auto

# Uncomment to allow the kernel use the same resolution used by grub
GRUB_GFXPAYLOAD_LINUX=keep

# Uncomment if you want GRUB to pass to the Linux kernel the old parameter
# format "root=/dev/xxx" instead of "root=/dev/disk/by-uuid/xxx"
#GRUB_DISABLE_LINUX_UUID=true

# Uncomment to disable generation of recovery mode menu entries
GRUB_DISABLE_RECOVERY=true

# Uncomment this option to enable os-prober execution in the grub-mkconfig command
GRUB_DISABLE_OS_PROBER=false

# Uncomment and set to the desired menu colors.  Used by normal and wallpaper
# modes only.  Entries specified as foreground/background.
GRUB_COLOR_NORMAL="light-gray/black"
GRUB_COLOR_HIGHLIGHT="green/black"

# Uncomment one of them for the gfx desired, a image background or a gfxtheme
#GRUB_BACKGROUND="/usr/share/grub/background.png"
GRUB_THEME="/usr/share/grub/themes/manjaro/theme.txt"

# Uncomment to get a beep at GRUB start
#GRUB_INIT_TUNE="480 440 1"

# Uncomment to ensure that the root filesystem is mounted read-only so that
# systemd-fsck can run the check automatically. We use 'fsck' by default, which
# needs 'rw' as boot parameter, to avoid delay in boot-time. 'fsck' needs to be
# removed from 'mkinitcpio.conf' to make 'systemd-fsck' work.
# See also Arch-Wiki: https://wiki.archlinux.org/index.php/Fsck#Boot_time_checking
#GRUB_ROOT_FS_RO=true

RST Mode

GRUB_DEFAULT=saved
GRUB_TIMEOUT=5
GRUB_TIMEOUT_STYLE=hidden
GRUB_DISTRIBUTOR="Manjaro"
GRUB_CMDLINE_LINUX_DEFAULT="quiet apparmor=1 security=apparmor resume=UUID=872d771e-97c9-4ca6-8889-31e94bf55948 udev.log_priority=3"
GRUB_CMDLINE_LINUX=""

# If you want to enable the save default function, uncomment the following
# line, and set GRUB_DEFAULT to saved.
GRUB_SAVEDEFAULT=true

# Preload both GPT and MBR modules so that they are not missed
GRUB_PRELOAD_MODULES="part_gpt part_msdos"

# Uncomment to enable booting from LUKS encrypted devices
#GRUB_ENABLE_CRYPTODISK=y

# Uncomment to use basic console
GRUB_TERMINAL_INPUT=console

# Uncomment to disable graphical terminal
#GRUB_TERMINAL_OUTPUT=console

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command 'videoinfo'
GRUB_GFXMODE=auto

# Uncomment to allow the kernel use the same resolution used by grub
GRUB_GFXPAYLOAD_LINUX=keep

# Uncomment if you want GRUB to pass to the Linux kernel the old parameter
# format "root=/dev/xxx" instead of "root=/dev/disk/by-uuid/xxx"
#GRUB_DISABLE_LINUX_UUID=true

# Uncomment to disable generation of recovery mode menu entries
GRUB_DISABLE_RECOVERY=true

# Uncomment this option to enable os-prober execution in the grub-mkconfig command
GRUB_DISABLE_OS_PROBER=false

# Uncomment and set to the desired menu colors.  Used by normal and wallpaper
# modes only.  Entries specified as foreground/background.
GRUB_COLOR_NORMAL="light-gray/black"
GRUB_COLOR_HIGHLIGHT="green/black"

# Uncomment one of them for the gfx desired, a image background or a gfxtheme
#GRUB_BACKGROUND="/usr/share/grub/background.png"
GRUB_THEME="/usr/share/grub/themes/manjaro/theme.txt"

# Uncomment to get a beep at GRUB start
#GRUB_INIT_TUNE="480 440 1"

# Uncomment to ensure that the root filesystem is mounted read-only so that
# systemd-fsck can run the check automatically. We use 'fsck' by default, which
# needs 'rw' as boot parameter, to avoid delay in boot-time. 'fsck' needs to be
# removed from 'mkinitcpio.conf' to make 'systemd-fsck' work.
# See also Arch-Wiki: https://wiki.archlinux.org/index.php/Fsck#Boot_time_checking
#GRUB_ROOT_FS_RO=true

As for why OS prober is not working I switch the drive mode to RST because my Linux can not mess with windows and because the auto fan control on windows seems to run quieter in that mode. The system upgrades are from pamac so every time I see it in the package manager I know I need to redo this process.

There is no difference between your two configs
image

You can add custom entries in /etc/grub.d/40_custom

Now /boot/grub/grub.cfg contains the current available entries.
You should be able to just copy the “menuentry” for win10 from that file and paste it into the 40_custom one…

1 Like

Probably you need to load vmd (Intel Volume Management Device Driver), so that grub can discover the partition?

If using 40_custom:
Change in /etc/default/grub
GRUB_TIMEOUT_STYLE=menu
to get Windoofs-entry visable…

Do i copy from ### BEGIN to ### END into the 40_custom? When I do this I will change what GaVenga said to get it to show up.

I don’t want Linux to be able to see my windows drive and I read online how Linux won’t work in RST mode and how would you even install that on Linux?

Example
### BEGIN /etc/grub.d/30_os-prober ###
menuentry 'Windows 10 Bootmanager' --class windows --class os $menuentry_id_option 'osprober-efi-xxxx-xxxx' {
	savedefault
	insmod part_gpt
	insmod fat
	set root='hd0,gpt2'
	if [ x$feature_platform_search_hint = xy ]; then
	  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2  xxxx-xxxx
	else
	  search --no-floppy --fs-uuid --set=root xxxx-xxxx
	fi
	chainloader /efi/Microsoft/Boot/bootmgfw.efi
}
set timeout_style=menu
if [ "${timeout}" = 0 ]; then
  set timeout=10
fi
### END /etc/grub.d/30_os-prober ###

could be done with /etc/fstab - but keep a backup of the original file.
in Gnome ==> Gnome disk utility can be used as DE proggy.
(That´s safer).

I followed the example and it worked! Is there any way to change the order of the grub because windows is appearing after the uefi settings? I would like the order to be Windows, Manjaro, advanced options for manjaro, uefi so would this be possible?

Edit: Is it also possible to add an icon for the advanced and uefi? I think it would make my grub look better without using that grub-customizer thing because I heard it is not compatible with manjaro

https://github.com/mateosss/matter/

https://askubuntu.com/questions/511237/grub2-icons-question

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.