[2024-feb-29] Sad news: Eric Layton aka Nocturnal Slacker aka vtel57 passed away on Feb 26th, shortly after hospitalization. He was one of our Wiki's most prominent admins. He will be missed.

Welcome to the Slackware Documentation Project

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
howtos:misc:lilo_to_grub_bios_mbr [2022/02/15 01:57 (UTC)] – [Sources] zeebrahowtos:misc:lilo_to_grub_bios_mbr [2023/12/17 11:37 (UTC)] (current) zeebra
Line 4: Line 4:
 ===== Introduction ===== ===== Introduction =====
  
-If you use UEFI and/or GPT, then don't use this. If you still want to use it, you can probably set your UEFI to BIOS legacy mode and deactivate GPT. This is meant to be simple. For now it's how to do it after you installed and booted into your new Slackware installation. I'll add later extra steps how to do it in a shell after the installation but before rebooting.+If you use UEFI and/or GPT, then don't use this. If you still want to use it, you can probably set your UEFI to BIOS legacy mode and deactivate GPT. This is meant to be simple. But the process should be somewhat similar with UEFI/GPT.
  
 **Summary:** **Summary:**
Line 24: Line 24:
 ===== Generating a useful template (optional) ===== ===== Generating a useful template (optional) =====
  
-Grub2 is not very intuitive to write config entries for, so you can modify a good example to your need instead.+Grub2 is not very intuitive to write config entries for, so you can modify a good example to your need instead.
 Pipe some examples to a file:  Pipe some examples to a file: 
 <code>grub-mkconfig > examples.file</code> <code>grub-mkconfig > examples.file</code>
  
-Copy one of the examples to another file or overwrite the current file with one example only. (Including curly brackets) \\+Edit the file to only include one example config entry (Including curly brackets and if you want submenu) \\
  
 Then append the example in the file to the custom grub entry file: (You need to append the info into the file, as you need to preserve the uncommented info already there, lest it should not work.) Then append the example in the file to the custom grub entry file: (You need to append the info into the file, as you need to preserve the uncommented info already there, lest it should not work.)
Line 42: Line 42:
 If you run into an unbootable system, boot from Slackware USB/DVD and follow If you run into an unbootable system, boot from Slackware USB/DVD and follow
 the instructions there to boot with the USB/DVD Kernel into your root file the instructions there to boot with the USB/DVD Kernel into your root file
-system. Like: <code>huge.s root=/dev/sdaX initrd= ro</code> Ps. By root is meant the location of your Slackware root and could be for example /dev/sda5</note> +system. Like: <code>huge.s root=/dev/sdaX initrd= ro</code> You can chroot into your root partition like described at the end of this article and rebuild Grub there. Ps. By root is meant the location of your Slackware root and could be for example /dev/sda5</note> 
 +\\
 ===== Config ===== ===== Config =====
  
-Once you are ready or think so, you can PREPARE grub: (this generates the config file from any executable files in /etc/grub.d/ and replaces editing menu.lst from grub1)+Once you are ready or think so, you can **prepare** grub: (this generates the config file from any executable files in /etc/grub.d/ and replaces editing menu.lst from grub1)
 <code>grub-mkconfig -o /boot/grub/grub.cfg</code> <code>grub-mkconfig -o /boot/grub/grub.cfg</code>
-The above generates the necessary files in /boot/grub including the config file. Every time you CHANGE anything in the config folder /etc/grub.d/, you need to run the above command again for it to take effect. You can now inspect the /boot/grub/grub.cfg file to evaluate if it looks right..+The above generates the necessary files in /boot/grub including the config file. Every time you CHANGE anything in the config folder /etc/grub.d/, you need to run the above command again for it to take effect. You can now inspect the /boot/grub/grub.cfg file to evaluate if it looks right.
 \\ \\
 ===== Install ===== ===== Install =====
Line 56: Line 56:
 You should be given feedback about it being successfull or not. Then cross your fingers and reboot. You should be given feedback about it being successfull or not. Then cross your fingers and reboot.
 <note tip>You don't need to repeat this last step if you reconfigure grub. The step before it just replaces menu.lst, so once grub is installed, it reads the generated config file "dynamically"</note> <note tip>You don't need to repeat this last step if you reconfigure grub. The step before it just replaces menu.lst, so once grub is installed, it reads the generated config file "dynamically"</note>
 +\\
 +===== Doing these steps during your Slackware installation =====
 +
 +You can do these steps when you install and set up Slackware with a CD or USB, by dropping into a shell after the installation. Simply "finish" the installation and don't reboot or exit, but select the shell option.
 +The Slackware installation has already mounted your root filesystem and any other partitions you used during the installation into /mnt. You can also do that manually if you reboot and boot into the cd/usb again, or if something is not right.
 +<code>mount /dev/sdaX /mnt
 +mount -o bind /dev/ /mnt/dev/
 +mount -o bind /proc/ /mnt/proc/
 +mount -o bind /sys/ /mnt/sys/</code>
 +
 +If all went well, you can change root into your Slackware root filesystem currently on /mnt (or any other location you may have used instead)..
 +<code>chroot /mnt</code>
 +
 +Once this is done, you can proceed to do configuration and installation of Grub2 as described above.
 +\\
 +===== Configuring other Grub2 default options =====
 +
 +Grub2 contains some other options you can easily change or add too. These are kind of default and global options for Grub2, and in some few cases you have to not only use grub-mkconfig, but also grub-install for them to be effective. These options can be found in /etc/default/grub.
 +<code>nano /etc/default/grub</code>
 +
 +Some options are already included in this file, commented or uncommented and can be activated and deactivated. But many more options exists that you can add or change in this file.
 +\\
 +
 +===== Further info =====
 +
 +If you think there is too much info here, you could use the minimalist guide to Grub2 instead: \\
 +[[howtos:slackware_admin:grub_on_first_install | Mini Grub2 guide]] \\
 +Those using UEFI might want to use this howto as well: \\
 +[[howtos:slackware_admin:set_up_grub_as_boot_loader_on_uefi_based_hardware | Grub2 UEFI info]] \\
 +Another one, dealing with GPT partitions in particular: \\
 +[[howtos:slackware_admin:installing_with_gpt_without_uefi | Grub2 GPT info]] \\
  
 ====== Sources ====== ====== Sources ======
  
- * Originally written by [[wiki:user:zeebra | Zeebra]]+ * Originally written by [[wiki:user:zeebra | zeebra]]
  
  
 <!-- Please do not modify anything below, except adding new tags.--> <!-- Please do not modify anything below, except adding new tags.-->
 <!-- You must remove the tag-word "template" below before saving your new page --> <!-- You must remove the tag-word "template" below before saving your new page -->
-{{tag>howtos}}+{{tag>howtos misc grub2 author_zeebra}}
 howtos:misc:lilo_to_grub_bios_mbr ()