I have a problem where GRUB 2.12 fails to access ext4 filesystem, but
only during MBR root, not during UEFI boot.

I've installed GRUB 2.12 on a USB SSD with ISO-file in ext4 filesystem
(exact install steps listed below).

When I boot this in UEFI mode it works every time, but when I boot in
MBR mode GRUB fails to access ext4 filesystem and
computer reboots.

USB SSD: Samsung Portable SSD T5 (1 TB)

========== COMPUTER 1 ==========

Main computer where I install GRUB to USB SSD.

OS: Debian 13

$ uname -a
Linux box 6.12.63+deb13-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.12.63-1
(2025-12-30) x86_64 GNU/Linux

$ grub-install -V
grub-install (GRUB) 2.12-9

========== COMPUTER 2 ==========

Old computer where I try to boot USB SSD.

Computer           : unknown Fujitsu model
BIOS Vendor        : American Megatrends
Version            : 2.02.1205
Core Version       : 4.6.4.0
Compliency         : UEFI 2.0
Project Version    : 1AOQI 0.12 x64
Build Date and Time: 02/09/2012 11:54:52

Secure boot is disabled.

========== GRUB INSTALL ==========

;   1 GiB  FAT32  EFI System Partition
;   1 MiB   none  BIOS Boot Partition
; 750 GiB   ext4  "Images"

DEV=/dev/sdc

$ sudo sgdisk -Z $DEV
$ sudo sgdisk -I -o -n 1:0:+1G -t 1:ef00 -n 2:0:+1M -t 2:ef02 -n
3:0:+750G -t 3:8300 $DEV
$ sync
$ sudo partprobe

$ sudo mkfs.vfat -F 32 -s 8 ${DEV}1
$ sudo mkfs.ext4 -L Images -E root_owner=1000:1000 -O
^metadata_csum_seed ${DEV}3

$ sudo mkdir -p /mnt/temp
$ sudo mount ${DEV}1 /mnt/temp
$ sudo mkdir /mnt/temp/boot
$ sudo grub-install --target=i386-pc --recheck
--boot-directory=/mnt/temp/boot $DEV
$ sudo grub-install --target=x86_64-efi --removable
--boot-directory=/mnt/temp/boot --efi-directory=/mnt/temp

$ sudo vim /mnt/temp/boot/grub/grub.cfg
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
menuentry "Images" {
    insmod configfile
    insmod search_fs_uuid
    search --set --label Images
    configfile /grub.cfg
}
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

$ sudo umount /mnt/temp
$ sync

* copy debian-live-13.3.0-amd64-xfce.iso to ext4 partition

* create grub.cfg in ext4 partition:
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
menuentry "Xfce" {
    insmod linux
    insmod loopback
    set iso="/debian-live-13.3.0-amd64-xfce.iso"
    loopback loop ${iso}
    linux (loop)/live/vmlinuz boot=live components findiso=${iso}
    initrd (loop)/live/initrd.img
}
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

========== TESTING RESULTS =========

When booting via UEFI, everything works and I always boot to Xfce.

When booting via MBR, selecting "Images" in the first menu causes the
computer to reboot everytime. I never get to the second menu with the
"Xfce" item.

When using the command-line with the following steps, it sometimes
works and I boot to Xfce, and sometimes it fails at `search` or
`linux` commands.

search --set --label Images
loopback loop /debian-live-13.3.0-amd64-xfce.iso
linux (loop)/live/vmlinuz boot=live components
findiso=/debian-live-13.3.0-amd64-xfce.iso
initrd (loop)/live/initrd.img
boot

Any suggestions on what the problem is and how I could get MBR boot to work?

-- 
Markus Laire

Reply via email to