How to add an item for windows into the grub menu?  [Solved]

When you run into problems installing MX Linux XFCE
Message
Author
User avatar
fehlix
Developer
Posts: 12883
Joined: Wed Apr 11, 2018 5:09 pm

Re: How to add an item for windows into the grub menu?

#31 Post by fehlix »

hako wrote: Mon Oct 17, 2022 8:35 am "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?
Hmm.. the 100mb sda1 might be anyway to small for Win10,
I'd simply try the remove the sda1 using gparted, it would now either recreate one or try to
use sda2 (C:) as the place to create the bootmgr/bcd boot files.
Or try first to mark as "msftres" and perhabs also relabel the NTFS drive as "System Reserved"

hako
Posts: 26
Joined: Sat Oct 15, 2022 7:19 am

Re: How to add an item for windows into the grub menu?

#32 Post by hako »

Setting the flag msftres on sda1 has the same response by bootsect.exe: ...system partition was not found...
Removing the partition sda1: same result.
My windows partition (sda2) is labelled Win10 and has the boot flag. How to label it "System Reserved"?

User avatar
fehlix
Developer
Posts: 12883
Joined: Wed Apr 11, 2018 5:09 pm

Re: How to add an item for windows into the grub menu?

#33 Post by fehlix »

hako wrote: Mon Oct 17, 2022 9:56 am Setting the flag msftres on sda1 has the same response by bootsect.exe: ...system partition was not found...
Removing the partition sda1: same result.
My windows partition (sda2) is labelled Win10 and has the boot flag. How to label it "System Reserved"?
Do a web search on how to recreate lost System reserved partition. You may find also some advice to use 3rd party tools in case windows own tool are not of any help.


hako
Posts: 26
Joined: Sat Oct 15, 2022 7:19 am

Re: How to add an item for windows into the grub menu?

#35 Post by hako »

With USB install stick -> Repair...-> startup-repair -> command line, I tried "bootsect /nt60 c:". It ran w/o error, but did not solve my problem.
When I choose "Windows 10 (on /dev/sda2)" in the grub boot menu, the windows loading flag shows some time, but then an error (stopcode) "inaccessible boot device" before restarting the PC. On next attempt automatic repair and diagnose will be executed, then it will start again.
sda1: 100 mb ntfs no flag
sda2: Windows partition 'Win10' ntfs boot flag
sda3: reserved partition ntfs msftres flag

Huckleberry Finn

Re: How to add an item for windows into the grub menu?

#36 Post by Huckleberry Finn »

Here's mine (that I never use and though this one is non-uefi) :

You need this sda1 with these contents (and BCD files in Boot folder) flagged as boot. Yes, only about 24 MiB was used.

(When it updates grub, the OS Prober says: "Win 10 found on sda1" ... "Win 7 found on sda2" ... (Actually all is in sda2 and you need to boot from sda1 )
You do not have the required permissions to view the files attached to this post.

Huckleberry Finn

Re: How to add an item for windows into the grub menu?

#37 Post by Huckleberry Finn »

... In fact, if it weren't overwritten (partly and randomly) with the efi files, you could simply turn back (recover lost partitions) with 1-2 simple steps using Testdisk ... I wish sda1 just stayed empty (no harm that it was reformatted)

User avatar
pbear
Posts: 311
Joined: Tue Aug 09, 2022 9:24 pm

Re: How to add an item for windows into the grub menu?

#38 Post by pbear »

Out of curiosity, I gave this a shot with a Win+Linux multi-boot VM. It's something I set up a couple years ago to test Grub tools like 40_custom and custom.cfg. As it's a VM, I could take a snapshot, wipe out the Windows boot partition (sda1) by reformatting, and attempt repair from a Win ISO (the one I have handy is 2004, i.e., Apr'20). Alas, did not work. Frankly, I think you're looking at reinstall. Maybe try a Windows forum first?

Anyhoo, for what it's worth, this is what your partition table is supposed to look like (more or less), and presumably did before the misadventure.
.
WinBiosMultiBoot.png
You do not have the required permissions to view the files attached to this post.

Huckleberry Finn

Re: How to add an item for windows into the grub menu?

#39 Post by Huckleberry Finn »

... If you like, this will be simple, clean:

Just copy-paste (backup) the directory: /Users/Yourusername/ in sda2 to somewhere else.

(If you like only: You can even compress it on the fly: right-click on it and "Create Archive" ... say as: Anyname.7z ... and directly select the destination)

(As you might already know, you can use other available partitions also within that hdd, to save the backup)

... Then install Windows with peace of mind. Later put back that directory and voila , all your customizations, preferences, desktop, task bar are back .

(Just like the home folder in Linux)...

During installation probably Windows will see sda1 ... sda3 as C: D: and E: .. you can guess them (not to select sda3) looking at their sizes...

hako
Posts: 26
Joined: Sat Oct 15, 2022 7:19 am

Re: How to add an item for windows into the grub menu?

#40 Post by hako »

Now, I copied the boot folder and bootmgr from sda2 to sda1, set the boot flag on sda1 and cleared it on sda2.
Then, update-grub.
I got 2 Windows entries sda1 and sda2 in the grub menu.
Selecting sda1 -> not a bootable disk
Selecting sda2 -> started windows repairs which took a long time, and said it could not repair the PC. But, choosing continue re-started the PC, and then choosing Windows (sda2) from grub menu - it started !

So, except the useless sda1 entry in grub menu, all seems ok now. Even Windows update works.
Thank you!

Post Reply

Return to “Installation”