# Grub troubleshooting
[TOC]
## update-grub
```bash
sudo update-grub
```
Output:
```bash
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-6.1.0-31-amd64
Found initrd image: /boot/initrd.img-6.1.0-31-amd64
Found linux image: /boot/vmlinuz-6.1.0-29-amd64
Found initrd image: /boot/initrd.img-6.1.0-29-amd64
Warning: os-prober will be executed to detect other bootable partitions.
Its output will be used to detect bootable binaries on them and create new boot entries.
/usr/sbin/grub-probe: error: unknown filesystem.
Found Windows Boot Manager on /dev/nvme0n1p1@/EFI/Microsoft/Boot/bootmgfw.efi
/usr/sbin/grub-probe: error: unknown filesystem.
Adding boot menu entry for UEFI Firmware Settings ...
done
```
## grub-install
```bash
sudo grub-install
```
Output:
```bash
Installing for x86_64-efi platform.
grub-install: error: unknown filesystem.
```
## fdisk
```bash
sudo fdisk -l
```
Output:
```bash
Disk /dev/nvme0n1: 953.87 GiB, 1024209543168 bytes, 2000409264 sectors
Disk model: PM9B1 NVMe Samsung 1024GB
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: AE33C7CC-7642-4CAA-B2DE-4C7E0A3E50AA
Device Start End Sectors Size Type
/dev/nvme0n1p1 2048 595967 593920 290M EFI System
/dev/nvme0n1p2 595968 858111 262144 128M Microsoft reserved
/dev/nvme0n1p3 858112 420288511 419430400 200G Microsoft basic data
/dev/nvme0n1p4 420288512 630003711 209715200 100G Microsoft basic data
/dev/nvme0n1p5 630003712 1869651967 1239648256 591.1G Linux filesystem
/dev/nvme0n1p6 1869651968 1994717183 125065216 59.6G Linux swap
/dev/nvme0n1p7 1994717184 1997156351 2439168 1.2G Windows recovery environment
/dev/nvme0n1p8 1997158400 2000408575 3250176 1.5G Windows recovery environment
```
## lsblk
```bash
lsblk -lo name,size,fstype,uuid,label
```
Output:
```
NAME SIZE FSTYPE UUID LABEL
nvme0n1 953.9G
nvme0n1p1 290M vfat B654-8AAA ESP
nvme0n1p2 128M
nvme0n1p3 200G ntfs 602056782056555E OS
nvme0n1p4 100G exfat E69E-ABEB Data
nvme0n1p5 591.1G ext4 a7f52786-4d2d-4ac5-a505-763b38487690
nvme0n1p6 59.6G swap 67c6b003-3efb-483d-be4f-2480fdef5459
nvme0n1p7 1.2G ntfs F0DEB331DEB2EECA WINRETOOLS
nvme0n1p8 1.5G ntfs 5EE6AD7AE6AD5357 DELLSUPPORT
```
## grub-probe
```bash
for n in $(seq 1 8)
do
sudo grub-probe --target=fs --device /dev/nvme0n1p${n}
done
```
Output:
```bash
grub-probe: error: unknown filesystem.
grub-probe: error: unknown filesystem.
ntfs
exfat
ext2
grub-probe: error: unknown filesystem.
ntfs
ntfs
```
## /boot/grub/grub.cfg
```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 ext2
search --no-floppy --fs-uuid --set=root a7f52786-4d2d-4ac5-a505-763b38487690
font="/usr/share/grub/unicode.pf2"
fi
if loadfont $font ; then
set gfxmode=auto
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=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=cyan/blue
set menu_color_highlight=white/blue
### 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-a7f52786-4d2d-4ac5-a505-763b38487690' {
load_video
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_gpt
insmod ext2
search --no-floppy --fs-uuid --set=root a7f52786-4d2d-4ac5-a505-763b38487690
echo 'Loading Linux 6.1.0-31-amd64 ...'
linux /boot/vmlinuz-6.1.0-31-amd64 root=UUID=a7f52786-4d2d-4ac5-a505-763b38487690 ro quiet
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-6.1.0-31-amd64
}
submenu 'Advanced options for Debian GNU/Linux' $menuentry_id_option 'gnulinux-advanced-a7f52786-4d2d-4ac5-a505-763b38487690' {
menuentry 'Debian GNU/Linux, with Linux 6.1.0-31-amd64' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-6.1.0-31-amd64-advanced-a7f52786-4d2d-4ac5-a505-763b38487690' {
load_video
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_gpt
insmod ext2
search --no-floppy --fs-uuid --set=root a7f52786-4d2d-4ac5-a505-763b38487690
echo 'Loading Linux 6.1.0-31-amd64 ...'
linux /boot/vmlinuz-6.1.0-31-amd64 root=UUID=a7f52786-4d2d-4ac5-a505-763b38487690 ro quiet
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-6.1.0-31-amd64
}
menuentry 'Debian GNU/Linux, with Linux 6.1.0-31-amd64 (recovery mode)' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-6.1.0-31-amd64-recovery-a7f52786-4d2d-4ac5-a505-763b38487690' {
load_video
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_gpt
insmod ext2
search --no-floppy --fs-uuid --set=root a7f52786-4d2d-4ac5-a505-763b38487690
echo 'Loading Linux 6.1.0-31-amd64 ...'
linux /boot/vmlinuz-6.1.0-31-amd64 root=UUID=a7f52786-4d2d-4ac5-a505-763b38487690 ro single
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-6.1.0-31-amd64
}
menuentry 'Debian GNU/Linux, with Linux 6.1.0-29-amd64' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-6.1.0-29-amd64-advanced-a7f52786-4d2d-4ac5-a505-763b38487690' {
load_video
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_gpt
insmod ext2
search --no-floppy --fs-uuid --set=root a7f52786-4d2d-4ac5-a505-763b38487690
echo 'Loading Linux 6.1.0-29-amd64 ...'
linux /boot/vmlinuz-6.1.0-29-amd64 root=UUID=a7f52786-4d2d-4ac5-a505-763b38487690 ro quiet
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-6.1.0-29-amd64
}
menuentry 'Debian GNU/Linux, with Linux 6.1.0-29-amd64 (recovery mode)' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-6.1.0-29-amd64-recovery-a7f52786-4d2d-4ac5-a505-763b38487690' {
load_video
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_gpt
insmod ext2
search --no-floppy --fs-uuid --set=root a7f52786-4d2d-4ac5-a505-763b38487690
echo 'Loading Linux 6.1.0-29-amd64 ...'
linux /boot/vmlinuz-6.1.0-29-amd64 root=UUID=a7f52786-4d2d-4ac5-a505-763b38487690 ro single
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-6.1.0-29-amd64
}
}
### 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/nvme0n1p1)' --class windows --class os $menuentry_id_option 'osprober-efi-/dev/nvme0n1p1' {
insmod part_gpt
chainloader /EFI/Microsoft/Boot/bootmgfw.efi
}
### 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/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 ###
```