Re: [Freedos-user] Post-install problem with GRUB2 bootloader

2024-03-19 Thread Charles Hudson via Freedos-user
My thanks to all who responded.  With your help I managed to
recover the installed Fedora 39 KDE Workstation OS and to install a
modified GRUB2 bootloader that gives me the option of booting Fedora
or FreeDOS.  I made a number of discoveries along the way and for
use by anyone who might find themselves in a similar situation I will
highlight some of them here.

The essence of the problem was that the FreeDOS Live installer
overwrote the MBR of the hard disk, sda1 as Linux names the
partition, to point to the FAT32 third partition, sda3, where FreeDOS
is installed.  Booting from the hard disk went straight to
FreeDOS, in other words.  Booting from other, removable media,
however, I found that most of the rest of the Fedora installation was
intact - my /home directory, with all of the work product, for
example. Thankfully I was able to copy this off before setting about
repair.

I used a number of different self-booting ISOs; the KDE Live
installer, a GPARTED utility, a MINT boot-recovery disk; but I found
that the SuperGRUB2 disk
(https://www.supergrubdisk.org/super-grub2-disk/) was especially
useful and could actually boot my previous installation by
examining the "core image" that remained in
/boot/grub2/i386-pc/core.img.  Although I was unable to restore the
boot track from this utility, I knew the system was recoverable.

The final piece of the puzzle was to rebuild the GRUB2 bootloader and
put it on the MBR.  I found in the Fedora Docs the following article:
https://docs.fedoraproject.org/en-US/quick-docs/grub2-bootloader/.
I determined that I was using a BIOS so the procedure was somewhat
simplified, but there is one caveat:  GRUB2 can be configured to suit
a number of different situations, and different Linux "flavors", e.g.
Fedora, Mint, SuSe, Ubuntu etc., may have differing ideas about how
that should be accomplished.  In the case of my Fedora installation a
critically important tool was left out of the GRUB2 configuration.

It was necessary for me to edit the file /etc/default/grub to add the
following line, GRUB_DISABLE_OS_PROBER=false, which allowed the GRUB2
configuration-builder to use the os-prober and list the FreeDOS
operating system along with Fedora.  I ran grub2-install and
grub2-mkconfig, and rebooted to find a menu of choices including
Fedora and FreeDOS.

I took on this task for the purpose of discovery, and I learned a lot
about both operating systems in the process. I understand that with
flexibility comes complexity, but if I might raise two small
objections they would be these:  In the installation process make
clear what choices are being made and how they may affect your
system; get confirmation before you overwrite the MBR.  If you can't
do that in coding, at least put it in documentation.   And speaking
of documentation, if you have a custom configuration of a tool such
as GRUB2, please document what you have left in and left out: it was
only on a third-party web site that I learned of the need for
specifying the os-prober.

That's my saga.  Thanks again for your help.
-CH-



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


Re: [Freedos-user] Post-install problem with GRUB2 bootloader

2024-03-04 Thread Felix Miata via Freedos-user
Liam Proven composed on 2024-03-04 19:17 (UTC):

> tsiegel wrote:

>> There should be only one active primary partition at any given time.

> Picky-picky. OK, then, reorder the adjectives so that it is no longer
> grammatical English but is more technically accurate.

> The active, first primary partition.

> Or, in other words, in the first primary partition, which should be active.

This explanation is also ambiguous. It /may/ have been that prior to DOS 3.3, 
DOS
4 or DOS 5 that the boot flag needed to be on the /first/ partition (also
primary), but at some point by DOS 5 (same time frame as OS/2's Boot Manager?;
v1.3?) it became the rule that DOS will boot directly via legacy/DOS/Windows MBR
code, as long as one, and only one, primary partition is marked active. It will
boot if: 1-that first/only active primary partition is any of first, second, 
third
or fourth partition in physical or logical order on the disk or in the partition
table; and 2-the disk is small enough that the active primary is addressable by
DOS. IOW, DOS can boot from *any* primary on the first BIOS disk, as long as 
that
primary is the /only active/ primary.

Here are two example valid layouts, which are both in current use, and have been
in use since before the birth of SATA:

# parted -l
Model: ATA ADATA SU800 (scsi)
Disk /dev/sda: 256GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:

Number  Start   End SizeType  File system Flags
 1  32.3kB  107MB   107MB   primary   hidden, type=17 (OS/2)
 2  107MB   115MB   8225kB  primary   boot, type=0a (IBM BM)
 3  115MB   378MB   263MB   primary   fat16   type=06 (PC DOS 2000)
 4  378MB   183GB   182GB   extended  type=05
 5  378MB   387MB   8193kB  logical   hidden, type=11
 6  387MB   650MB   263MB   logical   fat16   type=06
 7  658MB   872MB   214MB   logical   ext2type=83
 8  872MB   1135MB  263MB   logical   fat16   hidden, type=16
 9  1818MB  9369MB  7551MB  logical   ext3type=83
10  9377MB  10.2GB  839MB   logical   type=07
11  10.4GB  12.5GB  2097MB  logical   type=07
12  12.9GB  13.9GB  979MB   logical   type=07
13  13.9GB  16.5GB  2624MB  logical   type=07
14  16.5GB  22.4GB  5873MB  logical   ext3type=83
15  22.4GB  25.3GB  2887MB  logical   ext3type=83
16  25.3GB  32.9GB  7551MB  logical   ext4type=83
17  32.9GB  40.2GB  7345MB  logical   ext3type=83
...
# parted -l
Model: ATA ST3160215ACE (scsi)
Disk /dev/sda: 160GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start   End SizeType  File system Flags
 1  32.3kB  214MB   214MB   primary   ext2boot, type=83
 2  214MB   222MB   8225kB  primary   ext2type=83
 3  222MB   263MB   41.1MB  primary   fat16   type=06
 4  263MB   144GB   144GB   extended  type=05
 5  263MB   1341MB  1077MB  logical   linux-swap(v1)  type=82
 6  1341MB  6375MB  5034MB  logical   ext3type=83
...

Note the boot flags are currently on the non-DOS #1 or #2 primary, but the IBM 
DOS
installed on partition 3s do boot directly via compatible MBR code when the flag
is moved to partition 3 from partition 1 or 2.

> (I have had success when it's the first partition, which is also a
> primary partition, but a different partition is active: e.g. DOS or
> Win9x is in partition 1, but Linux is in partition 2, that's active,
> and Linux's GRUB passes control to the 1st partition.)

That works here too, but without necessity for the sole boot flagged DOS 
partition
to be the first partition physically or logically. When Grub chainloads DOS, the
point in time for relevance of boot flag to boot process has already expired.
Actually, when Grub code has replaced DOS/OS2/Windows-compatible boot code in 
MBR,
the boot flag plays no part in boot process at all, had no beginning to expire. 
:)
-- 
Evolution as taught in public schools is, like religion,
based on faith, not based on science.

 Team OS/2 ** Reg. Linux User #211409 ** a11y rocks!

Felix Miata


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


Re: [Freedos-user] Post-install problem with GRUB2 bootloader

2024-03-04 Thread Liam Proven via Freedos-user
On Fri, 1 Mar 2024 at 18:44, tsiegel--- via Freedos-user
 wrote:
>
> There should be only one active primary partition at any given time.

Picky-picky. OK, then, reorder the adjectives so that it is no longer
grammatical English but is more technically accurate.

The active, first primary partition.

Or, in other words, in the first primary partition, which should be active.

(I have had success when it's the first partition, which is also a
primary partition, but a different partition is active: e.g. DOS or
Win9x is in partition 1, but Linux is in partition 2, that's active,
and Linux's GRUB passes control to the 1st partition.)


--
Liam Proven ~ Profile: https://about.me/liamproven
Email: lpro...@cix.co.uk ~ gMail/gTalk/FB: lpro...@gmail.com
Twitter/LinkedIn: lproven ~ Skype: liamproven
IoM: (+44) 7624 277612: UK: (+44) 7939-087884
Czech [+ WhatsApp/Telegram/Signal]: (+420) 702-829-053


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


Re: [Freedos-user] Post-install problem with GRUB2 bootloader

2024-03-02 Thread Jay F. Shachter via Freedos-user


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


Re: [Freedos-user] Post-install problem with GRUB2 bootloader

2024-03-02 Thread Charles Hudson via Freedos-user
Thank you all for your responses.  Apparently my responses have been over
the 40k limit; I'm not familiar with the site so pardon my delay in
responding.

There is only one active partition; it is sda1.  it got moved to sda3 where
DOS was installed when I used the fdisk that was part of the FreeDOS
installation but I moved it back with KDE Partition Manager, the same tool
I used to shrink the Linux BTRFS partition on sda2. FD's fdisk would not
allow resetting sda1 as active.

I will attempt to attach the terminal output showing lsblk -f etc.  There
is no rescue mode (that I can find) on this release of Fedora; it used to
be an option in GRUB.

-CH-
liveuser@localhost-live:~$ su
root@localhost-live:/home/liveuser# [ -d /sys/firmware/efi ] && echo UEFI || 
echo BIOS
BIOS
root@localhost-live:/home/liveuser# dnf list installed | grep grub
grub2-common.noarch  1:2.06-100.fc39
 @anaconda
grub2-efi-ia32.x86_641:2.06-100.fc39
 @anaconda
grub2-efi-ia32-cdboot.x86_64 1:2.06-100.fc39
 @anaconda
grub2-efi-x64.x86_64 1:2.06-100.fc39
 @anaconda
grub2-efi-x64-cdboot.x86_64  1:2.06-100.fc39
 @anaconda
grub2-pc.x86_64  1:2.06-100.fc39
 @anaconda
grub2-pc-modules.noarch  1:2.06-100.fc39
 @anaconda
grub2-tools.x86_64   1:2.06-100.fc39
 @anaconda
grub2-tools-efi.x86_64   1:2.06-100.fc39
 @anaconda
grub2-tools-extra.x86_64 1:2.06-100.fc39
 @anaconda
grub2-tools-minimal.x86_64   1:2.06-100.fc39
 @anaconda
grubby.x86_648.40-72.fc39   
 @anaconda
root@localhost-live:/home/liveuser# lsblk
NAMEMAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
loop0 7:00   2.2G  1 loop 
loop1 7:10   8.8G  1 loop 
├─live-rw   253:00   8.8G  0 dm   /
└─live-base 253:10   8.8G  1 dm   
loop2 7:2032G  0 loop 
└─live-rw   253:00   8.8G  0 dm   /
sda   8:00 223.6G  0 disk 
├─sda18:10 1G  0 part 
├─sda28:20 219.6G  0 part 
└─sda38:30 3G  0 part 
sdb   8:16   1  14.4G  0 disk 
├─sdb18:17   1   2.3G  0 part /run/initramfs/live
├─sdb28:18   1  11.6M  0 part 
└─sdb38:19   1   300K  0 part 
sr0  11:01  1024M  0 rom  
zram0   252:00   7.6G  0 disk [SWAP]
root@localhost-live:/home/liveuser# lsblk -f
NAMEFSTYPE  FSVER   LABEL  UUID 
FSAVAIL FSUSE% MOUNTPOINTS
loop0   squashf 4.0 
   
loop1   ext41.0 Anaconda   
f9515758-5765-4fca-b24e-633f7fdea3fb
├─live-rw
│   ext41.0 Anaconda   
f9515758-5765-4fca-b24e-633f7fdea3fb  2G77% /
└─live-base
ext41.0 Anaconda   
f9515758-5765-4fca-b24e-633f7fdea3fb
loop2   DM_snap 
   
└─live-rw
ext41.0 Anaconda   
f9515758-5765-4fca-b24e-633f7fdea3fb  2G77% /
sda 
   
├─sda1  ext41.0
c9c2f8e9-f99f-4dba-934b-96904da5b63a
├─sda2  btrfs   fedora_localhost-live  
a9a3c9e0-18e3-4fec-9678-529faf02a1b3
└─sda3  vfatFAT32   DOS1960-1C23
   
sdb iso9660 Joliet  Fedora-KDE-Live-39-1-5 2023-11-01-01-34-53-00   
   
├─sdb1  iso9660 Joliet  Fedora-KDE-Live-39-1-5 2023-11-01-01-34-53-00   
  0   100% /run/initramfs/live
├─sdb2  vfatFAT16   ANACONDA   B3C2-9928
   
└─sdb3  
   
sdc 
   
└─sdc1  vfatFAT32  1C2E-2966
  28.8G 0% /run/media/liveuser/1C2E-2966
sr0 
   
zram0   
   [SWAP]
root@localhost-live:/home/liveuser# fdisk -l
Disk /dev/sda: 223.57 GiB, 240057409536 bytes, 468862128 sectors
Disk model: CT240BX500SSD1  
Units: 

Re: [Freedos-user] Post-install problem with GRUB2 bootloader

2024-03-01 Thread tsiegel--- via Freedos-user
There should be only one active primary partition at any given time.  
That's what the boot menus handle for you.  They set the active flag, 
then allow that partition to boot.  I don't know what kind of chaos will 
ensue if you have multiple active partitions, but it probably won't be 
very helpful, and actually, shouldn't be allowed to happen, as most 
software that sets active partitions unset all the others when setting 
one of them active.


Only the active partition can actually boot, so if you look in a 
partition manager like fdisk or something similar, there should be only 
a single active partition, and the tool should not allow you to set a 
second one active without automatically unsetting the others.



On 3/1/2024 5:19 PM, Felix Miata via Freedos-user wrote:

Liam Proven composed on 2024-03-01 17:10 (UTC):


DOS generally likes to be the 1st active primary partition on an
MBR-formatted drive.

Which DOS version(s) is/are bootable when more than one active primary is 
present
on a drive?



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


Re: [Freedos-user] Post-install problem with GRUB2 bootloader

2024-03-01 Thread Felix Miata via Freedos-user
Liam Proven composed on 2024-03-01 17:10 (UTC):

> DOS generally likes to be the 1st active primary partition on an
> MBR-formatted drive.

Which DOS version(s) is/are bootable when more than one active primary is 
present
on a drive?
-- 
Evolution as taught in public schools is, like religion,
based on faith, not based on science.

 Team OS/2 ** Reg. Linux User #211409 ** a11y rocks!

Felix Miata


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


Re: [Freedos-user] Post-install problem with GRUB2 bootloader

2024-03-01 Thread Liam Proven via Freedos-user
On Thu, 29 Feb 2024 at 16:47, Charles Hudson via Freedos-user
 wrote:
>
> I could in other words reinstall the Linux system but as a learning exercise 
> I though I would see if GRUB could be rebuilt.

Sure, it can.

My suggestions are based around Ubuntu as I don't like Fedora much,
but the same general methods should apply.

On a different computer, get Ventoy and use it to format a USB key. It
does not need to be installed: run once and then delete it.

https://www.ventoy.net/en/index.html

Onto your Ventoy key, copy:

* a current Fedora ISO file
* a current FreeDOS ISO file
* maybe a current Win10 ISO file for safety (it's a free download from
microsoft.com)
* I suggest some small additional tools such as a Gparted Live ISO and
a SystemRescue ISO
* Maybe a Universal Boot CD ISO

When you boot the key, it generates a menu on the fly to let you pick
what ISO to boot.

DOS generally likes to be the 1st active primary partition on an
MBR-formatted drive.

You can boot into a Fedora live session and use Gparted to move stuff
around to make that the case, if necessary.

Then reboot.

Fedora has very brief and not very helpful instructions here:
https://jfearn.fedorapeople.org/fdocs/en-US/Documentation/0.1/html/Fedora_Multiboot_Guide/GRUB-reinstalling.html

Fuller ones here but they assume your system works:
https://docs.fedoraproject.org/en-US/quick-docs/grub2-bootloader/

Here are more general ones you can adapt:
https://www.fosslinux.com/115031/troubleshoot-boot-problems-by-reinstalling-grub-on-linux.htm

The Boot-repair tool may help you:
https://sourceforge.net/p/boot-repair/home/Home/


-- 
Liam Proven ~ Profile: https://about.me/liamproven
Email: lpro...@cix.co.uk ~ gMail/gTalk/FB: lpro...@gmail.com
Twitter/LinkedIn: lproven ~ Skype: liamproven
IoM: (+44) 7624 277612: UK: (+44) 7939-087884
Czech [+ WhatsApp/Telegram/Signal]: (+420) 702-829-053


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


Re: [Freedos-user] Post-install problem with GRUB2 bootloader

2024-03-01 Thread tsiegel--- via Freedos-user
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

Re: [Freedos-user] Post-install problem with GRUB2 bootloader

2024-02-29 Thread Jay F. Shachter via Freedos-user


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


Re: [Freedos-user] Post-install problem with GRUB2 bootloader

2024-02-29 Thread Tomas By via Freedos-user
On Thu, 29 Feb 2024 17:44:56 +0100, Charles Hudson via Freedos-user wrote:
> [...] However, I seem to have blitzed my Linux installation as the
> GRUB2 bootloader no longer appears nor loads Fedora 39. [...]
> 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.


Yes, this is normal. Generally, the problem is that the new partition
with only the new OS is active, but what you want is to have the old
partition with the boot menu be active. So, change active partition
using some partition manager, such as Linux fdisk.

/Tomas


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


Re: [Freedos-user] Post-install problem with GRUB2 bootloader

2024-02-29 Thread Felix Miata via Freedos-user
Charles Hudson composed on 2024-02-29 11:44 (UTC-0500):

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

What method did you use to resize Fedora's partition to make needed space? Show 
us
output from  lsblk -f, plus fdisk -l and/or parted -l, captured from booting
Fedora installation media in rescue mode or using Fedora installation media to
boot the installed Fedora installation. If you can manage the latter, you should
be able to solve the problem by reinstalling Grub with /etc/default/grub first
edited if necessary to include 'GRUB_DISABLE_OS_PROBER="false"'.
-- 
Evolution as taught in public schools is, like religion,
based on faith, not based on science.

 Team OS/2 ** Reg. Linux User #211409 ** a11y rocks!

Felix Miata


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


[Freedos-user] Post-install problem with GRUB2 bootloader

2024-02-29 Thread Charles Hudson via Freedos-user
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.


Virus-free.www.avg.com

<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
___
Freedos-user mailing list
Freedos-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-user