Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Double boot (Windows & Debian) with UEFI mode

36 views
Skip to first unread message

fra...@libero.it

unread,
Dec 1, 2021, 12:20:04 PM12/1/21
to

I have installed Debian 11 on a Dell T1650 Desktop PC (i7 & 24 GB RAM).

I resized the 1GB HD leaving 300MB on which I installed Debian.

At the request of the installation of Grub I indicated the HD.

Now looking at it with Gparted the HD is divided as follows:
dev / sda1 EFI system partition              (fat32) 100 MiB
dev / sda2 Microsoft reserved Partition (unknown) 16MiB
dev / sda3 Basic data partition (ntfs)                    629.28 GiB
dev / sda5 grub2 core.img                                   1.00 MiB
dev / sda6 ext4                                                  27.94 GiB
dev / sda7 linux-swap                                         977.00 MiB
dev / sda8 ext4                                                   272.71 GiB
dev / sda4 ntfs                                                    520.00 MiB
not allocated not allocated                                     1.71 MiB
What would be better to do to get Grub up and running?

Can I do something to be able to boot on 2 OS (Windows 10 & Debian 11)

Or do I have to make use of rEFInd?

The boot is in UEFI mode.

Thanks for help

Francesco

Christian Britz

unread,
Dec 1, 2021, 12:30:04 PM12/1/21
to
Whats the exact problem? GRUB does not show up and Windows boots
directly? You could try the rescue mode of the installer to reinstall
GRUB, reFind is normally not needed on a PC system to dual boot with
Windows.

Once you get GRUB up and running, you should consider installing the
package os-prober. update-grub will then add the Windows system to the
GRUB menu.

Even in Windows 10 days, updates can overwrite GRUB from time to time,
so you should keep a copy of the Debian installer media for fixing this
when needed.

Joe

unread,
Dec 1, 2021, 1:10:05 PM12/1/21
to
On Wed, 1 Dec 2021 18:18:48 +0100 (CET)
fra...@libero.it wrote:

> I have installed Debian 11 on a Dell T1650 Desktop PC (i7 & 24 GB
> RAM).
>
> I resized the 1GB HD leaving 300MB on which I installed Debian.

1TB? 300GB?
>
> At the request of the installation of Grub I indicated the HD.
>
> Now looking at it with Gparted the HD is divided as follows:
> dev / sda1 EFI system partition (fat32) 100 MiB
> dev / sda2 Microsoft reserved Partition (unknown) 16MiB
> dev / sda3 Basic data partition (ntfs) 629.28 GiB
> dev / sda5 grub2 core.img 1.00 MiB
> dev / sda6 ext4
> 27.94 GiB dev / sda7 linux-swap
> 977.00 MiB dev / sda8 ext4
> 272.71 GiB dev / sda4 ntfs
> 520.00 MiB not allocated not allocated
> 1.71 MiB What would be better to do to get Grub
> up and running?

I've never seen a 'grub2 core.img' before. Maybe someone else knows
what this is. I would expect the grub loader to have installed in the
/dev/sda bootloader area, with the main part in /boot.
>
> Can I do something to be able to boot on 2 OS (Windows 10 & Debian 11)

Not sure. It is certainly possible to dual-boot Win10 with Debian, I
have a recent sid installation which does that with no problems.
Whether you can get there from where you are, and how correct the Dell
UEFI implementation is, we don't know yet.
>
> Or do I have to make use of rEFInd?

Shouldn't need to.

At the very worst, you should be able to boot either from the computer
firmware boot menu, but that should only need to be a temporary
measure. If grub is installed correctly, both OSes should appear on its
menu.
>
> The boot is in UEFI mode.

Stretch could install in a Win10 dual-boot in UEFI mode fine, so that
shouldn't be a problem today. It Just Worked.

>
>

What happens when you boot now?

Do you get a grub menu? Does the computer boot straight into Windows?
Does it not boot at all?

UEFI complicates things, since I have two computers using it and
neither of the implementations is correct, in both cases my choice of
default UEFI boot drive gets overridden by the firmware. But that
shouldn't stop grub dual-booting properly.

--
Joe

Thomas Schmitt

unread,
Dec 1, 2021, 1:20:05 PM12/1/21
to
Hi,

fra...@libero.it wrote:
> > Now looking at it with Gparted the HD is divided as follows:
> > ...
> > dev / sda5 grub2 core.img 1.00 MiB

Joe wrote:
> I've never seen a 'grub2 core.img' before. Maybe someone else knows
> what this is.

Probably
https://en.wikipedia.org/wiki/BIOS_boot_partition


Have a nice day :)

Thomas

Christian Britz

unread,
Dec 1, 2021, 5:50:04 PM12/1/21
to
Joe wrote:
> measure. If grub is installed correctly, both OSes should appear on its
> menu.

IIRC, you have to install package os-prober to achieve that.

Joe

unread,
Dec 2, 2021, 3:10:05 AM12/2/21
to
That accounts for it, I've never seen a legacy installation on GPT.

--
Joe

Joe

unread,
Dec 2, 2021, 3:30:05 AM12/2/21
to
Is that how the installer behaves now? It really doesn't care whether
there are other OSes installed already?

--
Joe

Thomas Schmitt

unread,
Dec 2, 2021, 4:00:05 AM12/2/21
to
Hi,

Joe wrote:
> I've never seen a legacy installation on GPT.

It is suspicious that the partition table has both, a GRUB2 legacy BIOS
partition and an EFI partition:

> > dev / sda1 EFI system partition         (fat32) 100 MiB
> > dev / sda5 grub2 core.img                      1.00 MiB

The BIOS partition substitutes for the space between MBR and the start
of the first MBR partition which once was used by GRUB code but in GPT
is occupied by the GPT header and partition table entries.
(The MBR itself can coexist with GPT. But its code size is restricted
to 446 bytes. All further brain has to be loaded by this MBR code from
some other place.)

I understand that it indicates a GRUB2 installation which boots via
legacy BIOS (or EFI's "CSM" mode).
An EFI partition indicates that some system is prepared to boot via
native EFI without CSM.

The original poster, fra...@libero.it, indicated that the installed
Debian is expected to boot via EFI. But i doubt that any MS-Windows
would create a GRUB2 BIOS boot partition.
So something is not as expected. Maybe that BIOS partition is just a
piece of debris from earlier states. But for now it is suspicious.

fra...@libero.it

unread,
Dec 2, 2021, 4:40:06 AM12/2/21
to

Hello,

yes HD is 1TB and Debian partition is 300GB (not Mb).

Currently Windows starts directly without reporting other OSes present.

So should I use the installation disk in "rescue mode" and reinstall Grub to Debian's / partition (27.94 GiB dev/sda6)?

How to install os-prober?

I think I have to be able to boot Debian first to be able to install it later.

Right?

Francesco

Greg Wooledge

unread,
Dec 2, 2021, 7:20:05 AM12/2/21
to
On Thu, Dec 02, 2021 at 10:37:38AM +0100, fra...@libero.it wrote:
> How to install os-prober?

apt install os-prober

> I think I have to be able to boot Debian first to be able to install it later.
>
> Right?

Yes. Either boot Debian natively, or boot some sort of rescue system,
mount the Debian root partition (and /boot if you have a separate /boot),
chroot into the Debian system, and then install os-prober there.

Christian Britz

unread,
Dec 2, 2021, 8:00:05 AM12/2/21
to


Am 02.12.21 um 09:26 schrieb Joe:
To be honest, I don't know exactly what the installer does, if it finds
another OS. Maybe it installs os-prober automatically then.
In my case, I installed Windows later, and I am almost sure that I had
to install os-prober manually.

Tixy

unread,
Dec 2, 2021, 11:00:05 AM12/2/21
to
On Thu, 2021-12-02 at 13:52 +0100, Christian Britz wrote:
>
> Am 02.12.21 um 09:26 schrieb Joe:
> > On Wed, 1 Dec 2021 23:44:47 +0100
> > Christian Britz <cbr...@t-online.de> wrote:
> >
> > > Joe wrote:
> > > > measure. If grub is installed correctly, both OSes should appear on
> > > > its menu.
> > >
> > > IIRC, you have to install package os-prober to achieve that.
> > >
> >
> > Is that how the installer behaves now? It really doesn't care whether
> > there are other OSes installed already?
>
> To be honest, I don't know exactly what the installer does, if it finds
> another OS.

How would it do that? Detecting other OS's is what the os-prober
package is for. On my machines, os-prober is installed and I always
install to an empty disks and no other disk present apart from the
Debian installer on a USB stick.

> Maybe it installs os-prober automatically then.
> In my case, I installed Windows later, and I am almost sure that I had
> to install os-prober manually.

The grub-common package Recommends os-prober, so I would have thought
it would be installed automatically by the installer, unless you've
taken special measures to tell it not to install recommended packages.

--
Tixy

Tixy

unread,
Dec 2, 2021, 11:10:05 AM12/2/21
to
On Thu, 2021-12-02 at 15:52 +0000, Tixy wrote:
> On Thu, 2021-12-02 at 13:52 +0100, Christian Britz wrote:
> >
> > To be honest, I don't know exactly what the installer does, if it finds
> > another OS.
>
> How would it do that? Detecting other OS's is what the os-prober
> package is for.

Answering my own question, the installer may contain and use os-prober
without installing it to the target system.

--
Tixy

Joe

unread,
Dec 2, 2021, 2:40:06 PM12/2/21
to
In which case it should install grub with a pre-awareness of other OSes
present.

Of course, one day an upgrade will be done, update-grub will be run
without os-prober, and any other OS will disappear... that sounds like
something Microsoft would do.

Surely during installation, a check for other OSes should be performed,
and if any are found then os-prober should be installed *and* *enabled*
by default, as it will be needed during every subsequent update-grub. My
sid just had its os-prober disabled by an 'upgrade', and I needed to
tweak the grub defaults to get it back.

Linux used to be promoted on the basis that it could be installed in a
Windows system for evaluation if there was enough spare drive space,
without affecting the Windows installation. It's hardly reasonable to
expect a newcomer to Linux, having apparently lost his Windows
installation, to research and install os-prober to get it back. The
most clueful will simply run a Windows boot repair and forget about
'that damned Linux'.

--
Joe

David Wright

unread,
Dec 2, 2021, 3:30:04 PM12/2/21
to
On Thu 02 Dec 2021 at 19:30:20 (+0000), Joe wrote:
This thread seems to have gone down a rabbit-hole.

$ aptitude why os-prober
i grub-common Recommends os-prober (>= 1.33)
$

It has stretched the minds of people here to work out how to
make the d-i /avoid/ installing Recommends, so I can't see
why this would suddenly happen to a casual newcomer.

Cheers,
David.

Joe

unread,
Dec 2, 2021, 5:10:05 PM12/2/21
to
On Thu, 2 Dec 2021 14:29:31 -0600
David Wright <deb...@lionunicorn.co.uk> wrote:


>
> This thread seems to have gone down a rabbit-hole.
>
> $ aptitude why os-prober
> i grub-common Recommends os-prober (>= 1.33)
> $
>
> It has stretched the minds of people here to work out how to
> make the d-i /avoid/ installing Recommends, so I can't see
> why this would suddenly happen to a casual newcomer.
>
To be fair, it's four or five weeks since I last used an installer, and
I certainly got os-prober then. But a few days ago, os-prober was
disabled in that very installation after an upgrade. I can therefore
easily believe that it could now be omitted on installation. Someone
important considers it unnecessary.

Again, there was a changelog mentioning this and saying how to work
around it, but I feel that a Debian upgrade should not simply disable a
piece of necessary and regularly-used software without at least asking
the user first.

--
Joe

David Wright

unread,
Dec 2, 2021, 10:00:05 PM12/2/21
to
On Thu 02 Dec 2021 at 22:01:29 (+0000), Joe wrote:
I guess this is why newcomer's don't run sid: it bites occasionally.

This is an upstream change in Grib, isn't it, and mentioned in
news.Debian. Perhaps you could submit a bug to have it brought to
admins attention through debconf (is it?—the one that displays when
you install, and sends the same message as an email to root).

Cheers,
David.

David Wright

unread,
Dec 2, 2021, 10:00:05 PM12/2/21
to
On Thu 02 Dec 2021 at 09:50:06 (+0100), Thomas Schmitt wrote:
> Joe wrote:
> > I've never seen a legacy installation on GPT.

It might help if people pasted output into their posts, rather
than paraphrasing it so that we have to do the work to figure
out its meaning.
I would agree: its presence here has to be explained.

I actually install one on every system disk. It wastes no space
because it sets the alignment to my preferred 4MB. Two of my
systems wouldn't without it as they're still BIOS-boot, on GPT.

Device Start End Sectors Size Type
/dev/sda1 2048 8191 6144 3M BIOS boot
/dev/sda2 8192 1023999 1015808 496M EFI System
[ … ]

I also had to add one to a dual-booting Lenovo as I booted
it in CSM to avoid touching the EFI boot configuration.
https://lists.debian.org/debian-user/2018/05/msg00454.html
So it's possible that the OP followed a well-written Howto
that didn't make assumptions, but it's also possible they
only /think/ they're booting Debian in EFI, seeing as they're
unable to boot linux at all at present.

I would've liked to have seen their ls /sys/firmware/efi
while they had a running linux system.

Cheers,
David.

fra...@libero.it

unread,
Dec 3, 2021, 6:30:05 AM12/3/21
to

Hi,
I was unable to install Grub. Via ‘rescue mode’ of installation cd, it doesn't make me do it; takes me to the partitioning window. Then I did a reboot which gave me a screenshot
error: file ‘/boot/grub/i386-pc/normal.mod’ not found.

On:

grub rescue>ls 
(hd0) (hd0,gpt8) (hd0,gpt7) (hd0,gpt6) (hd0,gpt5) (hd0,gpt4) (hd0,gpt3) (hd0,gpt2) (hd0,gpt1)

By giving ls command to each partition only (hd0,gpt6) and (hd0,gpt8) are given as ext2 filesystem (the other as ‘unknown’ filesystem)
Then, to know more, I gave the following commands:

grub rescue> ls (hd0,gpt6)/
./ ../ lost+found/ home/ etc/ media/ vmlinuz.old var/ bin usr/ sbin lib lib32 lib64 libx32 boot/ dev/ proc/ root/ run/ sys/ tmp/ mnt/ srv/ apt/ debootstrap/ initrd.img.old vmlinuz initrd.img

grub rescue> ls (hd0,gpt6)/boot
./ ../ config-5.10.0-9-amd64 vmlinuz-5.10.0-9-amd64 efi/ System.map-5.10.0-9-amd64 initrd.img-5.10.0-9-amd64

Now I don't know how I can do to continue and if this datas can be useful to solve

Francesco

Andrew M.A. Cater

unread,
Dec 3, 2021, 2:00:06 PM12/3/21
to

David Wright

unread,
Dec 3, 2021, 2:30:06 PM12/3/21
to
I think you should be able to boot linux directly
by typing (I haven't tried this):

grub> search --set=root --file /vmlinuz
grub> echo $root ought to reply (hd0,gpt6)

grub> linux /vmlinuz root=/dev/sda6 ro quiet

grub> initrd /initrd.img

grub> boot

When the system is up and running, check and/or reinstall grub with:

# grub-install /dev/sda

You could then satisfy our curiosity by typing:

# ls /sys/firmware/efi

but you could also, having installed grub, check the
contents listed by:

# ls -lR /boot/efi/

It should look something like below, but with extra windows stuff.
The file /boot/efi/EFI/debian/grub.cfg should contain something
like:

search.fs_uuid 12345678-abcd-9876-5432-abcdef123456 root hd0,gpt6
set prefix=($root)'/boot/grub'
configfile $prefix/grub.cfg

The listing:

/boot/efi:
total 1
drwx------ 3 512 May 19 2021 EFI

/boot/efi/EFI:
total 1
drwx------ 2 512 May 19 2021 debian

/boot/efi/EFI/debian:
total 3328
-rwx------ 1 108 Jul 29 15:33 BOOTX64.CSV
-rwx------ 1 84176 Jul 29 15:33 fbx64.efi
-rwx------ 1 126 Jul 29 15:33 grub.cfg
-rwx------ 1 1549696 Jul 29 15:33 grubx64.efi
-rwx------ 1 842104 Jul 29 15:33 mmx64.efi
-rwx------ 1 930016 Jul 29 15:33 shimx64.efi

Cheers,
David.

fra...@libero.it

unread,
Dec 6, 2021, 5:00:05 AM12/6/21
to

Hello,

unfortunately, nothing David suggested worked, so I finally set it on in the bios Legacy (via F12) and then reinstalled Debian.

Now if I turn on, Grub appears with Debian that starts (even if it takes a while to boot) and if I want to use Windows, at boot, I have to click F12 and select boot with UEFI and then Windows 10 starts.

I tried to install os-prober on Debian, but it is already installed and doing update-grub, but Windows is not shown (Probably because it is inserted in the UEFI boot).

Is there any way to fix this mess?

Francesco

Andrew M.A. Cater

unread,
Dec 6, 2021, 7:00:04 AM12/6/21
to
Hi Francesco,

That _definitely_ won't work. If one OS is installed using UEFI, then both
need to be. Can you delete the Debian you've installed / reboot and use
rescue mode in expert mode.

An expert install of Debian will allow you to specify where the boot files
are. There is an option to install to a fallback location that should be
found by any UEFI firmware. If you do that, it should work, and os-prober
should also pick up the existing Windows installer.

I think when I did this last time, I installed Debian first in UEFI mode and
left space for Windows. Installing Windows thereafter it found the ESP
partition and installed Windows boot files there. I think it might have
made Windows default boot and ignored Debian.

Rebooting Debian rescue mode and reinstalling grub and os-prober then found
Windows and put the items into grub so that it is sorted out.

All the very best, as ever,

Andy C.

Peter Ehlert

unread,
Dec 6, 2021, 7:40:04 AM12/6/21
to


On 12/6/21 1:56 AM, fra...@libero.it wrote:

Hello,

unfortunately, nothing David suggested worked, so I finally set it on in the bios Legacy (via F12) and then reinstalled Debian.

Now if I turn on, Grub appears with Debian that starts (even if it takes a while to boot) and if I want to use Windows, at boot, I have to click F12 and select boot with UEFI and then Windows 10 starts.

that is exactly how I run windows. It works.

I tried to install os-prober on Debian, but it is already installed and doing update-grub, but Windows is not shown (Probably because it is inserted in the UEFI boot).

Is there any way to fix this mess?

not that I know of.

I just reset the BIOS when I want to boot windows. It's annoying but not a big deal.

Francesco

David Wright

unread,
Dec 6, 2021, 11:20:05 AM12/6/21
to
On Mon 06 Dec 2021 at 10:56:29 (+0100), fra...@libero.it wrote:

> unfortunately, nothing David suggested worked,

Yes, that happens, usually because the initial conditions were
different from those assumed. Eg, Grub could have been in a
different state, as the commands I was using are typically in
response to a Grub> prompt, rather than a Grub Rescue> prompt.
I'm also not certain what results from a failure to load normal.mod.

But most importantly, without being told what /you/ do (not what
I said to do), and without the responses, it's very difficult to
help any further.

For example, in your original post, there was no explanation
of how you came by having a BIOS Boot partition. Which Howto
did you follow that encouraged you to create it? Knowing that
might well have helped others explain what your problem was,
were we able to read what the entire intended strategy was.

> so I finally set it on in the bios Legacy (via F12) and then reinstalled Debian.
>
> Now if I turn on, Grub appears with Debian that starts (even if it takes a while to boot) and if I want to use Windows, at boot, I have to click F12 and select boot with UEFI and then Windows 10 starts.
>
> I tried to install os-prober on Debian, but it is already installed and doing update-grub, but Windows is not shown (Probably because it is inserted in the UEFI boot).
>
> Is there any way to fix this mess?

That depends how often you switch between Windows and Debian.
If it's infrequent, then you can just call it a feature. I did
that for over a year with a bread-winning Windows installation
that I was not willing to touch.
If not, then you need to retry installing Debian in UEFI mode
while making copious notes.

Cheers,
David.

David Wright

unread,
Dec 6, 2021, 11:20:05 AM12/6/21
to
On Mon 06 Dec 2021 at 11:56:08 (+0000), Andrew M.A. Cater wrote:
> On Mon, Dec 06, 2021 at 10:56:29AM +0100, fra...@libero.it wrote:
> > unfortunately, nothing David suggested worked, so I finally set it on in the bios Legacy (via F12) and then reinstalled Debian.
> >
> > Now if I turn on, Grub appears with Debian that starts (even if it takes a while to boot) and if I want to use Windows, at boot, I have to click F12 and select boot with UEFI and then Windows 10 starts.
> >
> > I tried to install os-prober on Debian, but it is already installed and doing update-grub, but Windows is not shown (Probably because it is inserted in the UEFI boot).
> >
> > Is there any way to fix this mess?
>
> That _definitely_ won't work. If one OS is installed using UEFI, then both
> need to be. Can you delete the Debian you've installed / reboot and use
> rescue mode in expert mode.

Sorry, but that generalisation gets trotted out over and
over again. Of course, those who actually practise it on
systems where it works know that it's not true and sigh,
while the world keeps turning.

> An expert install of Debian will allow you to specify where the boot files
> are. There is an option to install to a fallback location that should be
> found by any UEFI firmware. If you do that, it should work, and os-prober
> should also pick up the existing Windows installer.
>
> I think when I did this last time, I installed Debian first in UEFI mode and
> left space for Windows. Installing Windows thereafter it found the ESP
> partition and installed Windows boot files there. I think it might have
> made Windows default boot and ignored Debian.

Where people use mixed UEFI/BIOS booting, the reports I've read
indicate that Windows is typically the original, ab initio,
system, and linux is installed after shrinking W's large
partition in order to create linux partitions, including a
BIOS Boot partition (notably present in the OP's system) for
their GPT disk.

> Rebooting Debian rescue mode and reinstalling grub and os-prober then found
> Windows and put the items into grub so that it is sorted out.

I assume those instructions were what you intended to post in
https://lists.debian.org/debian-user/2021/12/msg00104.html
but they didn't make it.

Cheers,
David.
0 new messages