Can't boot freedos after Win10 install

shimonl

Estimable
Dec 31, 2018
3
0
4,520
Hi!
On a new lenovo laptop with freedos on partition-1 (/dev/sda1),
I installed Win10 in partition-2 (/dev/sda2).
Now when I try to boot freedos I get Windows. :(

How do I revive freedos?

I also have two versions of linux in /dev/sda5 and /dev/sda6, and my bootloader is grub2.
It has an entry for freedos, but as I wrote above, that gets me Win10.

Thanks!
 
Solution
*solved*

All I needed was:
ms-sys -4 /dev/sda1

That rebuilt the DOS boot record on the partition, and now it boots freedos.

But thank you for your efforts!

(Is there any way to mark a question as solved, without picking someone else's solution?)

shimonl

Estimable
Dec 31, 2018
3
0
4,520


As I said: my bootloader is grub2.
Obviously installing windows ovewrote that, for about 10 minutes,
until I booted into my linux (with a grub cd), and rewrote the grub2 bootloader.

My grub2 menu has linux-1, linux-2, and windows, all of which work.
My problem is the entry I posted about - booting into /dev/sda1 (freedos),
actually gets me Windows in /dev/sda2.

Here are the grub entries for freedos and windows:

menuentry "FreeDOS (on /dev/sda1)" --class freedos --class os $menuentry_id_option 'osprober-chain-EE5C-6E50' {
savedefault
insmod part_msdos
insmod fat
set root='hd0,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 EE5C-6E50
else
search --no-floppy --fs-uuid --set=root EE5C-6E50
fi
parttool ${root} hidden-
drivemap -s (hd0) ${root}
chainloader +1
}

menuentry "Windows 10"{
set root='(hd0,2)'
chainloader +1
}

(I admit to not understanding all of that entry, it was built automatically)

Thanks
 

TerryLaze

Commendable
May 9, 2016
116
0
1,710

Grub works by providing the correct settings to the bootloader file of the OS (ntldr for windows) that's what the chainloader +1 stands for,DOS does not have such a file because it's not needed for such a simple OS which is why grub when looking for the bootloader for DOS finds the closest thing it can which is the bootloader for windows.

My solution would be to download a FreeDOS boot floppy image and make grub boot that up.
If you want to make it nicer and everything work correctly you will have to copy over from the HDD the config.sys and autoexec.bat possibly editing them if the dos drive doesn't show up as C: ,you will have to use a virtual floppy app on windows or linux to do this,or extract the floppy and recreate it.
 

shimonl

Estimable
Dec 31, 2018
3
0
4,520
*solved*

All I needed was:
ms-sys -4 /dev/sda1

That rebuilt the DOS boot record on the partition, and now it boots freedos.

But thank you for your efforts!

(Is there any way to mark a question as solved, without picking someone else's solution?)
 
Solution