How to add an item for windows into the grub menu? [Solved]
Re: How to add an item for windows into the grub menu?
I am somehow reluctant to change the partition model of the disk, because there are lots of data to backup and restore.
If I format the boot partition again to ntfs, and re-install Windows, would that work? can I then install MX in legacy mode?
If I format the boot partition again to ntfs, and re-install Windows, would that work? can I then install MX in legacy mode?
Re: How to add an item for windows into the grub menu?
OK, First note, the MX installer would have asked whether to use WIndows System "boot" partition as ESP and would ask to confirm you selection to reformat to FAT32 to EFI System Partition.hako wrote: Sun Oct 16, 2022 5:47 am I am somehow reluctant to change the partition model of the disk, because there are lots of data to backup and restore.
If I format the boot partition again to ntfs, and re-install Windows, would that work? can I then install MX in legacy mode?
+++EDIT+++
Note: When running the MX Installer, you would just ignore ESP and not select or create any ESP,
and install GRUB into MBR. This can be done also when booted MX LiveUSB in UEFI mode.
+++
Now what I would do ths:
First, do create a proper MX Live USB, using the tool MX Live USB Maker, which is available within the Installed system. This would than later allow you to boot into legacy BIOS mode from Live USB.
Next when done, you need to restore/recreate window System "boot" partition on sda1
by using Windows own tools:
Something like:
* Create Win10 Boot USB (using woeUSB)
* boot into Windows provided feature to run those win-tools like fixmbr bootrec ...
lots of details on the web how to do this.
+++EDIT+++
Potentially, before booting into Windows Repair tools, do reformat ESP on sda1 to NTFS
using Gparted and also remove "esp" flag but keep the "boot" flag ,
to avoid Windows may be confused about an existing ESP.
You would, still be able to boot into MX Linux, even without any ESP using MX Boot Rescue from LiveUSB,
probably in both boot modes UEFI and BIOS, b/c you already created the GRUB efi loader (this was done
during installation) and the GRUB mbr loader (this was done when running grub-install --target=i386 /dev/sda
+++
After windows boot was restored you would now be able to recreate "bios" GRUB loader
in order to provide BIOS booting into existing MX Linux ( where you have already create the grub-install boot loader files) or just re-run from LiveUSB "MX Boot Repair" and create MBR-grub loader. + regenerate GRUB menu.
Or alternatively boot into installed MX Linux with MX LiveUSB Rescue-Boot, search for GRUB menu, and
install GRUB to mbr with "sudo grub-install --target=i386 /dev/sda"
followed by "sudo update-grub".
This would than allow you to boot into both Windows and MX Linux from GRUB.
Re: How to add an item for windows into the grub menu?
Things are getting adventurous...
MX Live USB: used the MX Live USB Maker (v2.41.18) on the installed MX-21.1 Vers. 22.02.02. It stopped at 99%, another attempt lead to error. MX does not boot from this stick, Uefi: GRUB command line, legacy: black screen.
MX Updater signalled available upgrade: During upgrade Windows was found on sda2, but MX boots to grub rescue after error msg 'grub_disk_native_sectors' not_found. Probably because I only checked sda5 (the boot partition of MX), and not sda1 (the efi partition).
Which commands to use?
MX Live USB: used the MX Live USB Maker (v2.41.18) on the installed MX-21.1 Vers. 22.02.02. It stopped at 99%, another attempt lead to error. MX does not boot from this stick, Uefi: GRUB command line, legacy: black screen.
MX Updater signalled available upgrade: During upgrade Windows was found on sda2, but MX boots to grub rescue after error msg 'grub_disk_native_sectors' not_found. Probably because I only checked sda5 (the boot partition of MX), and not sda1 (the efi partition).
Which commands to use?
Re: How to add an item for windows into the grub menu?
if you still booting in UEFI, keep the boot/esp falsg at ESPhako wrote: Sun Oct 16, 2022 9:14 am Things are getting adventurous...
MX Live USB: used the MX Live USB Maker (v2.41.18) on the installed MX-21.1 Vers. 22.02.02. It stopped at 99%, another attempt lead to error. MX does not boot from this stick, Uefi: GRUB command line, legacy: black screen.
MX Updater signalled available upgrade: During upgrade Windows was found on sda2, but MX boots to grub rescue after error msg 'grub_disk_native_sectors' not_found. Probably because I only checked sda5 (the boot partition of MX), and not sda1 (the efi partition).
Which commands to use?
Depends, in legacy boot mode, you should mark sda2 (windows as boot)
GRUB does not need a boot flags, that only for windows or BIOS-boot
Reboot to the Installed, or use LiveUSB chroot rescue:
and to make sure noting is hanging:
Code: Select all
sudo dpkg --configure -a
sudo apt full-upgrade
and
sudo grub-install --target=i386-pc /dev/sda
Re: How to add an item for windows into the grub menu?
Followed your suggestions, cleared the boot flag in sda1, set it in sda2 (Windows partition). All updates finished.
Now, it is booting in legacy mode into MX-21.2.1 version 22.08.02. I also succeeded to make a live USB stick which can boot in legacy mode.
The Boot menu has also has Windows 10, but it starts to boot (shows the Windows flag), but then stops with error (inaccessible boot device) and reboots.
Now, it is booting in legacy mode into MX-21.2.1 version 22.08.02. I also succeeded to make a live USB stick which can boot in legacy mode.
The Boot menu has also has Windows 10, but it starts to boot (shows the Windows flag), but then stops with error (inaccessible boot device) and reboots.
Re: How to add an item for windows into the grub menu?
OK, now, if not done already, do test first that you can boot with help MX Livehako wrote: Sun Oct 16, 2022 3:20 pm Followed your suggestions, cleared the boot flag in sda1, set it in sda2 (Windows partition). All updates finished.
Now, it is booting in legacy mode into MX-21.2.1 version 22.08.02. I also succeeded to make a live USB stick which can boot in legacy mode.
The Boot menu has also has Windows 10, but it starts to boot (shows the Windows flag), but then stops with error (inaccessible boot device) and reboots.
in legacy BIOS boot mode
-> Switch to GRUB
->Boot Rescue
and try both to find
-> GRUB boot loader
and
-> GRUB menus
If both do let you boot into MX Linux, fine.
Now, you need to "repair" Windows own boot loader,
which originally were located on sda1.
Simplest, do prepare a Windows 10 BootUSB / BootDVD
and repair windows boot loader with Wndows tools,
which would probably re-populate sda1 and also the MBR.
When done check it boots into WIndows.
If OK, boot again with MX LiveUSB using Boot Rescue into installed MX Linux,
and run from terminal command line again:
Code: Select all
sudo grub-install --target=i386-pc /dev/sda
and also
Code: Select all
sudo update-grub
use MX Boot Repair to "install" GRUB and regenerate "grub config" (the grub menu)
Re: How to add an item for windows into the grub menu?
Stuck in repairing the windows boot loader. I have a USB stick to install Windows. When I boot from this stick (only Uefi works), I choose repair, then advanced: Start-up Repair did not succeed. Command prompt, changing to C:
bcdboot c:\windows - failure when attempting to copy boot files
bootrec /fixmbr - runs w/o error
bootrec /fixboot - Element not found
bootrec /rebuildbcd - finds windows, but then Element not found
What can I try?
bcdboot c:\windows - failure when attempting to copy boot files
bootrec /fixmbr - runs w/o error
bootrec /fixboot - Element not found
bootrec /rebuildbcd - finds windows, but then Element not found
What can I try?
Re: How to add an item for windows into the grub menu?
Code: Select all
diskpart
Code: Select all
select disk 0
Code: Select all
list volume
Code: Select all
exit
Code: Select all
D:
Code: Select all
cd boot
Code: Select all
dir
Code: Select all
bootsect.exe /nt60 SYS /mbr /force
Re: How to add an item for windows into the grub menu?
... However this will write the NT bootloader in MBR (as you could also do with dd on MX) (but the main problem is that you lost the Windows' system partition on sda1, you need to re-create that when repairing). (On Windows 7 there was no such thing, it was simpler with just one (the main) partition.. but on Win. 10 ... )
Re: How to add an item for windows into the grub menu?
"bootsect.exe /nt60 SYS /mbr /force": The system partition was not found: The requested system device cannot be found.
My sda1 is ntfs with no flags.
What to do?
My sda1 is ntfs with no flags.
What to do?