Boot Repair created too many Grub menu entries for Windows
I recently installed Ubuntu in dual boot along with Windows 10 on an HP laptop. Initially I was unable to boot up Windows using grub as selecting the Windows options would just loop back to grub.
Then I performed a boot repair, and all these extra options showed up in the grub menu.
I'm able to open up Windows using "Windows UEFI bootmgfw.efi" option, but not using the standard option of "Windows Boot Manager (on /dev/sda1).
How do I reduce these entries and why can't I boot Windows using the latter option?
Here's an image of grub. The first option is Ubuntu:
https://ibb.co/ecT625
dual-boot grub2 uefi
add a comment |
I recently installed Ubuntu in dual boot along with Windows 10 on an HP laptop. Initially I was unable to boot up Windows using grub as selecting the Windows options would just loop back to grub.
Then I performed a boot repair, and all these extra options showed up in the grub menu.
I'm able to open up Windows using "Windows UEFI bootmgfw.efi" option, but not using the standard option of "Windows Boot Manager (on /dev/sda1).
How do I reduce these entries and why can't I boot Windows using the latter option?
Here's an image of grub. The first option is Ubuntu:
https://ibb.co/ecT625
dual-boot grub2 uefi
1
Possible duplicate of How do I remove old kernel versions to clean up the boot menu?
– mikewhatever
Jul 22 '17 at 7:41
2
It isn't really a duplicate of that. Mine doesn't show Linux kernel entries. Plus the point that I'm unable to boot Windows using the boot manager option.
– Abhay
Jul 22 '17 at 7:45
Wow, you're quick! You should only accept after you've tried out an answer, but this one will surely help!!! ;-) Also, did I mention you should really take a back-up before starting or be really, really careful about what you delete?!
– Fabby
Jul 22 '17 at 10:26
Using GRUB Customizer, as Fabby suggests, is likely to help. As to why one option is working and another isn't, we'd need to see the/boot/grub/grub.cfg
file from your system. My suspicion is that the non-working entry is designed for BIOS-based systems, but yours is clearly EFI-based, so a BIOS-mode option is a (literal) non-starter.
– Rod Smith
Jul 24 '17 at 14:14
add a comment |
I recently installed Ubuntu in dual boot along with Windows 10 on an HP laptop. Initially I was unable to boot up Windows using grub as selecting the Windows options would just loop back to grub.
Then I performed a boot repair, and all these extra options showed up in the grub menu.
I'm able to open up Windows using "Windows UEFI bootmgfw.efi" option, but not using the standard option of "Windows Boot Manager (on /dev/sda1).
How do I reduce these entries and why can't I boot Windows using the latter option?
Here's an image of grub. The first option is Ubuntu:
https://ibb.co/ecT625
dual-boot grub2 uefi
I recently installed Ubuntu in dual boot along with Windows 10 on an HP laptop. Initially I was unable to boot up Windows using grub as selecting the Windows options would just loop back to grub.
Then I performed a boot repair, and all these extra options showed up in the grub menu.
I'm able to open up Windows using "Windows UEFI bootmgfw.efi" option, but not using the standard option of "Windows Boot Manager (on /dev/sda1).
How do I reduce these entries and why can't I boot Windows using the latter option?
Here's an image of grub. The first option is Ubuntu:
https://ibb.co/ecT625
dual-boot grub2 uefi
dual-boot grub2 uefi
edited Apr 7 '18 at 0:30
WinEunuuchs2Unix
47.1k1190183
47.1k1190183
asked Jul 22 '17 at 7:31
AbhayAbhay
4814
4814
1
Possible duplicate of How do I remove old kernel versions to clean up the boot menu?
– mikewhatever
Jul 22 '17 at 7:41
2
It isn't really a duplicate of that. Mine doesn't show Linux kernel entries. Plus the point that I'm unable to boot Windows using the boot manager option.
– Abhay
Jul 22 '17 at 7:45
Wow, you're quick! You should only accept after you've tried out an answer, but this one will surely help!!! ;-) Also, did I mention you should really take a back-up before starting or be really, really careful about what you delete?!
– Fabby
Jul 22 '17 at 10:26
Using GRUB Customizer, as Fabby suggests, is likely to help. As to why one option is working and another isn't, we'd need to see the/boot/grub/grub.cfg
file from your system. My suspicion is that the non-working entry is designed for BIOS-based systems, but yours is clearly EFI-based, so a BIOS-mode option is a (literal) non-starter.
– Rod Smith
Jul 24 '17 at 14:14
add a comment |
1
Possible duplicate of How do I remove old kernel versions to clean up the boot menu?
– mikewhatever
Jul 22 '17 at 7:41
2
It isn't really a duplicate of that. Mine doesn't show Linux kernel entries. Plus the point that I'm unable to boot Windows using the boot manager option.
– Abhay
Jul 22 '17 at 7:45
Wow, you're quick! You should only accept after you've tried out an answer, but this one will surely help!!! ;-) Also, did I mention you should really take a back-up before starting or be really, really careful about what you delete?!
– Fabby
Jul 22 '17 at 10:26
Using GRUB Customizer, as Fabby suggests, is likely to help. As to why one option is working and another isn't, we'd need to see the/boot/grub/grub.cfg
file from your system. My suspicion is that the non-working entry is designed for BIOS-based systems, but yours is clearly EFI-based, so a BIOS-mode option is a (literal) non-starter.
– Rod Smith
Jul 24 '17 at 14:14
1
1
Possible duplicate of How do I remove old kernel versions to clean up the boot menu?
– mikewhatever
Jul 22 '17 at 7:41
Possible duplicate of How do I remove old kernel versions to clean up the boot menu?
– mikewhatever
Jul 22 '17 at 7:41
2
2
It isn't really a duplicate of that. Mine doesn't show Linux kernel entries. Plus the point that I'm unable to boot Windows using the boot manager option.
– Abhay
Jul 22 '17 at 7:45
It isn't really a duplicate of that. Mine doesn't show Linux kernel entries. Plus the point that I'm unable to boot Windows using the boot manager option.
– Abhay
Jul 22 '17 at 7:45
Wow, you're quick! You should only accept after you've tried out an answer, but this one will surely help!!! ;-) Also, did I mention you should really take a back-up before starting or be really, really careful about what you delete?!
– Fabby
Jul 22 '17 at 10:26
Wow, you're quick! You should only accept after you've tried out an answer, but this one will surely help!!! ;-) Also, did I mention you should really take a back-up before starting or be really, really careful about what you delete?!
– Fabby
Jul 22 '17 at 10:26
Using GRUB Customizer, as Fabby suggests, is likely to help. As to why one option is working and another isn't, we'd need to see the
/boot/grub/grub.cfg
file from your system. My suspicion is that the non-working entry is designed for BIOS-based systems, but yours is clearly EFI-based, so a BIOS-mode option is a (literal) non-starter.– Rod Smith
Jul 24 '17 at 14:14
Using GRUB Customizer, as Fabby suggests, is likely to help. As to why one option is working and another isn't, we'd need to see the
/boot/grub/grub.cfg
file from your system. My suspicion is that the non-working entry is designed for BIOS-based systems, but yours is clearly EFI-based, so a BIOS-mode option is a (literal) non-starter.– Rod Smith
Jul 24 '17 at 14:14
add a comment |
3 Answers
3
active
oldest
votes
Windows is off-topic here, but the answer is that this is very old technology and the boot sector is only 512 bytes, so it's not big enough to hold everything we would like it to hold.
To easily add and remove entries from grub all on your own, please:
- Take a full system back-up of your entire computer including the other OSes using CloneZilla Live
- No, I wasn't kidding! Take a full system back-up first! :-)
- Whenever someone tells you to install a PPA be very cautious, do your own research if this is what you really want and only then continue
Install grub-customizer by executing the following commands:
sudo add-apt-repository ppa:danielrichter2007/grub-customizer
sudo apt update
sudo apt install grub-customizer
Start
grub-customizer
and customize the hell out of it:
If you run into serious trouble, restore your system back-up.
1
You have a delicate style in answers, and even in your comments. Honestly I really wonder why not everyone marks the correct and useful answer as an answer, frustrates me but I never asked for it. I may copy your comments and paste it after my answers 😂
– Haitham A. El-Ghareeb
Jul 22 '17 at 11:27
I just gave you a plus one on a differentgrub
question on hiding boot menu. However in this case "I'm relatively certain" the answer I just posted on this thread is the correct one. It's happened to me twice now and the repair method is flawless each time.
– WinEunuuchs2Unix
Apr 6 '18 at 23:42
add a comment |
Every time I've run boot-repair
it adds a 5 extra Windows boot options to my main grub
menu that do not work. In your case it has added 11 extra entries!
grub.cfg
shows the problem
The secret can be found within /etc/grub/grub.cfg
file:
### BEGIN /etc/grub.d/25_custom ###
menuentry "Windows UEFI bootmgfw.efi" {
search --fs-uuid --no-floppy --set=root D656-F2A8
chainloader (${root})/EFI/Microsoft/Boot/bootmgfw.efi
}
menuentry "Windows Boot UEFI loader" {
search --fs-uuid --no-floppy --set=root D656-F2A8
chainloader (${root})/EFI/Boot/bkpbootx64.efi
}
menuentry "EFI/ubuntu/fwupx64.efi" {
search --fs-uuid --no-floppy --set=root D656-F2A8
chainloader (${root})/EFI/ubuntu/fwupx64.efi
}
menuentry "Windows UEFI bootmgfw.efi sda1" {
search --fs-uuid --no-floppy --set=root 9478-B6E2
chainloader (${root})/EFI/Microsoft/Boot/bootmgfw.efi
}
menuentry "Windows Boot UEFI loader sda1" {
search --fs-uuid --no-floppy --set=root 9478-B6E2
chainloader (${root})/EFI/Boot/bkpbootx64.efi
### END /etc/grub.d/25_custom ###
### BEGIN /etc/grub.d/30_os-prober ###
menuentry 'Windows Boot Manager (on /dev/nvme0n1p2)' --class windows --class os $menuentry_id_option 'osprober-efi-D656-F2A8' {
savedefault
insmod part_gpt
insmod fat
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root D656-F2A8
else
search --no-floppy --fs-uuid --set=root D656-F2A8
fi
chainloader /EFI/Microsoft/Boot/bootmgfw.efi
}
menuentry 'Windows Boot Manager (on /dev/sda1)' --class windows --class os $menuentry_id_option 'osprober-efi-9478-B6E2' {
savedefault
insmod part_gpt
insmod fat
set root='hd0,gpt1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1 9478-B6E2
else
search --no-floppy --fs-uuid --set=root 9478-B6E2
fi
chainloader /efi/Microsoft/Boot/bootmgfw.efi
}
### END /etc/grub.d/30_os-prober ###
The section 30_os-prober
contains the "good" Windows grub
menu entries you want to keep. Section 25_custom
contains the bogus entries created by boot-repair
. You can't edit the grub configuration file because it will simply be overwritten the next time update-grub
is run.
Section 25_custom
was created by Boot Repair
On my system:
$ locate 25_custom
/boot/efi/boot-repair/log/20171111_224241/nvme0n1p5/25_custom
/boot/efi/boot-repair/log/20171208_030854/nvme0n1p5/25_custom
/etc/grub.d/25_custom
Take a look at the extra Windows options that were setup (and don't work):
$ cat /boot/efi/boot-repair/log/20171208_030854/nvme0n1p5/25_custom
#!/bin/sh
exec tail -n +3 $0
menuentry "Windows UEFI bootmgfw.efi" {
search --fs-uuid --no-floppy --set=root D656-F2A8
chainloader (${root})/EFI/Microsoft/Boot/bootmgfw.efi
}
menuentry "Windows Boot UEFI loader" {
search --fs-uuid --no-floppy --set=root D656-F2A8
chainloader (${root})/EFI/Boot/bkpbootx64.efi
}
menuentry "EFI/ubuntu/fwupx64.efi" {
search --fs-uuid --no-floppy --set=root D656-F2A8
chainloader (${root})/EFI/ubuntu/fwupx64.efi
}
menuentry "Windows UEFI bootmgfw.efi sda1" {
search --fs-uuid --no-floppy --set=root 9478-B6E2
chainloader (${root})/EFI/Microsoft/Boot/bootmgfw.efi
}
menuentry "Windows Boot UEFI loader sda1" {
search --fs-uuid --no-floppy --set=root 9478-B6E2
chainloader (${root})/EFI/Boot/bkpbootx64.efi
These are the erroneous entries boot-repair
created in /etc/grub.d/25_custom
that were subsequently compiled into bootgrubgrub.cfg
.
Reverse Boot Repair's change to 25_custom
You want to edit the file /etc/grub.d/25_custom
and delete everything except the first three lines:
#!/bin/sh
exec tail -n +3 $0
- The file now contains two lines with text and one blank line.
- Save the file.
- Run
sudo update-grub
. - Reboot.
Now your menu is no longer bloated with five bogus Windows menu entries that don't work.
Double-check there are three lines in 25_custom
Run this command and verify 25_custom
has three lines:
$ wc /etc/grub.d/25_custom
3 6 30
# ^ ^ ^
# | | +--- Number of characters
# | +----------- Number of words
# +------------------- Number of lines
I added the #
comments to decipher wc
(word count) output.
1
I can't downvote my own answer nor delete it, but I can upvote you... :) Beware that a GUI solution will always get more votes than a text-based solution though the text-based solution is generally more exact (=technically better)
– Fabby
Apr 7 '18 at 8:48
This worked perfectly for me - thank you!
– Scott Deagan
Oct 8 '18 at 0:09
1
As I just got an upvote on my answer, I'm surprised to see that your non-GUI has racked up more votes than mine! Good job!
– Fabby
Nov 19 '18 at 11:52
1
@Fabby Thanks. I just gave yours an up-vote too :)
– WinEunuuchs2Unix
Nov 19 '18 at 11:54
add a comment |
Every time I've run boot-repair it adds a 5 extra Windows boot options
to my main grub menu that do not work. In your case it has added 11
extra entries! grub.cfg shows the problem
The secret can be found within /etc/grub/grub.cfg file:
BEGIN /etc/grub.d/25_custom
menuentry "Windows UEFI bootmgfw.efi" { search --fs-uuid --no-floppy --set=root D656-F2A8 chainloader (${root})/EFI/Microsoft/Boot/bootmgfw.efi }
menuentry "Windows Boot UEFI loader" { search --fs-uuid --no-floppy
--set=root D656-F2A8 chainloader (${root})/EFI/Boot/bkpbootx64.efi }
menuentry "EFI/ubuntu/fwupx64.efi" { search --fs-uuid --no-floppy
--set=root D656-F2A8 chainloader (${root})/EFI/ubuntu/fwupx64.efi }
menuentry "Windows UEFI bootmgfw.efi sda1" { search --fs-uuid
--no-floppy --set=root 9478-B6E2 chainloader (${root})/EFI/Microsoft/Boot/bootmgfw.efi }
menuentry "Windows Boot UEFI loader sda1" { search --fs-uuid
--no-floppy --set=root 9478-B6E2 chainloader (${root})/EFI/Boot/bkpbootx64.efi
END /etc/grub.d/25_custom
BEGIN /etc/grub.d/30_os-prober ### menuentry 'Windows Boot Manager (on /dev/nvme0n1p2)' --class windows --class os $menuentry_id_option
'osprober-efi-D656-F2A8' {
savedefault
insmod part_gpt
insmod fat
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root D656-F2A8
else
search --no-floppy --fs-uuid --set=root D656-F2A8
fi
chainloader /EFI/Microsoft/Boot/bootmgfw.efi } menuentry 'Windows Boot Manager (on /dev/sda1)' --class windows --class os
$menuentry_id_option 'osprober-efi-9478-B6E2' {
savedefault
insmod part_gpt
insmod fat
set root='hd0,gpt1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1 9478-B6E2
else
search --no-floppy --fs-uuid --set=root 9478-B6E2
fi
chainloader /efi/Microsoft/Boot/bootmgfw.efi }
END /etc/grub.d/30_os-prober
The section 30_os-prober contains the "good" Windows grub menu entries
you want to keep. Section 25_custom contains the bogus entries created
by boot-repair. You can't edit the grub configuration file because it
will simply be overwritten the next time update-grub is run. Section
25_custom was created by Boot Repair
On my system:
$ locate 25_custom
/boot/efi/boot-repair/log/20171111_224241/nvme0n1p5/25_custom
/boot/efi/boot-repair/log/20171208_030854/nvme0n1p5/25_custom
/etc/grub.d/25_custom
Take a look at the extra Windows options that were setup (and don't
work):
$ cat /boot/efi/boot-repair/log/20171208_030854/nvme0n1p5/25_custom
!/bin/sh exec tail -n +3 $0
menuentry "Windows UEFI bootmgfw.efi" { search --fs-uuid --no-floppy
--set=root D656-F2A8 chainloader (${root})/EFI/Microsoft/Boot/bootmgfw.efi }
menuentry "Windows Boot UEFI loader" { search --fs-uuid --no-floppy
--set=root D656-F2A8 chainloader (${root})/EFI/Boot/bkpbootx64.efi }
menuentry "EFI/ubuntu/fwupx64.efi" { search --fs-uuid --no-floppy
--set=root D656-F2A8 chainloader (${root})/EFI/ubuntu/fwupx64.efi }
menuentry "Windows UEFI bootmgfw.efi sda1" { search --fs-uuid
--no-floppy --set=root 9478-B6E2 chainloader (${root})/EFI/Microsoft/Boot/bootmgfw.efi }
menuentry "Windows Boot UEFI loader sda1" { search --fs-uuid
--no-floppy --set=root 9478-B6E2 chainloader (${root})/EFI/Boot/bkpbootx64.efi
These are the erroneous entries boot-repair created in
/etc/grub.d/25_custom that were subsequently compiled into
bootgrubgrub.cfg. Reverse Boot Repair's change to 25_custom
You want to edit the file /etc/grub.d/25_custom and delete everything
except the first three lines:
!/bin/sh exec tail -n +3 $0
The file now contains two lines with text and one blank line.
Save the file.
Run sudo update-grub.
Reboot.
Now your menu is no longer bloated with five bogus Windows menu
entries that don't work. Double-check there are three lines in
25_custom
Run this command and verify 25_custom has three lines:
$ wc /etc/grub.d/25_custom
3 6 30
^ ^ ^
| | +--- Number of characters
| +----------- Number of words
+------------------- Number of lines
I added the # comments to decipher wc (word count) output.
I have tried to edit 25_custom file as Fabby has described.
However, unbuntu will not save the edited text file.
I do not know what to do from here, as I am a beginner.
I using ubuntu 18.10, in advanced mode,(not advanced recovery mode)
How can these extra options, created by Boot-repair, be removed from 25_custom?
-Andrew
$
/etc/grub.d/25_custom
'#!/bin/sh
exec tail -n +3 $0
menuentry "Windows UEFI bootmgfw.efi" {
search --fs-uuid --no-floppy --set=root 8611-7AF2
chainloader (${root})/EFI/Microsoft/Boot/bootmgfw.efi
}
menuentry "Windows Boot UEFI loader" {
search --fs-uuid --no-floppy --set=root 8611-7AF2
chainloader (${root})/EFI/Boot/bkpbootx64.efi
}
menuentry "Windows Boot UEFI fbx64.efi" {
search --fs-uuid --no-floppy --set=root 8611-7AF2
chainloader (${root})/EFI/Boot/fbx64.efi
}
menuentry "Windows Boot UEFI mmx64.efi" {
search --fs-uuid --no-floppy --set=root 8611-7AF2
chainloader (${root})/EFI/Boot/mmx64.efi
}
menuentry "EFI/ubuntu/MokManager.efi" {
search --fs-uuid --no-floppy --set=root 8611-7AF2
chainloader (${root})/EFI/ubuntu/MokManager.efi
}
menuentry "EFI/ubuntu/fwupx64.efi" {
search --fs-uuid --no-floppy --set=root 8611-7AF2
chainloader (${root})/EFI/ubuntu/fwupx64.efi
}
menuentry "EFI/ubuntu/mmx64.efi" {
search --fs-uuid --no-floppy --set=root 8611-7AF2
chainloader (${root})/EFI/ubuntu/mmx64.efi
}
menuentry "EFI/HP/BIOSUpdate/CryptRSA.efi" {
search --fs-uuid --no-floppy --set=root 8611-7AF2
chainloader (${root})/EFI/HP/BIOSUpdate/CryptRSA.efi
}
menuentry "EFI/HP/BIOSUpdate/HpBiosMgmt.efi" {
search --fs-uuid --no-floppy --set=root 8611-7AF2
chainloader (${root})/EFI/HP/BIOSUpdate/HpBiosMgmt.efi
}
menuentry "EFI/HP/BIOSUpdate/HpBiosUpdate.efi" {
search --fs-uuid --no-floppy --set=root 8611-7AF2
chainloader (${root})/EFI/HP/BIOSUpdate/HpBiosUpdate.efi
}
menuentry "EFI/HP/SystemDiags/CryptRSA.efi" {
search --fs-uuid --no-floppy --set=root 8611-7AF2
chainloader (${root})/EFI/HP/SystemDiags/CryptRSA.efi
}
menuentry "EFI/HP/SystemDiags/HpSysDiags.efi" {
search --fs-uuid --no-floppy --set=root 8611-7AF2
chainloader (${root})/EFI/HP/SystemDiags/HpSysDiags.efi
}
menuentry "EFI/HP/SystemDiags/SystemDiags.efi" {
search --fs-uuid --no-floppy --set=root 8611-7AF2
chainloader (${root})/EFI/HP/SystemDiags/SystemDiags.efi
}'
$
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f938633%2fboot-repair-created-too-many-grub-menu-entries-for-windows%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
Windows is off-topic here, but the answer is that this is very old technology and the boot sector is only 512 bytes, so it's not big enough to hold everything we would like it to hold.
To easily add and remove entries from grub all on your own, please:
- Take a full system back-up of your entire computer including the other OSes using CloneZilla Live
- No, I wasn't kidding! Take a full system back-up first! :-)
- Whenever someone tells you to install a PPA be very cautious, do your own research if this is what you really want and only then continue
Install grub-customizer by executing the following commands:
sudo add-apt-repository ppa:danielrichter2007/grub-customizer
sudo apt update
sudo apt install grub-customizer
Start
grub-customizer
and customize the hell out of it:
If you run into serious trouble, restore your system back-up.
1
You have a delicate style in answers, and even in your comments. Honestly I really wonder why not everyone marks the correct and useful answer as an answer, frustrates me but I never asked for it. I may copy your comments and paste it after my answers 😂
– Haitham A. El-Ghareeb
Jul 22 '17 at 11:27
I just gave you a plus one on a differentgrub
question on hiding boot menu. However in this case "I'm relatively certain" the answer I just posted on this thread is the correct one. It's happened to me twice now and the repair method is flawless each time.
– WinEunuuchs2Unix
Apr 6 '18 at 23:42
add a comment |
Windows is off-topic here, but the answer is that this is very old technology and the boot sector is only 512 bytes, so it's not big enough to hold everything we would like it to hold.
To easily add and remove entries from grub all on your own, please:
- Take a full system back-up of your entire computer including the other OSes using CloneZilla Live
- No, I wasn't kidding! Take a full system back-up first! :-)
- Whenever someone tells you to install a PPA be very cautious, do your own research if this is what you really want and only then continue
Install grub-customizer by executing the following commands:
sudo add-apt-repository ppa:danielrichter2007/grub-customizer
sudo apt update
sudo apt install grub-customizer
Start
grub-customizer
and customize the hell out of it:
If you run into serious trouble, restore your system back-up.
1
You have a delicate style in answers, and even in your comments. Honestly I really wonder why not everyone marks the correct and useful answer as an answer, frustrates me but I never asked for it. I may copy your comments and paste it after my answers 😂
– Haitham A. El-Ghareeb
Jul 22 '17 at 11:27
I just gave you a plus one on a differentgrub
question on hiding boot menu. However in this case "I'm relatively certain" the answer I just posted on this thread is the correct one. It's happened to me twice now and the repair method is flawless each time.
– WinEunuuchs2Unix
Apr 6 '18 at 23:42
add a comment |
Windows is off-topic here, but the answer is that this is very old technology and the boot sector is only 512 bytes, so it's not big enough to hold everything we would like it to hold.
To easily add and remove entries from grub all on your own, please:
- Take a full system back-up of your entire computer including the other OSes using CloneZilla Live
- No, I wasn't kidding! Take a full system back-up first! :-)
- Whenever someone tells you to install a PPA be very cautious, do your own research if this is what you really want and only then continue
Install grub-customizer by executing the following commands:
sudo add-apt-repository ppa:danielrichter2007/grub-customizer
sudo apt update
sudo apt install grub-customizer
Start
grub-customizer
and customize the hell out of it:
If you run into serious trouble, restore your system back-up.
Windows is off-topic here, but the answer is that this is very old technology and the boot sector is only 512 bytes, so it's not big enough to hold everything we would like it to hold.
To easily add and remove entries from grub all on your own, please:
- Take a full system back-up of your entire computer including the other OSes using CloneZilla Live
- No, I wasn't kidding! Take a full system back-up first! :-)
- Whenever someone tells you to install a PPA be very cautious, do your own research if this is what you really want and only then continue
Install grub-customizer by executing the following commands:
sudo add-apt-repository ppa:danielrichter2007/grub-customizer
sudo apt update
sudo apt install grub-customizer
Start
grub-customizer
and customize the hell out of it:
If you run into serious trouble, restore your system back-up.
edited Jul 22 '17 at 10:27
answered Jul 22 '17 at 10:20
FabbyFabby
27.1k1360161
27.1k1360161
1
You have a delicate style in answers, and even in your comments. Honestly I really wonder why not everyone marks the correct and useful answer as an answer, frustrates me but I never asked for it. I may copy your comments and paste it after my answers 😂
– Haitham A. El-Ghareeb
Jul 22 '17 at 11:27
I just gave you a plus one on a differentgrub
question on hiding boot menu. However in this case "I'm relatively certain" the answer I just posted on this thread is the correct one. It's happened to me twice now and the repair method is flawless each time.
– WinEunuuchs2Unix
Apr 6 '18 at 23:42
add a comment |
1
You have a delicate style in answers, and even in your comments. Honestly I really wonder why not everyone marks the correct and useful answer as an answer, frustrates me but I never asked for it. I may copy your comments and paste it after my answers 😂
– Haitham A. El-Ghareeb
Jul 22 '17 at 11:27
I just gave you a plus one on a differentgrub
question on hiding boot menu. However in this case "I'm relatively certain" the answer I just posted on this thread is the correct one. It's happened to me twice now and the repair method is flawless each time.
– WinEunuuchs2Unix
Apr 6 '18 at 23:42
1
1
You have a delicate style in answers, and even in your comments. Honestly I really wonder why not everyone marks the correct and useful answer as an answer, frustrates me but I never asked for it. I may copy your comments and paste it after my answers 😂
– Haitham A. El-Ghareeb
Jul 22 '17 at 11:27
You have a delicate style in answers, and even in your comments. Honestly I really wonder why not everyone marks the correct and useful answer as an answer, frustrates me but I never asked for it. I may copy your comments and paste it after my answers 😂
– Haitham A. El-Ghareeb
Jul 22 '17 at 11:27
I just gave you a plus one on a different
grub
question on hiding boot menu. However in this case "I'm relatively certain" the answer I just posted on this thread is the correct one. It's happened to me twice now and the repair method is flawless each time.– WinEunuuchs2Unix
Apr 6 '18 at 23:42
I just gave you a plus one on a different
grub
question on hiding boot menu. However in this case "I'm relatively certain" the answer I just posted on this thread is the correct one. It's happened to me twice now and the repair method is flawless each time.– WinEunuuchs2Unix
Apr 6 '18 at 23:42
add a comment |
Every time I've run boot-repair
it adds a 5 extra Windows boot options to my main grub
menu that do not work. In your case it has added 11 extra entries!
grub.cfg
shows the problem
The secret can be found within /etc/grub/grub.cfg
file:
### BEGIN /etc/grub.d/25_custom ###
menuentry "Windows UEFI bootmgfw.efi" {
search --fs-uuid --no-floppy --set=root D656-F2A8
chainloader (${root})/EFI/Microsoft/Boot/bootmgfw.efi
}
menuentry "Windows Boot UEFI loader" {
search --fs-uuid --no-floppy --set=root D656-F2A8
chainloader (${root})/EFI/Boot/bkpbootx64.efi
}
menuentry "EFI/ubuntu/fwupx64.efi" {
search --fs-uuid --no-floppy --set=root D656-F2A8
chainloader (${root})/EFI/ubuntu/fwupx64.efi
}
menuentry "Windows UEFI bootmgfw.efi sda1" {
search --fs-uuid --no-floppy --set=root 9478-B6E2
chainloader (${root})/EFI/Microsoft/Boot/bootmgfw.efi
}
menuentry "Windows Boot UEFI loader sda1" {
search --fs-uuid --no-floppy --set=root 9478-B6E2
chainloader (${root})/EFI/Boot/bkpbootx64.efi
### END /etc/grub.d/25_custom ###
### BEGIN /etc/grub.d/30_os-prober ###
menuentry 'Windows Boot Manager (on /dev/nvme0n1p2)' --class windows --class os $menuentry_id_option 'osprober-efi-D656-F2A8' {
savedefault
insmod part_gpt
insmod fat
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root D656-F2A8
else
search --no-floppy --fs-uuid --set=root D656-F2A8
fi
chainloader /EFI/Microsoft/Boot/bootmgfw.efi
}
menuentry 'Windows Boot Manager (on /dev/sda1)' --class windows --class os $menuentry_id_option 'osprober-efi-9478-B6E2' {
savedefault
insmod part_gpt
insmod fat
set root='hd0,gpt1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1 9478-B6E2
else
search --no-floppy --fs-uuid --set=root 9478-B6E2
fi
chainloader /efi/Microsoft/Boot/bootmgfw.efi
}
### END /etc/grub.d/30_os-prober ###
The section 30_os-prober
contains the "good" Windows grub
menu entries you want to keep. Section 25_custom
contains the bogus entries created by boot-repair
. You can't edit the grub configuration file because it will simply be overwritten the next time update-grub
is run.
Section 25_custom
was created by Boot Repair
On my system:
$ locate 25_custom
/boot/efi/boot-repair/log/20171111_224241/nvme0n1p5/25_custom
/boot/efi/boot-repair/log/20171208_030854/nvme0n1p5/25_custom
/etc/grub.d/25_custom
Take a look at the extra Windows options that were setup (and don't work):
$ cat /boot/efi/boot-repair/log/20171208_030854/nvme0n1p5/25_custom
#!/bin/sh
exec tail -n +3 $0
menuentry "Windows UEFI bootmgfw.efi" {
search --fs-uuid --no-floppy --set=root D656-F2A8
chainloader (${root})/EFI/Microsoft/Boot/bootmgfw.efi
}
menuentry "Windows Boot UEFI loader" {
search --fs-uuid --no-floppy --set=root D656-F2A8
chainloader (${root})/EFI/Boot/bkpbootx64.efi
}
menuentry "EFI/ubuntu/fwupx64.efi" {
search --fs-uuid --no-floppy --set=root D656-F2A8
chainloader (${root})/EFI/ubuntu/fwupx64.efi
}
menuentry "Windows UEFI bootmgfw.efi sda1" {
search --fs-uuid --no-floppy --set=root 9478-B6E2
chainloader (${root})/EFI/Microsoft/Boot/bootmgfw.efi
}
menuentry "Windows Boot UEFI loader sda1" {
search --fs-uuid --no-floppy --set=root 9478-B6E2
chainloader (${root})/EFI/Boot/bkpbootx64.efi
These are the erroneous entries boot-repair
created in /etc/grub.d/25_custom
that were subsequently compiled into bootgrubgrub.cfg
.
Reverse Boot Repair's change to 25_custom
You want to edit the file /etc/grub.d/25_custom
and delete everything except the first three lines:
#!/bin/sh
exec tail -n +3 $0
- The file now contains two lines with text and one blank line.
- Save the file.
- Run
sudo update-grub
. - Reboot.
Now your menu is no longer bloated with five bogus Windows menu entries that don't work.
Double-check there are three lines in 25_custom
Run this command and verify 25_custom
has three lines:
$ wc /etc/grub.d/25_custom
3 6 30
# ^ ^ ^
# | | +--- Number of characters
# | +----------- Number of words
# +------------------- Number of lines
I added the #
comments to decipher wc
(word count) output.
1
I can't downvote my own answer nor delete it, but I can upvote you... :) Beware that a GUI solution will always get more votes than a text-based solution though the text-based solution is generally more exact (=technically better)
– Fabby
Apr 7 '18 at 8:48
This worked perfectly for me - thank you!
– Scott Deagan
Oct 8 '18 at 0:09
1
As I just got an upvote on my answer, I'm surprised to see that your non-GUI has racked up more votes than mine! Good job!
– Fabby
Nov 19 '18 at 11:52
1
@Fabby Thanks. I just gave yours an up-vote too :)
– WinEunuuchs2Unix
Nov 19 '18 at 11:54
add a comment |
Every time I've run boot-repair
it adds a 5 extra Windows boot options to my main grub
menu that do not work. In your case it has added 11 extra entries!
grub.cfg
shows the problem
The secret can be found within /etc/grub/grub.cfg
file:
### BEGIN /etc/grub.d/25_custom ###
menuentry "Windows UEFI bootmgfw.efi" {
search --fs-uuid --no-floppy --set=root D656-F2A8
chainloader (${root})/EFI/Microsoft/Boot/bootmgfw.efi
}
menuentry "Windows Boot UEFI loader" {
search --fs-uuid --no-floppy --set=root D656-F2A8
chainloader (${root})/EFI/Boot/bkpbootx64.efi
}
menuentry "EFI/ubuntu/fwupx64.efi" {
search --fs-uuid --no-floppy --set=root D656-F2A8
chainloader (${root})/EFI/ubuntu/fwupx64.efi
}
menuentry "Windows UEFI bootmgfw.efi sda1" {
search --fs-uuid --no-floppy --set=root 9478-B6E2
chainloader (${root})/EFI/Microsoft/Boot/bootmgfw.efi
}
menuentry "Windows Boot UEFI loader sda1" {
search --fs-uuid --no-floppy --set=root 9478-B6E2
chainloader (${root})/EFI/Boot/bkpbootx64.efi
### END /etc/grub.d/25_custom ###
### BEGIN /etc/grub.d/30_os-prober ###
menuentry 'Windows Boot Manager (on /dev/nvme0n1p2)' --class windows --class os $menuentry_id_option 'osprober-efi-D656-F2A8' {
savedefault
insmod part_gpt
insmod fat
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root D656-F2A8
else
search --no-floppy --fs-uuid --set=root D656-F2A8
fi
chainloader /EFI/Microsoft/Boot/bootmgfw.efi
}
menuentry 'Windows Boot Manager (on /dev/sda1)' --class windows --class os $menuentry_id_option 'osprober-efi-9478-B6E2' {
savedefault
insmod part_gpt
insmod fat
set root='hd0,gpt1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1 9478-B6E2
else
search --no-floppy --fs-uuid --set=root 9478-B6E2
fi
chainloader /efi/Microsoft/Boot/bootmgfw.efi
}
### END /etc/grub.d/30_os-prober ###
The section 30_os-prober
contains the "good" Windows grub
menu entries you want to keep. Section 25_custom
contains the bogus entries created by boot-repair
. You can't edit the grub configuration file because it will simply be overwritten the next time update-grub
is run.
Section 25_custom
was created by Boot Repair
On my system:
$ locate 25_custom
/boot/efi/boot-repair/log/20171111_224241/nvme0n1p5/25_custom
/boot/efi/boot-repair/log/20171208_030854/nvme0n1p5/25_custom
/etc/grub.d/25_custom
Take a look at the extra Windows options that were setup (and don't work):
$ cat /boot/efi/boot-repair/log/20171208_030854/nvme0n1p5/25_custom
#!/bin/sh
exec tail -n +3 $0
menuentry "Windows UEFI bootmgfw.efi" {
search --fs-uuid --no-floppy --set=root D656-F2A8
chainloader (${root})/EFI/Microsoft/Boot/bootmgfw.efi
}
menuentry "Windows Boot UEFI loader" {
search --fs-uuid --no-floppy --set=root D656-F2A8
chainloader (${root})/EFI/Boot/bkpbootx64.efi
}
menuentry "EFI/ubuntu/fwupx64.efi" {
search --fs-uuid --no-floppy --set=root D656-F2A8
chainloader (${root})/EFI/ubuntu/fwupx64.efi
}
menuentry "Windows UEFI bootmgfw.efi sda1" {
search --fs-uuid --no-floppy --set=root 9478-B6E2
chainloader (${root})/EFI/Microsoft/Boot/bootmgfw.efi
}
menuentry "Windows Boot UEFI loader sda1" {
search --fs-uuid --no-floppy --set=root 9478-B6E2
chainloader (${root})/EFI/Boot/bkpbootx64.efi
These are the erroneous entries boot-repair
created in /etc/grub.d/25_custom
that were subsequently compiled into bootgrubgrub.cfg
.
Reverse Boot Repair's change to 25_custom
You want to edit the file /etc/grub.d/25_custom
and delete everything except the first three lines:
#!/bin/sh
exec tail -n +3 $0
- The file now contains two lines with text and one blank line.
- Save the file.
- Run
sudo update-grub
. - Reboot.
Now your menu is no longer bloated with five bogus Windows menu entries that don't work.
Double-check there are three lines in 25_custom
Run this command and verify 25_custom
has three lines:
$ wc /etc/grub.d/25_custom
3 6 30
# ^ ^ ^
# | | +--- Number of characters
# | +----------- Number of words
# +------------------- Number of lines
I added the #
comments to decipher wc
(word count) output.
1
I can't downvote my own answer nor delete it, but I can upvote you... :) Beware that a GUI solution will always get more votes than a text-based solution though the text-based solution is generally more exact (=technically better)
– Fabby
Apr 7 '18 at 8:48
This worked perfectly for me - thank you!
– Scott Deagan
Oct 8 '18 at 0:09
1
As I just got an upvote on my answer, I'm surprised to see that your non-GUI has racked up more votes than mine! Good job!
– Fabby
Nov 19 '18 at 11:52
1
@Fabby Thanks. I just gave yours an up-vote too :)
– WinEunuuchs2Unix
Nov 19 '18 at 11:54
add a comment |
Every time I've run boot-repair
it adds a 5 extra Windows boot options to my main grub
menu that do not work. In your case it has added 11 extra entries!
grub.cfg
shows the problem
The secret can be found within /etc/grub/grub.cfg
file:
### BEGIN /etc/grub.d/25_custom ###
menuentry "Windows UEFI bootmgfw.efi" {
search --fs-uuid --no-floppy --set=root D656-F2A8
chainloader (${root})/EFI/Microsoft/Boot/bootmgfw.efi
}
menuentry "Windows Boot UEFI loader" {
search --fs-uuid --no-floppy --set=root D656-F2A8
chainloader (${root})/EFI/Boot/bkpbootx64.efi
}
menuentry "EFI/ubuntu/fwupx64.efi" {
search --fs-uuid --no-floppy --set=root D656-F2A8
chainloader (${root})/EFI/ubuntu/fwupx64.efi
}
menuentry "Windows UEFI bootmgfw.efi sda1" {
search --fs-uuid --no-floppy --set=root 9478-B6E2
chainloader (${root})/EFI/Microsoft/Boot/bootmgfw.efi
}
menuentry "Windows Boot UEFI loader sda1" {
search --fs-uuid --no-floppy --set=root 9478-B6E2
chainloader (${root})/EFI/Boot/bkpbootx64.efi
### END /etc/grub.d/25_custom ###
### BEGIN /etc/grub.d/30_os-prober ###
menuentry 'Windows Boot Manager (on /dev/nvme0n1p2)' --class windows --class os $menuentry_id_option 'osprober-efi-D656-F2A8' {
savedefault
insmod part_gpt
insmod fat
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root D656-F2A8
else
search --no-floppy --fs-uuid --set=root D656-F2A8
fi
chainloader /EFI/Microsoft/Boot/bootmgfw.efi
}
menuentry 'Windows Boot Manager (on /dev/sda1)' --class windows --class os $menuentry_id_option 'osprober-efi-9478-B6E2' {
savedefault
insmod part_gpt
insmod fat
set root='hd0,gpt1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1 9478-B6E2
else
search --no-floppy --fs-uuid --set=root 9478-B6E2
fi
chainloader /efi/Microsoft/Boot/bootmgfw.efi
}
### END /etc/grub.d/30_os-prober ###
The section 30_os-prober
contains the "good" Windows grub
menu entries you want to keep. Section 25_custom
contains the bogus entries created by boot-repair
. You can't edit the grub configuration file because it will simply be overwritten the next time update-grub
is run.
Section 25_custom
was created by Boot Repair
On my system:
$ locate 25_custom
/boot/efi/boot-repair/log/20171111_224241/nvme0n1p5/25_custom
/boot/efi/boot-repair/log/20171208_030854/nvme0n1p5/25_custom
/etc/grub.d/25_custom
Take a look at the extra Windows options that were setup (and don't work):
$ cat /boot/efi/boot-repair/log/20171208_030854/nvme0n1p5/25_custom
#!/bin/sh
exec tail -n +3 $0
menuentry "Windows UEFI bootmgfw.efi" {
search --fs-uuid --no-floppy --set=root D656-F2A8
chainloader (${root})/EFI/Microsoft/Boot/bootmgfw.efi
}
menuentry "Windows Boot UEFI loader" {
search --fs-uuid --no-floppy --set=root D656-F2A8
chainloader (${root})/EFI/Boot/bkpbootx64.efi
}
menuentry "EFI/ubuntu/fwupx64.efi" {
search --fs-uuid --no-floppy --set=root D656-F2A8
chainloader (${root})/EFI/ubuntu/fwupx64.efi
}
menuentry "Windows UEFI bootmgfw.efi sda1" {
search --fs-uuid --no-floppy --set=root 9478-B6E2
chainloader (${root})/EFI/Microsoft/Boot/bootmgfw.efi
}
menuentry "Windows Boot UEFI loader sda1" {
search --fs-uuid --no-floppy --set=root 9478-B6E2
chainloader (${root})/EFI/Boot/bkpbootx64.efi
These are the erroneous entries boot-repair
created in /etc/grub.d/25_custom
that were subsequently compiled into bootgrubgrub.cfg
.
Reverse Boot Repair's change to 25_custom
You want to edit the file /etc/grub.d/25_custom
and delete everything except the first three lines:
#!/bin/sh
exec tail -n +3 $0
- The file now contains two lines with text and one blank line.
- Save the file.
- Run
sudo update-grub
. - Reboot.
Now your menu is no longer bloated with five bogus Windows menu entries that don't work.
Double-check there are three lines in 25_custom
Run this command and verify 25_custom
has three lines:
$ wc /etc/grub.d/25_custom
3 6 30
# ^ ^ ^
# | | +--- Number of characters
# | +----------- Number of words
# +------------------- Number of lines
I added the #
comments to decipher wc
(word count) output.
Every time I've run boot-repair
it adds a 5 extra Windows boot options to my main grub
menu that do not work. In your case it has added 11 extra entries!
grub.cfg
shows the problem
The secret can be found within /etc/grub/grub.cfg
file:
### BEGIN /etc/grub.d/25_custom ###
menuentry "Windows UEFI bootmgfw.efi" {
search --fs-uuid --no-floppy --set=root D656-F2A8
chainloader (${root})/EFI/Microsoft/Boot/bootmgfw.efi
}
menuentry "Windows Boot UEFI loader" {
search --fs-uuid --no-floppy --set=root D656-F2A8
chainloader (${root})/EFI/Boot/bkpbootx64.efi
}
menuentry "EFI/ubuntu/fwupx64.efi" {
search --fs-uuid --no-floppy --set=root D656-F2A8
chainloader (${root})/EFI/ubuntu/fwupx64.efi
}
menuentry "Windows UEFI bootmgfw.efi sda1" {
search --fs-uuid --no-floppy --set=root 9478-B6E2
chainloader (${root})/EFI/Microsoft/Boot/bootmgfw.efi
}
menuentry "Windows Boot UEFI loader sda1" {
search --fs-uuid --no-floppy --set=root 9478-B6E2
chainloader (${root})/EFI/Boot/bkpbootx64.efi
### END /etc/grub.d/25_custom ###
### BEGIN /etc/grub.d/30_os-prober ###
menuentry 'Windows Boot Manager (on /dev/nvme0n1p2)' --class windows --class os $menuentry_id_option 'osprober-efi-D656-F2A8' {
savedefault
insmod part_gpt
insmod fat
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root D656-F2A8
else
search --no-floppy --fs-uuid --set=root D656-F2A8
fi
chainloader /EFI/Microsoft/Boot/bootmgfw.efi
}
menuentry 'Windows Boot Manager (on /dev/sda1)' --class windows --class os $menuentry_id_option 'osprober-efi-9478-B6E2' {
savedefault
insmod part_gpt
insmod fat
set root='hd0,gpt1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1 9478-B6E2
else
search --no-floppy --fs-uuid --set=root 9478-B6E2
fi
chainloader /efi/Microsoft/Boot/bootmgfw.efi
}
### END /etc/grub.d/30_os-prober ###
The section 30_os-prober
contains the "good" Windows grub
menu entries you want to keep. Section 25_custom
contains the bogus entries created by boot-repair
. You can't edit the grub configuration file because it will simply be overwritten the next time update-grub
is run.
Section 25_custom
was created by Boot Repair
On my system:
$ locate 25_custom
/boot/efi/boot-repair/log/20171111_224241/nvme0n1p5/25_custom
/boot/efi/boot-repair/log/20171208_030854/nvme0n1p5/25_custom
/etc/grub.d/25_custom
Take a look at the extra Windows options that were setup (and don't work):
$ cat /boot/efi/boot-repair/log/20171208_030854/nvme0n1p5/25_custom
#!/bin/sh
exec tail -n +3 $0
menuentry "Windows UEFI bootmgfw.efi" {
search --fs-uuid --no-floppy --set=root D656-F2A8
chainloader (${root})/EFI/Microsoft/Boot/bootmgfw.efi
}
menuentry "Windows Boot UEFI loader" {
search --fs-uuid --no-floppy --set=root D656-F2A8
chainloader (${root})/EFI/Boot/bkpbootx64.efi
}
menuentry "EFI/ubuntu/fwupx64.efi" {
search --fs-uuid --no-floppy --set=root D656-F2A8
chainloader (${root})/EFI/ubuntu/fwupx64.efi
}
menuentry "Windows UEFI bootmgfw.efi sda1" {
search --fs-uuid --no-floppy --set=root 9478-B6E2
chainloader (${root})/EFI/Microsoft/Boot/bootmgfw.efi
}
menuentry "Windows Boot UEFI loader sda1" {
search --fs-uuid --no-floppy --set=root 9478-B6E2
chainloader (${root})/EFI/Boot/bkpbootx64.efi
These are the erroneous entries boot-repair
created in /etc/grub.d/25_custom
that were subsequently compiled into bootgrubgrub.cfg
.
Reverse Boot Repair's change to 25_custom
You want to edit the file /etc/grub.d/25_custom
and delete everything except the first three lines:
#!/bin/sh
exec tail -n +3 $0
- The file now contains two lines with text and one blank line.
- Save the file.
- Run
sudo update-grub
. - Reboot.
Now your menu is no longer bloated with five bogus Windows menu entries that don't work.
Double-check there are three lines in 25_custom
Run this command and verify 25_custom
has three lines:
$ wc /etc/grub.d/25_custom
3 6 30
# ^ ^ ^
# | | +--- Number of characters
# | +----------- Number of words
# +------------------- Number of lines
I added the #
comments to decipher wc
(word count) output.
edited Nov 19 '18 at 11:53
Fabby
27.1k1360161
27.1k1360161
answered Apr 6 '18 at 23:38
WinEunuuchs2UnixWinEunuuchs2Unix
47.1k1190183
47.1k1190183
1
I can't downvote my own answer nor delete it, but I can upvote you... :) Beware that a GUI solution will always get more votes than a text-based solution though the text-based solution is generally more exact (=technically better)
– Fabby
Apr 7 '18 at 8:48
This worked perfectly for me - thank you!
– Scott Deagan
Oct 8 '18 at 0:09
1
As I just got an upvote on my answer, I'm surprised to see that your non-GUI has racked up more votes than mine! Good job!
– Fabby
Nov 19 '18 at 11:52
1
@Fabby Thanks. I just gave yours an up-vote too :)
– WinEunuuchs2Unix
Nov 19 '18 at 11:54
add a comment |
1
I can't downvote my own answer nor delete it, but I can upvote you... :) Beware that a GUI solution will always get more votes than a text-based solution though the text-based solution is generally more exact (=technically better)
– Fabby
Apr 7 '18 at 8:48
This worked perfectly for me - thank you!
– Scott Deagan
Oct 8 '18 at 0:09
1
As I just got an upvote on my answer, I'm surprised to see that your non-GUI has racked up more votes than mine! Good job!
– Fabby
Nov 19 '18 at 11:52
1
@Fabby Thanks. I just gave yours an up-vote too :)
– WinEunuuchs2Unix
Nov 19 '18 at 11:54
1
1
I can't downvote my own answer nor delete it, but I can upvote you... :) Beware that a GUI solution will always get more votes than a text-based solution though the text-based solution is generally more exact (=technically better)
– Fabby
Apr 7 '18 at 8:48
I can't downvote my own answer nor delete it, but I can upvote you... :) Beware that a GUI solution will always get more votes than a text-based solution though the text-based solution is generally more exact (=technically better)
– Fabby
Apr 7 '18 at 8:48
This worked perfectly for me - thank you!
– Scott Deagan
Oct 8 '18 at 0:09
This worked perfectly for me - thank you!
– Scott Deagan
Oct 8 '18 at 0:09
1
1
As I just got an upvote on my answer, I'm surprised to see that your non-GUI has racked up more votes than mine! Good job!
– Fabby
Nov 19 '18 at 11:52
As I just got an upvote on my answer, I'm surprised to see that your non-GUI has racked up more votes than mine! Good job!
– Fabby
Nov 19 '18 at 11:52
1
1
@Fabby Thanks. I just gave yours an up-vote too :)
– WinEunuuchs2Unix
Nov 19 '18 at 11:54
@Fabby Thanks. I just gave yours an up-vote too :)
– WinEunuuchs2Unix
Nov 19 '18 at 11:54
add a comment |
Every time I've run boot-repair it adds a 5 extra Windows boot options
to my main grub menu that do not work. In your case it has added 11
extra entries! grub.cfg shows the problem
The secret can be found within /etc/grub/grub.cfg file:
BEGIN /etc/grub.d/25_custom
menuentry "Windows UEFI bootmgfw.efi" { search --fs-uuid --no-floppy --set=root D656-F2A8 chainloader (${root})/EFI/Microsoft/Boot/bootmgfw.efi }
menuentry "Windows Boot UEFI loader" { search --fs-uuid --no-floppy
--set=root D656-F2A8 chainloader (${root})/EFI/Boot/bkpbootx64.efi }
menuentry "EFI/ubuntu/fwupx64.efi" { search --fs-uuid --no-floppy
--set=root D656-F2A8 chainloader (${root})/EFI/ubuntu/fwupx64.efi }
menuentry "Windows UEFI bootmgfw.efi sda1" { search --fs-uuid
--no-floppy --set=root 9478-B6E2 chainloader (${root})/EFI/Microsoft/Boot/bootmgfw.efi }
menuentry "Windows Boot UEFI loader sda1" { search --fs-uuid
--no-floppy --set=root 9478-B6E2 chainloader (${root})/EFI/Boot/bkpbootx64.efi
END /etc/grub.d/25_custom
BEGIN /etc/grub.d/30_os-prober ### menuentry 'Windows Boot Manager (on /dev/nvme0n1p2)' --class windows --class os $menuentry_id_option
'osprober-efi-D656-F2A8' {
savedefault
insmod part_gpt
insmod fat
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root D656-F2A8
else
search --no-floppy --fs-uuid --set=root D656-F2A8
fi
chainloader /EFI/Microsoft/Boot/bootmgfw.efi } menuentry 'Windows Boot Manager (on /dev/sda1)' --class windows --class os
$menuentry_id_option 'osprober-efi-9478-B6E2' {
savedefault
insmod part_gpt
insmod fat
set root='hd0,gpt1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1 9478-B6E2
else
search --no-floppy --fs-uuid --set=root 9478-B6E2
fi
chainloader /efi/Microsoft/Boot/bootmgfw.efi }
END /etc/grub.d/30_os-prober
The section 30_os-prober contains the "good" Windows grub menu entries
you want to keep. Section 25_custom contains the bogus entries created
by boot-repair. You can't edit the grub configuration file because it
will simply be overwritten the next time update-grub is run. Section
25_custom was created by Boot Repair
On my system:
$ locate 25_custom
/boot/efi/boot-repair/log/20171111_224241/nvme0n1p5/25_custom
/boot/efi/boot-repair/log/20171208_030854/nvme0n1p5/25_custom
/etc/grub.d/25_custom
Take a look at the extra Windows options that were setup (and don't
work):
$ cat /boot/efi/boot-repair/log/20171208_030854/nvme0n1p5/25_custom
!/bin/sh exec tail -n +3 $0
menuentry "Windows UEFI bootmgfw.efi" { search --fs-uuid --no-floppy
--set=root D656-F2A8 chainloader (${root})/EFI/Microsoft/Boot/bootmgfw.efi }
menuentry "Windows Boot UEFI loader" { search --fs-uuid --no-floppy
--set=root D656-F2A8 chainloader (${root})/EFI/Boot/bkpbootx64.efi }
menuentry "EFI/ubuntu/fwupx64.efi" { search --fs-uuid --no-floppy
--set=root D656-F2A8 chainloader (${root})/EFI/ubuntu/fwupx64.efi }
menuentry "Windows UEFI bootmgfw.efi sda1" { search --fs-uuid
--no-floppy --set=root 9478-B6E2 chainloader (${root})/EFI/Microsoft/Boot/bootmgfw.efi }
menuentry "Windows Boot UEFI loader sda1" { search --fs-uuid
--no-floppy --set=root 9478-B6E2 chainloader (${root})/EFI/Boot/bkpbootx64.efi
These are the erroneous entries boot-repair created in
/etc/grub.d/25_custom that were subsequently compiled into
bootgrubgrub.cfg. Reverse Boot Repair's change to 25_custom
You want to edit the file /etc/grub.d/25_custom and delete everything
except the first three lines:
!/bin/sh exec tail -n +3 $0
The file now contains two lines with text and one blank line.
Save the file.
Run sudo update-grub.
Reboot.
Now your menu is no longer bloated with five bogus Windows menu
entries that don't work. Double-check there are three lines in
25_custom
Run this command and verify 25_custom has three lines:
$ wc /etc/grub.d/25_custom
3 6 30
^ ^ ^
| | +--- Number of characters
| +----------- Number of words
+------------------- Number of lines
I added the # comments to decipher wc (word count) output.
I have tried to edit 25_custom file as Fabby has described.
However, unbuntu will not save the edited text file.
I do not know what to do from here, as I am a beginner.
I using ubuntu 18.10, in advanced mode,(not advanced recovery mode)
How can these extra options, created by Boot-repair, be removed from 25_custom?
-Andrew
$
/etc/grub.d/25_custom
'#!/bin/sh
exec tail -n +3 $0
menuentry "Windows UEFI bootmgfw.efi" {
search --fs-uuid --no-floppy --set=root 8611-7AF2
chainloader (${root})/EFI/Microsoft/Boot/bootmgfw.efi
}
menuentry "Windows Boot UEFI loader" {
search --fs-uuid --no-floppy --set=root 8611-7AF2
chainloader (${root})/EFI/Boot/bkpbootx64.efi
}
menuentry "Windows Boot UEFI fbx64.efi" {
search --fs-uuid --no-floppy --set=root 8611-7AF2
chainloader (${root})/EFI/Boot/fbx64.efi
}
menuentry "Windows Boot UEFI mmx64.efi" {
search --fs-uuid --no-floppy --set=root 8611-7AF2
chainloader (${root})/EFI/Boot/mmx64.efi
}
menuentry "EFI/ubuntu/MokManager.efi" {
search --fs-uuid --no-floppy --set=root 8611-7AF2
chainloader (${root})/EFI/ubuntu/MokManager.efi
}
menuentry "EFI/ubuntu/fwupx64.efi" {
search --fs-uuid --no-floppy --set=root 8611-7AF2
chainloader (${root})/EFI/ubuntu/fwupx64.efi
}
menuentry "EFI/ubuntu/mmx64.efi" {
search --fs-uuid --no-floppy --set=root 8611-7AF2
chainloader (${root})/EFI/ubuntu/mmx64.efi
}
menuentry "EFI/HP/BIOSUpdate/CryptRSA.efi" {
search --fs-uuid --no-floppy --set=root 8611-7AF2
chainloader (${root})/EFI/HP/BIOSUpdate/CryptRSA.efi
}
menuentry "EFI/HP/BIOSUpdate/HpBiosMgmt.efi" {
search --fs-uuid --no-floppy --set=root 8611-7AF2
chainloader (${root})/EFI/HP/BIOSUpdate/HpBiosMgmt.efi
}
menuentry "EFI/HP/BIOSUpdate/HpBiosUpdate.efi" {
search --fs-uuid --no-floppy --set=root 8611-7AF2
chainloader (${root})/EFI/HP/BIOSUpdate/HpBiosUpdate.efi
}
menuentry "EFI/HP/SystemDiags/CryptRSA.efi" {
search --fs-uuid --no-floppy --set=root 8611-7AF2
chainloader (${root})/EFI/HP/SystemDiags/CryptRSA.efi
}
menuentry "EFI/HP/SystemDiags/HpSysDiags.efi" {
search --fs-uuid --no-floppy --set=root 8611-7AF2
chainloader (${root})/EFI/HP/SystemDiags/HpSysDiags.efi
}
menuentry "EFI/HP/SystemDiags/SystemDiags.efi" {
search --fs-uuid --no-floppy --set=root 8611-7AF2
chainloader (${root})/EFI/HP/SystemDiags/SystemDiags.efi
}'
$
add a comment |
Every time I've run boot-repair it adds a 5 extra Windows boot options
to my main grub menu that do not work. In your case it has added 11
extra entries! grub.cfg shows the problem
The secret can be found within /etc/grub/grub.cfg file:
BEGIN /etc/grub.d/25_custom
menuentry "Windows UEFI bootmgfw.efi" { search --fs-uuid --no-floppy --set=root D656-F2A8 chainloader (${root})/EFI/Microsoft/Boot/bootmgfw.efi }
menuentry "Windows Boot UEFI loader" { search --fs-uuid --no-floppy
--set=root D656-F2A8 chainloader (${root})/EFI/Boot/bkpbootx64.efi }
menuentry "EFI/ubuntu/fwupx64.efi" { search --fs-uuid --no-floppy
--set=root D656-F2A8 chainloader (${root})/EFI/ubuntu/fwupx64.efi }
menuentry "Windows UEFI bootmgfw.efi sda1" { search --fs-uuid
--no-floppy --set=root 9478-B6E2 chainloader (${root})/EFI/Microsoft/Boot/bootmgfw.efi }
menuentry "Windows Boot UEFI loader sda1" { search --fs-uuid
--no-floppy --set=root 9478-B6E2 chainloader (${root})/EFI/Boot/bkpbootx64.efi
END /etc/grub.d/25_custom
BEGIN /etc/grub.d/30_os-prober ### menuentry 'Windows Boot Manager (on /dev/nvme0n1p2)' --class windows --class os $menuentry_id_option
'osprober-efi-D656-F2A8' {
savedefault
insmod part_gpt
insmod fat
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root D656-F2A8
else
search --no-floppy --fs-uuid --set=root D656-F2A8
fi
chainloader /EFI/Microsoft/Boot/bootmgfw.efi } menuentry 'Windows Boot Manager (on /dev/sda1)' --class windows --class os
$menuentry_id_option 'osprober-efi-9478-B6E2' {
savedefault
insmod part_gpt
insmod fat
set root='hd0,gpt1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1 9478-B6E2
else
search --no-floppy --fs-uuid --set=root 9478-B6E2
fi
chainloader /efi/Microsoft/Boot/bootmgfw.efi }
END /etc/grub.d/30_os-prober
The section 30_os-prober contains the "good" Windows grub menu entries
you want to keep. Section 25_custom contains the bogus entries created
by boot-repair. You can't edit the grub configuration file because it
will simply be overwritten the next time update-grub is run. Section
25_custom was created by Boot Repair
On my system:
$ locate 25_custom
/boot/efi/boot-repair/log/20171111_224241/nvme0n1p5/25_custom
/boot/efi/boot-repair/log/20171208_030854/nvme0n1p5/25_custom
/etc/grub.d/25_custom
Take a look at the extra Windows options that were setup (and don't
work):
$ cat /boot/efi/boot-repair/log/20171208_030854/nvme0n1p5/25_custom
!/bin/sh exec tail -n +3 $0
menuentry "Windows UEFI bootmgfw.efi" { search --fs-uuid --no-floppy
--set=root D656-F2A8 chainloader (${root})/EFI/Microsoft/Boot/bootmgfw.efi }
menuentry "Windows Boot UEFI loader" { search --fs-uuid --no-floppy
--set=root D656-F2A8 chainloader (${root})/EFI/Boot/bkpbootx64.efi }
menuentry "EFI/ubuntu/fwupx64.efi" { search --fs-uuid --no-floppy
--set=root D656-F2A8 chainloader (${root})/EFI/ubuntu/fwupx64.efi }
menuentry "Windows UEFI bootmgfw.efi sda1" { search --fs-uuid
--no-floppy --set=root 9478-B6E2 chainloader (${root})/EFI/Microsoft/Boot/bootmgfw.efi }
menuentry "Windows Boot UEFI loader sda1" { search --fs-uuid
--no-floppy --set=root 9478-B6E2 chainloader (${root})/EFI/Boot/bkpbootx64.efi
These are the erroneous entries boot-repair created in
/etc/grub.d/25_custom that were subsequently compiled into
bootgrubgrub.cfg. Reverse Boot Repair's change to 25_custom
You want to edit the file /etc/grub.d/25_custom and delete everything
except the first three lines:
!/bin/sh exec tail -n +3 $0
The file now contains two lines with text and one blank line.
Save the file.
Run sudo update-grub.
Reboot.
Now your menu is no longer bloated with five bogus Windows menu
entries that don't work. Double-check there are three lines in
25_custom
Run this command and verify 25_custom has three lines:
$ wc /etc/grub.d/25_custom
3 6 30
^ ^ ^
| | +--- Number of characters
| +----------- Number of words
+------------------- Number of lines
I added the # comments to decipher wc (word count) output.
I have tried to edit 25_custom file as Fabby has described.
However, unbuntu will not save the edited text file.
I do not know what to do from here, as I am a beginner.
I using ubuntu 18.10, in advanced mode,(not advanced recovery mode)
How can these extra options, created by Boot-repair, be removed from 25_custom?
-Andrew
$
/etc/grub.d/25_custom
'#!/bin/sh
exec tail -n +3 $0
menuentry "Windows UEFI bootmgfw.efi" {
search --fs-uuid --no-floppy --set=root 8611-7AF2
chainloader (${root})/EFI/Microsoft/Boot/bootmgfw.efi
}
menuentry "Windows Boot UEFI loader" {
search --fs-uuid --no-floppy --set=root 8611-7AF2
chainloader (${root})/EFI/Boot/bkpbootx64.efi
}
menuentry "Windows Boot UEFI fbx64.efi" {
search --fs-uuid --no-floppy --set=root 8611-7AF2
chainloader (${root})/EFI/Boot/fbx64.efi
}
menuentry "Windows Boot UEFI mmx64.efi" {
search --fs-uuid --no-floppy --set=root 8611-7AF2
chainloader (${root})/EFI/Boot/mmx64.efi
}
menuentry "EFI/ubuntu/MokManager.efi" {
search --fs-uuid --no-floppy --set=root 8611-7AF2
chainloader (${root})/EFI/ubuntu/MokManager.efi
}
menuentry "EFI/ubuntu/fwupx64.efi" {
search --fs-uuid --no-floppy --set=root 8611-7AF2
chainloader (${root})/EFI/ubuntu/fwupx64.efi
}
menuentry "EFI/ubuntu/mmx64.efi" {
search --fs-uuid --no-floppy --set=root 8611-7AF2
chainloader (${root})/EFI/ubuntu/mmx64.efi
}
menuentry "EFI/HP/BIOSUpdate/CryptRSA.efi" {
search --fs-uuid --no-floppy --set=root 8611-7AF2
chainloader (${root})/EFI/HP/BIOSUpdate/CryptRSA.efi
}
menuentry "EFI/HP/BIOSUpdate/HpBiosMgmt.efi" {
search --fs-uuid --no-floppy --set=root 8611-7AF2
chainloader (${root})/EFI/HP/BIOSUpdate/HpBiosMgmt.efi
}
menuentry "EFI/HP/BIOSUpdate/HpBiosUpdate.efi" {
search --fs-uuid --no-floppy --set=root 8611-7AF2
chainloader (${root})/EFI/HP/BIOSUpdate/HpBiosUpdate.efi
}
menuentry "EFI/HP/SystemDiags/CryptRSA.efi" {
search --fs-uuid --no-floppy --set=root 8611-7AF2
chainloader (${root})/EFI/HP/SystemDiags/CryptRSA.efi
}
menuentry "EFI/HP/SystemDiags/HpSysDiags.efi" {
search --fs-uuid --no-floppy --set=root 8611-7AF2
chainloader (${root})/EFI/HP/SystemDiags/HpSysDiags.efi
}
menuentry "EFI/HP/SystemDiags/SystemDiags.efi" {
search --fs-uuid --no-floppy --set=root 8611-7AF2
chainloader (${root})/EFI/HP/SystemDiags/SystemDiags.efi
}'
$
add a comment |
Every time I've run boot-repair it adds a 5 extra Windows boot options
to my main grub menu that do not work. In your case it has added 11
extra entries! grub.cfg shows the problem
The secret can be found within /etc/grub/grub.cfg file:
BEGIN /etc/grub.d/25_custom
menuentry "Windows UEFI bootmgfw.efi" { search --fs-uuid --no-floppy --set=root D656-F2A8 chainloader (${root})/EFI/Microsoft/Boot/bootmgfw.efi }
menuentry "Windows Boot UEFI loader" { search --fs-uuid --no-floppy
--set=root D656-F2A8 chainloader (${root})/EFI/Boot/bkpbootx64.efi }
menuentry "EFI/ubuntu/fwupx64.efi" { search --fs-uuid --no-floppy
--set=root D656-F2A8 chainloader (${root})/EFI/ubuntu/fwupx64.efi }
menuentry "Windows UEFI bootmgfw.efi sda1" { search --fs-uuid
--no-floppy --set=root 9478-B6E2 chainloader (${root})/EFI/Microsoft/Boot/bootmgfw.efi }
menuentry "Windows Boot UEFI loader sda1" { search --fs-uuid
--no-floppy --set=root 9478-B6E2 chainloader (${root})/EFI/Boot/bkpbootx64.efi
END /etc/grub.d/25_custom
BEGIN /etc/grub.d/30_os-prober ### menuentry 'Windows Boot Manager (on /dev/nvme0n1p2)' --class windows --class os $menuentry_id_option
'osprober-efi-D656-F2A8' {
savedefault
insmod part_gpt
insmod fat
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root D656-F2A8
else
search --no-floppy --fs-uuid --set=root D656-F2A8
fi
chainloader /EFI/Microsoft/Boot/bootmgfw.efi } menuentry 'Windows Boot Manager (on /dev/sda1)' --class windows --class os
$menuentry_id_option 'osprober-efi-9478-B6E2' {
savedefault
insmod part_gpt
insmod fat
set root='hd0,gpt1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1 9478-B6E2
else
search --no-floppy --fs-uuid --set=root 9478-B6E2
fi
chainloader /efi/Microsoft/Boot/bootmgfw.efi }
END /etc/grub.d/30_os-prober
The section 30_os-prober contains the "good" Windows grub menu entries
you want to keep. Section 25_custom contains the bogus entries created
by boot-repair. You can't edit the grub configuration file because it
will simply be overwritten the next time update-grub is run. Section
25_custom was created by Boot Repair
On my system:
$ locate 25_custom
/boot/efi/boot-repair/log/20171111_224241/nvme0n1p5/25_custom
/boot/efi/boot-repair/log/20171208_030854/nvme0n1p5/25_custom
/etc/grub.d/25_custom
Take a look at the extra Windows options that were setup (and don't
work):
$ cat /boot/efi/boot-repair/log/20171208_030854/nvme0n1p5/25_custom
!/bin/sh exec tail -n +3 $0
menuentry "Windows UEFI bootmgfw.efi" { search --fs-uuid --no-floppy
--set=root D656-F2A8 chainloader (${root})/EFI/Microsoft/Boot/bootmgfw.efi }
menuentry "Windows Boot UEFI loader" { search --fs-uuid --no-floppy
--set=root D656-F2A8 chainloader (${root})/EFI/Boot/bkpbootx64.efi }
menuentry "EFI/ubuntu/fwupx64.efi" { search --fs-uuid --no-floppy
--set=root D656-F2A8 chainloader (${root})/EFI/ubuntu/fwupx64.efi }
menuentry "Windows UEFI bootmgfw.efi sda1" { search --fs-uuid
--no-floppy --set=root 9478-B6E2 chainloader (${root})/EFI/Microsoft/Boot/bootmgfw.efi }
menuentry "Windows Boot UEFI loader sda1" { search --fs-uuid
--no-floppy --set=root 9478-B6E2 chainloader (${root})/EFI/Boot/bkpbootx64.efi
These are the erroneous entries boot-repair created in
/etc/grub.d/25_custom that were subsequently compiled into
bootgrubgrub.cfg. Reverse Boot Repair's change to 25_custom
You want to edit the file /etc/grub.d/25_custom and delete everything
except the first three lines:
!/bin/sh exec tail -n +3 $0
The file now contains two lines with text and one blank line.
Save the file.
Run sudo update-grub.
Reboot.
Now your menu is no longer bloated with five bogus Windows menu
entries that don't work. Double-check there are three lines in
25_custom
Run this command and verify 25_custom has three lines:
$ wc /etc/grub.d/25_custom
3 6 30
^ ^ ^
| | +--- Number of characters
| +----------- Number of words
+------------------- Number of lines
I added the # comments to decipher wc (word count) output.
I have tried to edit 25_custom file as Fabby has described.
However, unbuntu will not save the edited text file.
I do not know what to do from here, as I am a beginner.
I using ubuntu 18.10, in advanced mode,(not advanced recovery mode)
How can these extra options, created by Boot-repair, be removed from 25_custom?
-Andrew
$
/etc/grub.d/25_custom
'#!/bin/sh
exec tail -n +3 $0
menuentry "Windows UEFI bootmgfw.efi" {
search --fs-uuid --no-floppy --set=root 8611-7AF2
chainloader (${root})/EFI/Microsoft/Boot/bootmgfw.efi
}
menuentry "Windows Boot UEFI loader" {
search --fs-uuid --no-floppy --set=root 8611-7AF2
chainloader (${root})/EFI/Boot/bkpbootx64.efi
}
menuentry "Windows Boot UEFI fbx64.efi" {
search --fs-uuid --no-floppy --set=root 8611-7AF2
chainloader (${root})/EFI/Boot/fbx64.efi
}
menuentry "Windows Boot UEFI mmx64.efi" {
search --fs-uuid --no-floppy --set=root 8611-7AF2
chainloader (${root})/EFI/Boot/mmx64.efi
}
menuentry "EFI/ubuntu/MokManager.efi" {
search --fs-uuid --no-floppy --set=root 8611-7AF2
chainloader (${root})/EFI/ubuntu/MokManager.efi
}
menuentry "EFI/ubuntu/fwupx64.efi" {
search --fs-uuid --no-floppy --set=root 8611-7AF2
chainloader (${root})/EFI/ubuntu/fwupx64.efi
}
menuentry "EFI/ubuntu/mmx64.efi" {
search --fs-uuid --no-floppy --set=root 8611-7AF2
chainloader (${root})/EFI/ubuntu/mmx64.efi
}
menuentry "EFI/HP/BIOSUpdate/CryptRSA.efi" {
search --fs-uuid --no-floppy --set=root 8611-7AF2
chainloader (${root})/EFI/HP/BIOSUpdate/CryptRSA.efi
}
menuentry "EFI/HP/BIOSUpdate/HpBiosMgmt.efi" {
search --fs-uuid --no-floppy --set=root 8611-7AF2
chainloader (${root})/EFI/HP/BIOSUpdate/HpBiosMgmt.efi
}
menuentry "EFI/HP/BIOSUpdate/HpBiosUpdate.efi" {
search --fs-uuid --no-floppy --set=root 8611-7AF2
chainloader (${root})/EFI/HP/BIOSUpdate/HpBiosUpdate.efi
}
menuentry "EFI/HP/SystemDiags/CryptRSA.efi" {
search --fs-uuid --no-floppy --set=root 8611-7AF2
chainloader (${root})/EFI/HP/SystemDiags/CryptRSA.efi
}
menuentry "EFI/HP/SystemDiags/HpSysDiags.efi" {
search --fs-uuid --no-floppy --set=root 8611-7AF2
chainloader (${root})/EFI/HP/SystemDiags/HpSysDiags.efi
}
menuentry "EFI/HP/SystemDiags/SystemDiags.efi" {
search --fs-uuid --no-floppy --set=root 8611-7AF2
chainloader (${root})/EFI/HP/SystemDiags/SystemDiags.efi
}'
$
Every time I've run boot-repair it adds a 5 extra Windows boot options
to my main grub menu that do not work. In your case it has added 11
extra entries! grub.cfg shows the problem
The secret can be found within /etc/grub/grub.cfg file:
BEGIN /etc/grub.d/25_custom
menuentry "Windows UEFI bootmgfw.efi" { search --fs-uuid --no-floppy --set=root D656-F2A8 chainloader (${root})/EFI/Microsoft/Boot/bootmgfw.efi }
menuentry "Windows Boot UEFI loader" { search --fs-uuid --no-floppy
--set=root D656-F2A8 chainloader (${root})/EFI/Boot/bkpbootx64.efi }
menuentry "EFI/ubuntu/fwupx64.efi" { search --fs-uuid --no-floppy
--set=root D656-F2A8 chainloader (${root})/EFI/ubuntu/fwupx64.efi }
menuentry "Windows UEFI bootmgfw.efi sda1" { search --fs-uuid
--no-floppy --set=root 9478-B6E2 chainloader (${root})/EFI/Microsoft/Boot/bootmgfw.efi }
menuentry "Windows Boot UEFI loader sda1" { search --fs-uuid
--no-floppy --set=root 9478-B6E2 chainloader (${root})/EFI/Boot/bkpbootx64.efi
END /etc/grub.d/25_custom
BEGIN /etc/grub.d/30_os-prober ### menuentry 'Windows Boot Manager (on /dev/nvme0n1p2)' --class windows --class os $menuentry_id_option
'osprober-efi-D656-F2A8' {
savedefault
insmod part_gpt
insmod fat
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root D656-F2A8
else
search --no-floppy --fs-uuid --set=root D656-F2A8
fi
chainloader /EFI/Microsoft/Boot/bootmgfw.efi } menuentry 'Windows Boot Manager (on /dev/sda1)' --class windows --class os
$menuentry_id_option 'osprober-efi-9478-B6E2' {
savedefault
insmod part_gpt
insmod fat
set root='hd0,gpt1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1 9478-B6E2
else
search --no-floppy --fs-uuid --set=root 9478-B6E2
fi
chainloader /efi/Microsoft/Boot/bootmgfw.efi }
END /etc/grub.d/30_os-prober
The section 30_os-prober contains the "good" Windows grub menu entries
you want to keep. Section 25_custom contains the bogus entries created
by boot-repair. You can't edit the grub configuration file because it
will simply be overwritten the next time update-grub is run. Section
25_custom was created by Boot Repair
On my system:
$ locate 25_custom
/boot/efi/boot-repair/log/20171111_224241/nvme0n1p5/25_custom
/boot/efi/boot-repair/log/20171208_030854/nvme0n1p5/25_custom
/etc/grub.d/25_custom
Take a look at the extra Windows options that were setup (and don't
work):
$ cat /boot/efi/boot-repair/log/20171208_030854/nvme0n1p5/25_custom
!/bin/sh exec tail -n +3 $0
menuentry "Windows UEFI bootmgfw.efi" { search --fs-uuid --no-floppy
--set=root D656-F2A8 chainloader (${root})/EFI/Microsoft/Boot/bootmgfw.efi }
menuentry "Windows Boot UEFI loader" { search --fs-uuid --no-floppy
--set=root D656-F2A8 chainloader (${root})/EFI/Boot/bkpbootx64.efi }
menuentry "EFI/ubuntu/fwupx64.efi" { search --fs-uuid --no-floppy
--set=root D656-F2A8 chainloader (${root})/EFI/ubuntu/fwupx64.efi }
menuentry "Windows UEFI bootmgfw.efi sda1" { search --fs-uuid
--no-floppy --set=root 9478-B6E2 chainloader (${root})/EFI/Microsoft/Boot/bootmgfw.efi }
menuentry "Windows Boot UEFI loader sda1" { search --fs-uuid
--no-floppy --set=root 9478-B6E2 chainloader (${root})/EFI/Boot/bkpbootx64.efi
These are the erroneous entries boot-repair created in
/etc/grub.d/25_custom that were subsequently compiled into
bootgrubgrub.cfg. Reverse Boot Repair's change to 25_custom
You want to edit the file /etc/grub.d/25_custom and delete everything
except the first three lines:
!/bin/sh exec tail -n +3 $0
The file now contains two lines with text and one blank line.
Save the file.
Run sudo update-grub.
Reboot.
Now your menu is no longer bloated with five bogus Windows menu
entries that don't work. Double-check there are three lines in
25_custom
Run this command and verify 25_custom has three lines:
$ wc /etc/grub.d/25_custom
3 6 30
^ ^ ^
| | +--- Number of characters
| +----------- Number of words
+------------------- Number of lines
I added the # comments to decipher wc (word count) output.
I have tried to edit 25_custom file as Fabby has described.
However, unbuntu will not save the edited text file.
I do not know what to do from here, as I am a beginner.
I using ubuntu 18.10, in advanced mode,(not advanced recovery mode)
How can these extra options, created by Boot-repair, be removed from 25_custom?
-Andrew
$
/etc/grub.d/25_custom
'#!/bin/sh
exec tail -n +3 $0
menuentry "Windows UEFI bootmgfw.efi" {
search --fs-uuid --no-floppy --set=root 8611-7AF2
chainloader (${root})/EFI/Microsoft/Boot/bootmgfw.efi
}
menuentry "Windows Boot UEFI loader" {
search --fs-uuid --no-floppy --set=root 8611-7AF2
chainloader (${root})/EFI/Boot/bkpbootx64.efi
}
menuentry "Windows Boot UEFI fbx64.efi" {
search --fs-uuid --no-floppy --set=root 8611-7AF2
chainloader (${root})/EFI/Boot/fbx64.efi
}
menuentry "Windows Boot UEFI mmx64.efi" {
search --fs-uuid --no-floppy --set=root 8611-7AF2
chainloader (${root})/EFI/Boot/mmx64.efi
}
menuentry "EFI/ubuntu/MokManager.efi" {
search --fs-uuid --no-floppy --set=root 8611-7AF2
chainloader (${root})/EFI/ubuntu/MokManager.efi
}
menuentry "EFI/ubuntu/fwupx64.efi" {
search --fs-uuid --no-floppy --set=root 8611-7AF2
chainloader (${root})/EFI/ubuntu/fwupx64.efi
}
menuentry "EFI/ubuntu/mmx64.efi" {
search --fs-uuid --no-floppy --set=root 8611-7AF2
chainloader (${root})/EFI/ubuntu/mmx64.efi
}
menuentry "EFI/HP/BIOSUpdate/CryptRSA.efi" {
search --fs-uuid --no-floppy --set=root 8611-7AF2
chainloader (${root})/EFI/HP/BIOSUpdate/CryptRSA.efi
}
menuentry "EFI/HP/BIOSUpdate/HpBiosMgmt.efi" {
search --fs-uuid --no-floppy --set=root 8611-7AF2
chainloader (${root})/EFI/HP/BIOSUpdate/HpBiosMgmt.efi
}
menuentry "EFI/HP/BIOSUpdate/HpBiosUpdate.efi" {
search --fs-uuid --no-floppy --set=root 8611-7AF2
chainloader (${root})/EFI/HP/BIOSUpdate/HpBiosUpdate.efi
}
menuentry "EFI/HP/SystemDiags/CryptRSA.efi" {
search --fs-uuid --no-floppy --set=root 8611-7AF2
chainloader (${root})/EFI/HP/SystemDiags/CryptRSA.efi
}
menuentry "EFI/HP/SystemDiags/HpSysDiags.efi" {
search --fs-uuid --no-floppy --set=root 8611-7AF2
chainloader (${root})/EFI/HP/SystemDiags/HpSysDiags.efi
}
menuentry "EFI/HP/SystemDiags/SystemDiags.efi" {
search --fs-uuid --no-floppy --set=root 8611-7AF2
chainloader (${root})/EFI/HP/SystemDiags/SystemDiags.efi
}'
$
edited 1 hour ago
answered 1 hour ago
blowreedsblowreeds
12
12
add a comment |
add a comment |
Thanks for contributing an answer to Ask Ubuntu!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f938633%2fboot-repair-created-too-many-grub-menu-entries-for-windows%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
Possible duplicate of How do I remove old kernel versions to clean up the boot menu?
– mikewhatever
Jul 22 '17 at 7:41
2
It isn't really a duplicate of that. Mine doesn't show Linux kernel entries. Plus the point that I'm unable to boot Windows using the boot manager option.
– Abhay
Jul 22 '17 at 7:45
Wow, you're quick! You should only accept after you've tried out an answer, but this one will surely help!!! ;-) Also, did I mention you should really take a back-up before starting or be really, really careful about what you delete?!
– Fabby
Jul 22 '17 at 10:26
Using GRUB Customizer, as Fabby suggests, is likely to help. As to why one option is working and another isn't, we'd need to see the
/boot/grub/grub.cfg
file from your system. My suspicion is that the non-working entry is designed for BIOS-based systems, but yours is clearly EFI-based, so a BIOS-mode option is a (literal) non-starter.– Rod Smith
Jul 24 '17 at 14:14