Score:0

Problem with Grub configuration (Windows 10)

ph flag

I have Windows 10 and Ubuntu installed on one physical SSD disk.

Linux pc 5.11.0-41-generic #45~20.04.1-Ubuntu SMP Wed Nov 10 10:20:10 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

Using a grub-customizer, I tried to change the order of operating systems in the grub menu by moving windows 10 to the top. As a result, my grub menu disappeared. I returned it back, but now with windows 10 is in the list and in the right place, but when I select it, I get an error:

ntldr not found

My configs and system information:

$ fdisk -l

Disk /dev/loop0: 55,45 MiB, 58130432 bytes, 113536 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop1: 4 KiB, 4096 bytes, 8 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop2: 247,93 MiB, 259948544 bytes, 507712 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop3: 65,1 MiB, 68259840 bytes, 133320 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop4: 219 MiB, 229638144 bytes, 448512 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop5: 134,4 MiB, 140914688 bytes, 275224 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop6: 65,22 MiB, 68378624 bytes, 133552 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop7: 54,24 MiB, 56872960 bytes, 111080 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/nvme0n1: 238,49 GiB, 256060514304 bytes, 500118192 sectors
Disk model: HFM256GDJTNI-82A0A                      
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: EF748C74-6193-4A60-BB78-CA617F4D7792

Device             Start       End   Sectors   Size Type
/dev/nvme0n1p1      2048    206847    204800   100M EFI System
/dev/nvme0n1p2    206848    239615     32768    16M Microsoft reserved
/dev/nvme0n1p3    239616 285652961 285413346 136,1G Microsoft basic data
/dev/nvme0n1p4 285652992 286719999   1067008   521M Windows recovery environment
/dev/nvme0n1p5 286720000 500117503 213397504 101,8G Linux filesystem


Disk /dev/nvme1n1: 931,53 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: Samsung SSD 980 1TB                     
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 16384 bytes / 131072 bytes
Disklabel type: gpt
Disk identifier: DB0CB571-70DC-45DE-8787-1F00CD8227D3

Device         Start        End    Sectors   Size Type
/dev/nvme1n1p1  2048 1953521663 1953519616 931,5G Microsoft basic data


Disk /dev/sda: 931,53 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: ST1000LM049-2GH1
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: C7F5C196-19E8-47AC-965D-C27E4F62A8B6

Device     Start        End    Sectors   Size Type
/dev/sda1   2048 1953523711 1953521664 931,5G Microsoft basic data


Disk /dev/loop8: 50,98 MiB, 53432320 bytes, 104360 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop9: 219 MiB, 229638144 bytes, 448512 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop10: 32,3 MiB, 33865728 bytes, 66144 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop11: 55,5 MiB, 58183680 bytes, 113640 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop12: 61,85 MiB, 64835584 bytes, 126632 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop13: 164,78 MiB, 172761088 bytes, 337424 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop14: 42,18 MiB, 44220416 bytes, 86368 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
$ cat /etc/default/grub

# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
#   info -f grub -n 'Simple configuration'

GRUB_DEFAULT="0"
GRUB_TIMEOUT_STYLE="menu"
GRUB_TIMEOUT="10"
GRUB_DISTRIBUTOR="`lsb_release -i -s 2> /dev/null || echo Debian`"
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""

# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"

# Uncomment to disable graphical terminal (grub-pc only)
GRUB_TERMINAL="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 `vbeinfo'
#GRUB_GFXMODE="640x480"

# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID="true"

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

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

GRUB_DISABLE_OS_PROBER="true"
$ cat /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 [ "${initrdfail}" = 2 ]; then
   set initrdfail=
elif [ "${initrdfail}" = 1 ]; then
   set next_entry="${prev_entry}"
   set prev_entry=
   save_env prev_entry
   if [ "${next_entry}" ]; then
      set initrdfail=2
   fi
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 initrdfail {
    if [ -n "${have_grubenv}" ]; then if [ -n "${partuuid}" ]; then
      if [ -z "${initrdfail}" ]; then
        set initrdfail=1
        if [ -n "${boot_once}" ]; then
          set prev_entry="${default}"
          save_env prev_entry
        fi
      fi
      save_env initrdfail
    fi; fi
}
function recordfail {
  set recordfail=1
  if [ -n "${have_grubenv}" ]; then if [ -z "${boot_once}" ]; then save_env recordfail; fi; 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 [ "${recordfail}" = 1 ] ; then
  set timeout=30
else
  if [ x$feature_timeout_style = xy ] ; then
    set timeout_style=menu
    set timeout=10
  # Fallback normal timeout code in case the timeout_style feature is
  # unavailable.
  else
    set timeout=10
  fi
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=white/black
set menu_color_highlight=black/light-gray
### END /etc/grub.d/05_debian_theme ###

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

function gfxmode {
    set gfxpayload="${1}"
    if [ "${1}" = "keep" ]; then
        set vt_handoff=vt.handoff=7
    else
        set vt_handoff=
    fi
}
if [ "${recordfail}" != 1 ]; then
  if [ -e ${prefix}/gfxblacklist.txt ]; then
    if hwmatch ${prefix}/gfxblacklist.txt 3; then
      if [ ${match} = 0 ]; then
        set linux_gfx_mode=keep
      else
        set linux_gfx_mode=text
      fi
    else
      set linux_gfx_mode=text
    fi
  else
    set linux_gfx_mode=keep
  fi
else
  set linux_gfx_mode=text
fi
export linux_gfx_mode



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

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

### BEGIN /etc/grub.d/40_custom_proxy ###
menuentry "Windows 10" --class windows --class os {
   insmod ntfs
   search --no-floppy --set=root --fs-uuid 4CE8C9A1E8C989A2
   ntldr /bootmgr
}
### END /etc/grub.d/40_custom_proxy ###

### BEGIN /etc/grub.d/41_linux_proxy ###
menuentry "Ubuntu" --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-adda5833-f00a-4992-9434-f1f7ccedc28f' {
    recordfail
    load_video
    gfxmode $linux_gfx_mode
    insmod gzio
    if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
    insmod part_gpt
    insmod ext2
    if [ x$feature_platform_search_hint = xy ]; then
      search --no-floppy --fs-uuid --set=root  adda5833-f00a-4992-9434-f1f7ccedc28f
    else
      search --no-floppy --fs-uuid --set=root adda5833-f00a-4992-9434-f1f7ccedc28f
    fi
    linux   /boot/vmlinuz-5.11.0-41-generic root=UUID=adda5833-f00a-4992-9434-f1f7ccedc28f ro  quiet splash $vt_handoff
    initrd  /boot/initrd.img-5.11.0-41-generic
}
submenu "Advanced options for Ubuntu"{
menuentry "Ubuntu, with Linux 5.11.0-41-generic" --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.11.0-41-generic-advanced-adda5833-f00a-4992-9434-f1f7ccedc28f' {
        recordfail
        load_video
        gfxmode $linux_gfx_mode
        insmod gzio
        if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
        insmod part_gpt
        insmod ext2
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root  adda5833-f00a-4992-9434-f1f7ccedc28f
        else
          search --no-floppy --fs-uuid --set=root adda5833-f00a-4992-9434-f1f7ccedc28f
        fi
        echo    'Loading Linux 5.11.0-41-generic ...'
        linux   /boot/vmlinuz-5.11.0-41-generic root=UUID=adda5833-f00a-4992-9434-f1f7ccedc28f ro  quiet splash $vt_handoff
        echo    'Loading initial ramdisk ...'
        initrd  /boot/initrd.img-5.11.0-41-generic
}
menuentry "Ubuntu, with Linux 5.11.0-41-generic (recovery mode)" --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.11.0-41-generic-recovery-adda5833-f00a-4992-9434-f1f7ccedc28f' {
        recordfail
        load_video
        insmod gzio
        if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
        insmod part_gpt
        insmod ext2
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root  adda5833-f00a-4992-9434-f1f7ccedc28f
        else
          search --no-floppy --fs-uuid --set=root adda5833-f00a-4992-9434-f1f7ccedc28f
        fi
        echo    'Loading Linux 5.11.0-41-generic ...'
        linux   /boot/vmlinuz-5.11.0-41-generic root=UUID=adda5833-f00a-4992-9434-f1f7ccedc28f ro recovery nomodeset dis_ucode_ldr 
        echo    'Loading initial ramdisk ...'
        initrd  /boot/initrd.img-5.11.0-41-generic
}
menuentry "Ubuntu, with Linux 5.11.0-27-generic" --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.11.0-27-generic-advanced-adda5833-f00a-4992-9434-f1f7ccedc28f' {
        recordfail
        load_video
        gfxmode $linux_gfx_mode
        insmod gzio
        if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
        insmod part_gpt
        insmod ext2
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root  adda5833-f00a-4992-9434-f1f7ccedc28f
        else
          search --no-floppy --fs-uuid --set=root adda5833-f00a-4992-9434-f1f7ccedc28f
        fi
        echo    'Loading Linux 5.11.0-27-generic ...'
        linux   /boot/vmlinuz-5.11.0-27-generic root=UUID=adda5833-f00a-4992-9434-f1f7ccedc28f ro  quiet splash $vt_handoff
        echo    'Loading initial ramdisk ...'
        initrd  /boot/initrd.img-5.11.0-27-generic
}
menuentry "Ubuntu, with Linux 5.11.0-27-generic (recovery mode)" --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.11.0-27-generic-recovery-adda5833-f00a-4992-9434-f1f7ccedc28f' {
        recordfail
        load_video
        insmod gzio
        if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
        insmod part_gpt
        insmod ext2
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root  adda5833-f00a-4992-9434-f1f7ccedc28f
        else
          search --no-floppy --fs-uuid --set=root adda5833-f00a-4992-9434-f1f7ccedc28f
        fi
        echo    'Loading Linux 5.11.0-27-generic ...'
        linux   /boot/vmlinuz-5.11.0-27-generic root=UUID=adda5833-f00a-4992-9434-f1f7ccedc28f ro recovery nomodeset dis_ucode_ldr 
        echo    'Loading initial ramdisk ...'
        initrd  /boot/initrd.img-5.11.0-27-generic
}
menuentry "Ubuntu, with Linux 5.4.0-1058-oracle" --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.4.0-1058-oracle-advanced-adda5833-f00a-4992-9434-f1f7ccedc28f' {
        recordfail
        load_video
        gfxmode $linux_gfx_mode
        insmod gzio
        if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
        insmod part_gpt
        insmod ext2
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root  adda5833-f00a-4992-9434-f1f7ccedc28f
        else
          search --no-floppy --fs-uuid --set=root adda5833-f00a-4992-9434-f1f7ccedc28f
        fi
        echo    'Loading Linux 5.4.0-1058-oracle ...'
        linux   /boot/vmlinuz-5.4.0-1058-oracle root=UUID=adda5833-f00a-4992-9434-f1f7ccedc28f ro  quiet splash $vt_handoff
        echo    'Loading initial ramdisk ...'
        initrd  /boot/initrd.img-5.4.0-1058-oracle
}
menuentry "Ubuntu, with Linux 5.4.0-1058-oracle (recovery mode)" --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.4.0-1058-oracle-recovery-adda5833-f00a-4992-9434-f1f7ccedc28f' {
        recordfail
        load_video
        insmod gzio
        if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
        insmod part_gpt
        insmod ext2
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root  adda5833-f00a-4992-9434-f1f7ccedc28f
        else
          search --no-floppy --fs-uuid --set=root adda5833-f00a-4992-9434-f1f7ccedc28f
        fi
        echo    'Loading Linux 5.4.0-1058-oracle ...'
        linux   /boot/vmlinuz-5.4.0-1058-oracle root=UUID=adda5833-f00a-4992-9434-f1f7ccedc28f ro recovery nomodeset dis_ucode_ldr 
        echo    'Loading initial ramdisk ...'
        initrd  /boot/initrd.img-5.4.0-1058-oracle
}
}
### END /etc/grub.d/41_linux_proxy ###

### BEGIN /etc/grub.d/42_linux_zfs ###
### END /etc/grub.d/42_linux_zfs ###

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

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

### BEGIN /etc/grub.d/44_memtest86+ ###
### END /etc/grub.d/44_memtest86+ ###

### BEGIN /etc/grub.d/45_os-prober_proxy ###

### END /etc/grub.d/45_os-prober_proxy ###

### BEGIN /etc/grub.d/46_uefi-firmware_proxy ###


### END /etc/grub.d/46_uefi-firmware_proxy ###

### BEGIN /etc/grub.d/47_custom_proxy ###

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

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

### BEGIN /etc/grub.d/49_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/49_custom ###

if I understand correctly, the error is on line 142:

ntldr /bootmgr
ChanganAuto avatar
us flag
Can you still boot Ubuntu? If so the first thing to try is `sudo update-grub`.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.