If you did not save the first megabyte of your hard drive before
overwriting it with your FreeDOS installation, then this is, in my
opinion, the fastest and easiest way to recover:

1. Boot a Linux system from rescue media (exactly as you did in the
   session that you recently posted to this mailing list).

2. Mount the root filesystem of your Fedora system (which, if memory
   serves, resides on /dev/sda2) on a suitable directory -- for the
   purposes of this example, let us call it /mnt/Fedora.

3. Save the first megabyte of /dev/sda somewhere, in case you mess up
   Step 4 and render your computer unbootable:

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

4. Execute the following commands:

      mount -t proc proc /mnt/Fedora/proc
      mount -t sysfs sys /mnt/Fedora/sys
      mount -B /dev /mnt/Fedora/dev
      chroot /mnt/Fedora
      grub2-install /dev/sda

5. 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
      }

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

5a. As an alternative to Step 5, if you insist on relying on
    grub2-mkconfig, then put the FreeDOS menuentry into the
    /etc/grub.d/40_custom file.

6. Reboot your system (you will have to exit from the chroot first).
   You should see your old GRUB2 menu, with an additional menu item
   that lets you boot into FreeDOS.


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

        "But when she traced the killer's IP address ... it was in the 
192.168/16 block!"



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

Reply via email to