Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Debian won't boot unless I activate UEFI+Legacy in BIOS

Ask for help with issues regarding the Installations of the Debian O/S.
Post Reply
Message
Author
TxLogicGuy
Posts: 15
Joined: 2022-01-10 16:14

Debian won't boot unless I activate UEFI+Legacy in BIOS

#1 Post by TxLogicGuy »

I just installed Debian bullseye on my UEFI motherboard. I previously had Windows, Artix Linux and CentOS installed and running in separate partitions on a RAID0 array. All of these were booting in pure UEFI mode. I booted the Debian live DVD, also in UEFI mode, and went through the installation procedure. All seemed to go well until it came time to boot Debian. It would not boot. It sat there for a while, with the hard disk activity light flashing occasionally, and then displayed these messages on the screen:

Code: Select all

mdadm: error opening /dev/md?*: No such file or directory
Gave up waiting for suspend/resume device
Gave up waiting for root file system device.  Common problems:
 - Boot args (cat /proc/cmdline)
   - Check rootdelay= (did the system wait long enough?)
 - Missing modules (cat /proc/modules; ls /dev)
ALERT!  UUID=6ae760b1-58a7-4b88-8373-5342d04deba2 does not exist.  Dropping to a shell!

BusyBox v1.30.1 (Debian 1:1.30.1-6+b3) built-in shell (ash)
Enter 'help' for a list of built-in commands.

(initramfs)
After scratching my head for a while, trying to figure out what went wrong, I tried going into BIOS setup and selecting UEFI+Legacy mode. That worked. Debian booted right up.

So that brings up the question: Why did the Debian DVD boot in pure UEFI mode but the installed kernel requires UEFI+Legacy? The installed kernel is apparently different from the DVD kernel. Why does the installed kernel require some legacy BIOS feature that the installed DVD did not? Is there some kernel boot parameter I can try so that it won't require legacy BIOS? Are there other Debian kernel versions I can try? (I'm thinking that maybe the default kernel is loaded with features, many of which I don't need but maybe one of them has some dependency on legacy BIOS? Is there a more light-weight kernel available that I could try?) I'm asking these questions because turning on Legacy mode makes the PC take longer to boot.

User avatar
ticojohn
Posts: 1284
Joined: 2009-08-29 18:10
Location: Costa Rica
Has thanked: 21 times
Been thanked: 44 times

Re: Debian won't boot unless I activate UEFI+Legacy in BIOS

#2 Post by ticojohn »

It's most likely not a kernel issue. I'm just fishing here, but when you entered BIOS did you do that from the GRUB menu entry for entering Bios (System Setup)?
I am not irrational, I'm just quantum probabilistic.

TxLogicGuy
Posts: 15
Joined: 2022-01-10 16:14

Re: Debian won't boot unless I activate UEFI+Legacy in BIOS

#3 Post by TxLogicGuy »

Selecting System Setup from the GRUB menu causes the PC to reboot and come up in the BIOS settings menu. That seems to be exactly the same as hitting F2 while the PC is first booting up. I don't think how you get into BIOS setup is an issue. I still think it must be a quirk in the Debian kernel (or maybe in the initramfs).

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

Re: Debian won't boot unless I activate UEFI+Legacy in BIOS

#4 Post by p.H »

What kind of RAID is it ? Motherboard/BIOS "fake RAID" or Linux RAID ?
Did you use the initramfs shell to investigate what was wrong ?

TxLogicGuy
Posts: 15
Joined: 2022-01-10 16:14

Re: Debian won't boot unless I activate UEFI+Legacy in BIOS

#5 Post by TxLogicGuy »

I think it's kind of both. This is an Intel motherboard with Intel Rapid Storage Technology, often called "fake RAID" in these fora. The way I understand it, the motherboard firmware is responsible for loading GRUB from the EFI partition of the RAID array. After GRUB loads the kernel and the initramfs, then mdadm takes over from there. mdadm is used for Linux software RAID and also works with RAID arrays that were previously configured with the motherboard firmware.

The RAID partitions should appear in the Linux file system as /dev/md126p1, /dev/md126p2, /dev/md126p3, etc. When I issue "ls /dev" from the initramfs shell there are no entries of /dev/md*.

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

Re: Debian won't boot unless I activate UEFI+Legacy in BIOS

#6 Post by p.H »

It can't be both. If it is set up in the motherboard firmware, then it is fake RAID. Some types (such as Intel Matrix Storage) can be used with mdadm, others with dmraid. In my only and very old experience with Intel RAID, I observed that mdadm would use it only if enabled in the BIOS, the on-disk metadata were not sufficient. So maybe mdadm or the kernel md driver need some firmware information which is available only with legacy compatibility mode (CSM) ?

In the initramfs, did you check the kernel messages with dmesg and the detected RAID metadata with

Code: Select all

mdadm --examine --scan --verbose
Last edited by p.H on 2022-02-01 08:40, edited 1 time in total.

TxLogicGuy
Posts: 15
Joined: 2022-01-10 16:14

Re: Debian won't boot unless I activate UEFI+Legacy in BIOS

#7 Post by TxLogicGuy »

I finally have some more data to post about this issue. (I had a terrible time trying to capture any data or messages from the initramfs shell prompt. It wouldn't let me mount a USB flash drive so I could save anything. I tried multiple flash drives. Same thing. When I entered:

Code: Select all

mount /dev/sdc1 /mnt
It responded with "invalid parameter". If I entered:

Code: Select all

mount -t vfat /dev/sdc1 /mnt
or
mount -t fat32 /dev/sdc1 /mnt
it responded with "no such device" (or some such message).

After lots of web searching for an answer I found a comment from somebody that the grub/debian initramfs shell only supports mounting ntfs formatted drives. Strange, but that is a fact! Most flash drives come formatted FAT32. I tried formatting one NTFS with Windows and then tried mounting it with

Code: Select all

mount -t ntfs-3g /dev/sdc1 /mnt
and that worked! I was finally able to capture some messages.

When booting with UEFI+Legacy,

Code: Select all

mdadm --examine --scan --verbose
returns this:

Code: Select all

ARRAY metadata=imsm UUID=f46ce314:c874c458:5630027e:d4375317
   devices=/dev/sda,/dev/sdb,/dev/md/imsm0
ARRAY /dev/md/WD1TBRAID0 container=f46ce314:c874c458:5630027e:d4375317 member=0 UUID=58b9905f:2a773399:518dbd70:7b52bdc0
When booting in pure UEFI mode,

Code: Select all

mdadm --examine --scan --verbose
returns this:

Code: Select all

ARRAY metadata=imsm UUID=f46ce314:c874c458:5630027e:d4375317
   devices=/dev/sdb,/dev/sda
ARRAY /dev/md/WD1TBRAID0 container=f46ce314:c874c458:5630027e:d4375317 member=0 UUID=58b9905f:2a773399:518dbd70:7b52bdc0
The results are very similar. They both report "metadata=imsm" and "ARRAY /dev/md/WD1TBRAID0". WD1TBRAID is the name I gave to the array in the BIOS setup. What's missing in the pure UEFI case is "devices=/dev/md/imsm0".

I compared the dmesg logs and noticed something different near the end where it is reporting information about the SATA drives. In UEFI+Legacy mode I get this:

Code: Select all

[    2.685605] sd 1:0:0:0: [sdb] 976773168 512-byte logical blocks: (500 GB/466 GiB)
[    2.685690] sd 0:0:0:0: [sda] 976773168 512-byte logical blocks: (500 GB/466 GiB)
[    2.687120] sd 1:0:0:0: [sdb] Write Protect is off
[    2.688523] sd 0:0:0:0: [sda] Write Protect is off
[    2.689999] sd 1:0:0:0: [sdb] Mode Sense: 00 3a 00 00
[    2.690019] sd 1:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[    2.691408] sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00
[    2.692847] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[    2.719055] sr 2:0:0:0: [sr0] scsi3-mmc drive: 48x/48x writer dvd-ram cd/rw xa/form2 cdda tray
[    2.720473] cdrom: Uniform CD-ROM driver Revision: 3.20
[    2.733918] sd 1:0:0:0: [sdb] Attached SCSI disk
[    2.770225] sr 2:0:0:0: Attached scsi CD-ROM sr0
[    2.783090] sd 0:0:0:0: [sda] Attached SCSI disk
[    2.865325] md126: detected capacity change from 0 to 1000210432000
[    2.878622]  md126: p1 p2 p3 p4 p5 p6 p7 p8 p9
In pure UEFI mode I get this:

Code: Select all

[    2.727044] sd 1:0:0:0: [sdb] 976773168 512-byte logical blocks: (500 GB/466 GiB)
[    2.727045] sd 0:0:0:0: [sda] 976773168 512-byte logical blocks: (500 GB/466 GiB)
[    2.727056] sd 0:0:0:0: [sda] Write Protect is off
[    2.728531] sd 1:0:0:0: [sdb] Write Protect is off
[    2.729982] sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00
[    2.731385] sd 1:0:0:0: [sdb] Mode Sense: 00 3a 00 00
[    2.732605] sd 1:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[    2.732838] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[    2.765745] sr 2:0:0:0: [sr0] scsi3-mmc drive: 48x/48x writer dvd-ram cd/rw xa/form2 cdda tray
[    2.767160] cdrom: Uniform CD-ROM driver Revision: 3.20
[    2.770708] sd 1:0:0:0: [sdb] Attached SCSI disk
[    2.807971] sd 0:0:0:0: [sda] Attached SCSI disk
[    2.816706] sr 2:0:0:0: Attached scsi CD-ROM sr0
They are basically the same except the lines

Code: Select all

[    2.865325] md126: detected capacity change from 0 to 1000210432000
[    2.878622]  md126: p1 p2 p3 p4 p5 p6 p7 p8 p9
are missing in the pure UEFI case. /dev/md126p9 is the partition where Debian is installed.

So, it appears that in both cases the RAID array is being discovered. What's missing in the pure UEFI case is that the RAID is not being assembled. If I try to assemble it manually with:

Code: Select all

mdadm --assemble --scan 
I get an empty response.

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

Re: Debian won't boot unless I activate UEFI+Legacy in BIOS

#8 Post by p.H »

Aren't there more md messages in the kernel log ? Here :

Code: Select all

# dmesg |grep md[:/0-9]
[    2.702306] md: bind<sda8>
[    3.112087] md: bind<sda12>
[    3.116230] md: raid1 personality registered for level 1
[    3.116601] md0: WARNING: sda12 appears to be on the same physical disk as sda8.
[    3.116705] md/raid1:md0: active with 2 out of 2 mirrors
[    3.116740] md0: detected capacity change from 0 to 491454464
TxLogicGuy wrote: 2022-02-01 03:05 After lots of web searching for an answer I found a comment from somebody that the grub/debian initramfs shell only supports mounting ntfs formatted drives.
Wrong. The generic initramfs supports many filesystems (Btrfs, ext*, F2FS, JFS, NTFS, ReiserFS, UDF, XFS...) but not FAT.
I guess this is because the purpose of initramfs is to mount / and possibly /usr which cannot be on FAT. I am a bit surprised that it supports NTFS though, I did not think that it could be used for / or /usr.

Post Reply