PDA

View Full Version : how to recreate GRUB2 (LILO)



goldov
25th September 2017, 09:57 AM
Hi, i have double boot computer - Windows 7 and Fedora 22. at present, i would like to reinstall Fedora 22 to Fedora 26. when i boot into the computer i have a GRUB (or GRUB2 ?) menu to chose between Windows7 and Fedora (Linux) boot. as i found in internet, as soon as i reinstall Linux (Fedora 26), then that menu (GRUB, or GRUB2 ?) will disappear, that is the computer will boot directly to Linux (Fedora 26). i do not have experience with reinstallation of Linux in the double boot (Windows and Linux) computer. this is why, i would appreciate someone's detailed explanation how i could reinstall correctly Fedora 26 in order to keep GRUB(2) menu in order to be able to boot, then, either to Windows or to Fedora 26 ? if GRUB(2) is deleted in anycase after reisntalling Linux (Fedora 26), then how i could reestablish GRUB(2) menu ? Thank you.

glennzo
25th September 2017, 10:30 AM
I think that the best place to start would be by showing us the current partition layout of your hard disk, assuming one hard disk.
As root or with admin permissions:

fdisk -l /dev/sda

goldov
25th September 2017, 05:00 PM
Thanks for the reply, i have one disk. i issued a command "fdisk -l /dev/sda" and the result is the following:

Device Start End Sectors Size Type
/dev/sda1 2048 206847 204800 100M EFI System
/dev/sda2 468992 413155327 412686336 196.8G Microsoft basic data
/dev/sda3 413157376 1439205375 1026048000 489.3G Microsoft basic data
/dev/sda4 1439205376 1481148415 41943040 20G Microsoft basic data
/dev/sda5 1481148416 1482172415 1024000 500M Linux filesystem
/dev/sda6 1482172416 1490036735 7864320 3.8G Linux swap
/dev/sda7 1490036736 1594894335 104857600 50G Linux filesystem
/dev/sda8 1594894336 1953523711 358629376 171G Linux filesystem

i would appreciate a detailed explanation of further steps to reestablish a GRUB(2) menu in order to have a choice of Linux and Windows7 at the boot of the computer, after re-installing Fedora 26. Thanks.

dswaner
26th September 2017, 02:23 AM
You definitely want to check out f26/install-guide/index.html (https://docs.fedoraproject.org/f26/install-guide/index.html)

The following is assuming you want to do an install of Fedora 26, and not a series of system upgrades from Fedora 22 to Fedora 26.


as i found in internet, as soon as i reinstall Linux (Fedora 26), then that menu (GRUB, or GRUB2 ?) will disappear

This is not true. Grub2 will be installed (unless you specify to not install a boot loader, which would be unusual).


that is the computer will boot directly to Linux (Fedora 26).

The default will be boot into Fedora 26, but unless you wipe out Windows, you will also be able to select Windows from the grub menu and boot into Windows.

I believe what you want to do is, during the Fedora 26 install, to specify custom partitioning (which is what I always do).

If you don't specify custom partitioning, and let the installer do the partitioning, I don't know what happens - maybe Fedora will format the entire drive and wipe out Windows.

And then specify your partitions during the installation. If you do a "sudo lsblk --fs" (on your Fedora 22), it will show how your partitions are currently being mounted. Presumably you want to mount the same partitions on the same mount points during the reinstall.

Question for you: do you want to format /home and wipe out everything on it? I'm guessing that you want to keep what is on /home, and so you should not format it, but most probably you want to format all the other partitions. Or you can also format /home and restore some or all of it from a backup.

CORRECTION:
You also do NOT want to reformat the /boot/efi partition.