Yes, you should be able to rerun grub, and have it fix the boot problem.  Another option is to just make the linux partition the active partition using fdisk.  It's likely the dos boot somehow made the dos partition the active partition.  I know grub is supposed to handle this, but if grub got removed somehow, that would be the behavior I'd expect.  No need to reinstall linux, all your stuff is still there, just a matter of making the boot process work properly.

I would use fdisk to make the linux partition active, boot into linux, then modify the grub boot menu to include the dos partition, that *should* be all you need to do.  Of course, if something got changed, then it might be more work than that, but of course, you won't know until you take a look.


On 2/29/2024 7:29 PM, Jay F. Shachter via Freedos-user wrote:
Centuries ago, Nostradamus predicted that Charles Hudson via Freedos-user would 
write on Thu Feb 29 10:44:56 2024:

On a Lenovo R400 laptop with an existing Fedora 39 KDE system, booted by
GRUB2, I decided to add a new partition and install FreeDOS 1.3.
The Intel Core2 DUO processor lacks VM extensions so I decided to install
on the SSD.  I resized the BRTFS partition to create a new 3 GiB FAT32
partition, labeled "DOS", on which to install.

Using the FD 1.3 Live CD I proceeded with installation:  If there was a
choice offered of where to install I missed it, but I was relieved to see
installation picked the DOS partition.  Using fdisk I verified the
existence of two Linux partitions and one FAT32 partition, which I made
active.  Installation failed, however, as I found I needed to format the
partition first.  I issued the command "format /s".  After doing so
installation carried to completion.

After reboot the machine booted into a menu of FreeDOS options and after
selecting one processed the initialization files and left me at a C:\
prompt.  However, I seem to have blitzed my Linux installation as the GRUB2
bootloader no longer appears nor loads Fedora 39.

My investigations into the repair of the MBR and attempts at restoration of
GRUB2 have been unsuccessful:  At this point neither Linux nor FD boot and
the machine BIOS complains about the parameters.  I am able to verify that
the Linux file system is intact by means of a Fedora 39 KDE Live .iso image
loaded onto a USB disk, and I have offloaded the contents of my Home
directory.

I could in other words reinstall the Linux system but as a learning
exercise I though I would see if GRUB could be rebuilt.  Supposing that
this may have happened to some other user, I am posting a question here,
asking for advice on how to handle this situation.

Thank you for your suggestions.

This is, I think, the simplest way to do it (or, in your case, the
simplest way to have done it):

Assume without loss of generality that your disk is named /dev/sda.
Save the first megabyte of /dev/sda somewhere.  For example,

   dd if=/dev/sda bs=1M count=1 of=/1stMegOfSda

Install FreeDOS into the slice of disk that you have prepared for it.
Assume without loss of generality that in Fedora, this slice is named
/dev/sda3.

Boot your computer from rescue media, mount your Fedora system onto
some suitable directory (e.g., /mnt/Fedora), and restore the saved
first megabyte of disk, totally blowing away whatever FreeDos put
there, thus:

   dd of=/dev/sda bs=1M count=1 if=/mnt/Fedora/1stMegOfSda

Reboot your system from disk.  The old Grub2 menu should appear, as
before; select the system in which grub.cfg resides (presumably your
Fedora system).  Edit /boot/grub2/grub.cfg -- yes, this is the file
that says, in prominent capital letters, DO NOT EDIT THIS FILE -- and
add a menu entry that boots FreeDOS:

    menuentry 'FREEDOS 1.3' {
       set root=(hd0,3)
       chainloader /BOOTSECT.DOS
    }

although in my case I made a backup of BOOTSECT.DOS and I boot
BOOTSECT.BKP.

Copy /boot/grub2/grub.cfg to /boot/grub2/grub.cfg.backup in case some
idiot runs grub2-mkconfig explicitly or implicitly.

If you insist on relying on grub2-mkconfig, then put the FreeDOS
menuentry into the /etc/grub.d/40_custom file.

There are other ways to accomplish what you want to accomplish, but I
think this is the technique that involves the least time and effort.


                         Jay F. Shachter
                         6424 North Whipple Street
                         Chicago IL  60645-4111
                                 (1-773)7613784   landline
                                 (1-410)9964737   GoogleVoice
                                 j...@m5.chicago.il.us
                                 http://m5.chicago.il.us

                         "Quidquid latine dictum sit, altum videtur"



_______________________________________________
Freedos-user mailing list
Freedos-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-user


_______________________________________________
Freedos-user mailing list
Freedos-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-user

Reply via email to