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

Reply via email to