LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 07-12-2021, 06:18 PM   #1
luofeiyu
Member
 
Registered: Aug 2015
Posts: 237

Rep: Reputation: Disabled
Why can't write Windows Boot Manager into grub gui?


OS info:
Code:
uname -a
Linux debian 4.19.0-17-amd64 #1 SMP Debian 4.19.194-1 (2021-06-10) x86_64 GNU/Linux
The grub destroyed after resetting cmos,i have to rescue grub with live usb,enter into debian live
Code:
sudo grub-mkconfig -o /boot/grub/grub.cfg
Generating grub configuration file ...
Found background image: /usr/share/images/desktop-base/desktop-grub.png
Found linux image: /boot/vmlinuz-4.19.0-17-amd64
Found initrd image: /boot/initrd.img-4.19.0-17-amd64
Found linux image: /boot/vmlinuz-4.19.0-16-amd64
Found initrd image: /boot/initrd.img-4.19.0-16-amd64
Found Windows Boot Manager on /dev/sda2@/efi/Microsoft/Boot/bootmgfw.efi
Found Debian GNU/Linux 10 (buster) on /dev/sdb1
Adding boot menu entry for EFI firmware configuration
done
You can see Windows Boot Manager was founded ,and it was written into /boot/grub/grub.cfg.
Click image for larger version

Name:	window.png
Views:	17
Size:	148.8 KB
ID:	36774
No Windows Boot Manager show up when to reboot my pc!
Click image for larger version

Name:	IMG_20210712_222225.jpg
Views:	20
Size:	87.9 KB
ID:	36775
Here is the whole grub.cfg,i rename grub.cfg as grub.cfg.txt in order to upload it.
Attached Files
File Type: txt grub.cfg.txt (11.4 KB, 12 views)

Last edited by luofeiyu; 07-12-2021 at 06:20 PM.
 
Old 07-12-2021, 06:51 PM   #2
HappyTux
Senior Member
 
Registered: Mar 2003
Location: Nova Scotia, Canada
Distribution: Debian AMD64
Posts: 4,170

Rep: Reputation: 244Reputation: 244Reputation: 244
You reset the CMOS so the boot order of the drives may have changed. Your posting shows two different installs of Debian one on the first drive in the system and one on the second. That piece of junk GRUB may have installed to the second drive with the new settings. Use your boot menu key on my board it is F12 this allows me to select the drive to load the EFI boot files from, your Windows boot file (/dev/sda2@/efi/Microsoft/Boot/bootmgfw.efi) is in the install partition of windows. A couple of options you can mount the partition and copy the /efi/Microsoft/Boot/bootmgfw.efi to the mounted /dev/sda1 into the /EFI/BOOT/BOOTX64.efi this file is the one that all EFI systems search for first to boot from, hopefully it would work for you. It would overwrite the GRUBX64.efi that is now there named as that file after the install of GRUB again. The second is to install the efibootmgr and use it to change the boot order if it finds the Windows. Oh and try the both drives from the F12 menu first to see if it has a correct entry with Windows in it. If so set the drive with the correct menu as the first drive to boot from in your BIOS firmware, usually accessed by the delete key.
 
Old 07-12-2021, 06:56 PM   #3
luofeiyu
Member
 
Registered: Aug 2015
Posts: 237

Original Poster
Rep: Reputation: Disabled
I have installed two debians on different disk.There are two /boot/grub/grub.cfg files ,one is in /dev/sda7,other is in /dev/sdb1,enter into livecd's debian ,and execute
Code:
sudo grub-mkconfig -o /boot/grub/grub.cfg
it will write a new grub.cfg file into /dev/sda7,but everytime my pc call grub.cfg file at /dev/sdb1,the Windows Boot Manager is not in /boot/grub/grub.cfg of /dev/sdb1,it explains what i encountered.

How can i write /boot/grub/grub.cfg into /dev/sda7 and at the same time make it call /boot/grub/grub.cfg in /dev/sda7 when rebooting in livecd's debian terminal?

Last edited by luofeiyu; 07-12-2021 at 08:09 PM.
 
Old 07-12-2021, 08:15 PM   #4
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,330

Rep: Reputation: 1579Reputation: 1579Reputation: 1579Reputation: 1579Reputation: 1579Reputation: 1579Reputation: 1579Reputation: 1579Reputation: 1579Reputation: 1579Reputation: 1579
let see If I understand what your saying, you booted a debian live usb open a terminal and ran this command without doing anything else
Code:
sudo grub-mkconfig -o /boot/grub/grub.cfg

Last edited by colorpurple21859; 07-12-2021 at 08:19 PM.
 
Old 07-12-2021, 08:27 PM   #5
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,330

Rep: Reputation: 1579Reputation: 1579Reputation: 1579Reputation: 1579Reputation: 1579Reputation: 1579Reputation: 1579Reputation: 1579Reputation: 1579Reputation: 1579Reputation: 1579
Quote:
How can i write /boot/grub/grub.cfg into /dev/sda7 and at the same time make it call /boot/grub/grub.cfg in /dev/sda7 when rebooting in livecd's debian terminal?
boot debian live

open a terminal and as root
Code:
sudo mount /dev/sda7 /mnt
sudo grub-mkconfig -o /mnt/boot/grub/grub.cfg
reboot, at the grub menu press c for grub> prompt
Code:
grub> configfile (hd0,7)/boot/grub/grub.cfg
May have to change the hd0 to hd1
 
Old 07-13-2021, 07:12 AM   #6
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,446

Rep: Reputation: 2474Reputation: 2474Reputation: 2474Reputation: 2474Reputation: 2474Reputation: 2474Reputation: 2474Reputation: 2474Reputation: 2474Reputation: 2474Reputation: 2474
In your initial post, you have posted grub.cfg file which appears to be from sda7 Debian. Are you currently unable to boot either Debian install from either hard drive?

Are you able to access your EFI partition? Do you see both debian and microsoft directories.

Quote:
it will write a new grub.cfg file into /dev/sda7,but everytime my pc call grub.cfg file at /dev/sdb1,the Windows Boot Manager is not in /boot/grub/grub.cfg of /dev/sdb1,it explains what i encountered.
The Debian installed on /dev/sdb is an msdos device and Grub installed on an msdos/legacy machine will not boot a windows UEFI install. THis is why you don't see a windows entry there. Your grub.cfg which you posted above from /dev/sda7 has all the Grub entries you need so just boot from that device.

Last edited by yancek; 07-13-2021 at 07:30 AM.
 
Old 07-14-2021, 08:01 AM   #7
luofeiyu
Member
 
Registered: Aug 2015
Posts: 237

Original Poster
Rep: Reputation: Disabled
Solved,new issue occurs ,let me open a new post to describe it.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Switching grub boot manager to windows boot manager meison Linux - Newbie 5 04-17-2016 12:02 PM
Infinite Grub Loop: GRUB GRUB GRUB GRUB GRUB GRUB GRUB GRUB GRUB GRUB... beeblequix MEPIS 2 11-02-2013 10:56 PM
[SOLVED] How come I can't edit /boot/grub/grub.conf or /boot/grub/menu.lst in Fedora 14? trien27 Fedora 4 01-22-2011 04:02 PM
Why /boot/grub/grub.conf is symlinked to /boot/grub/menu.lst raj_hcl1986@rediffma Linux - Newbie 2 10-19-2008 02:19 AM
Booting my new ubuntu install = "GRUB GRUB GRUB GRUB GRUB" etc. dissolved soul Ubuntu 2 01-13-2007 12:55 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 09:46 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration