LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   GRUB2 in 14.1? (http://www.linuxquestions.org/questions/slackware-14/grub2-in-14-1-a-4175483808/)

kenw232 11-07-2013 10:08 PM

GRUB2 in 14.1?
 
I just installed Slackware 14.1. I selected MBR something along the way. It asked if I wanted to setup LILO, I selected no because I want to use GRUB2 but setup never asked to set it up afterwards. So now when I boot I get "operating system not found".

How do I make grub work now? I assumed setup would ask me. Do I have to use LILO then?

ReaperX7 11-07-2013 10:25 PM

To use Grub2 you have to rescue boot as shown on the DVD install boot screen with your main Linux HDD partition.

Then, after you boot successfully, run this command sequence:

mkdir /boot/grub
grub-mkconfig -o /boot/grub/grub.cfg

This should give you a basic grub.cfg file. Check it with a text editor like vi, nano, or emacs, and then run:

grub-install /dev/sda

Remember Grub2 uses a shell script layout of the grub.cfg file. If you need to edit it in any way, edit the /etc/defaults/grub file, then regenerate the grub.cfg and reinstall grub back to the MBR.

kenw232 11-07-2013 10:34 PM

I found it at http://docs.slackware.com/howtos:sla..._first_install

But now the GRUB2 loading screen has a really big and ugly font. How do I just make the font 80x25 as normal? I'm new to grub.

kenw232 11-07-2013 10:40 PM

I changed the grub.cfg to disable the graphical font. Now I'm just trying to edit the grub boot menu options. Should I edit /boot/grub/grub.cfg directly to remove boot menu options I don't want to see? I'd like to rename them too.

I'm building up a slackware server for the first time since Slackware 10. I'm glad nothing has changed, it's still the best.

ReaperX7 11-07-2013 10:45 PM

You're better off not editing grub.cfg unless you are absolutely sure you know what you're doing. Easy way to end up with a non-bootable system.

If you need to edit anything, edit /etc/defaults/grub only. Editing grub.cfg is not recommended, even if the naming of the operating systems is awkward.

What exactly are you trying to hide from the menu?

kenw232 11-07-2013 11:42 PM

I see like 4 entries, I'd like it reduced to 2, the original "Slackware 14.1" and the "Advanced options for Slackware 14.1". It seems to have added it twice. If I can't edit grub.cfg directly how do I update and manage these menu options?

ReaperX7 11-08-2013 12:10 PM

One set of entries is for the Huge kernel and the other is for the Generic kernel. You'd have to find the package for the kernel you don't want, uninstall it, and then regenerate grub again.

neymac 11-08-2013 06:24 PM

I use a dedicated GRUB 2 partition for years, and no regrets up to now, and I edit the file grub.cfg (menus entry without problems). A hint how to do it -> http://rxezlqu.wordpress.com/2010/04...oot-partition/.

PS: as ReaperX7 said - "You're better off not editing grub.cfg unless you are absolutely sure you know what you're doing."

TobiSGD 11-08-2013 07:10 PM

Quote:

Originally Posted by ReaperX7 (Post 5060424)
Remember Grub2 uses a shell script layout of the grub.cfg file. If you need to edit it in any way, edit the /etc/defaults/grub file, then regenerate the grub.cfg and reinstall grub back to the MBR.

Just a minor correction, it is not necessary to re-install to the MBR every time you change a setting, regenerating the config file is sufficient.

ReaperX7 11-09-2013 05:40 PM

Quote:

Originally Posted by TobiSGD (Post 5061064)
Just a minor correction, it is not necessary to re-install to the MBR every time you change a setting, regenerating the config file is sufficient.

That was Grub-Legacy where you could edit /boot/grub/grub.lst and not have to regenerate. Grub-Legacy read the /boot/grub/grub.lst file upon boot and generated the menu from that file.

Grub2 works completely different and uses a method that requires regeneration of the file and reinstallation. It does read some files from /boot/grub/* but mostly only the modules it uses for VBE and fonts.

Richard Cranium 11-09-2013 06:25 PM

Quote:

Originally Posted by ReaperX7 (Post 5061552)
That was Grub-Legacy where you could edit /boot/grub/grub.lst and not have to regenerate. Grub-Legacy read the /boot/grub/grub.lst file upon boot and generated the menu from that file.

Grub2 works completely different and uses a method that requires regeneration of the file and reinstallation. It does read some files from /boot/grub/* but mostly only the modules it uses for VBE and fonts.

How odd. I've recently re-generated the grub.config file by running grub-mkconfig and things booted up just fine. (The was to find the partition that holds a Kubuntu installation that I use to log into work.)

So unless you are embedding the config file into your boot image, you don't have to do a re-install each time.

ReaperX7 11-09-2013 11:33 PM

I've always installed Grub to the /dev/sda master boot record which is the recommended method. I've never installed Grub into it's own partition.

Richard Cranium 11-10-2013 12:20 AM

Quote:

Originally Posted by ReaperX7 (Post 5061645)
I've always installed Grub to the /dev/sda master boot record which is the recommended method. I've never installed Grub into it's own partition.

Neither have I. I *do* have a /boot partition that isn't a logical volume.

You can still bring up a command line as part of the Grub2 boot process to fix boot problems, so I don't see why changing the config file would force a re-install.

tommcd 11-10-2013 12:58 AM

I have been booting Slackware from Lubuntu's grub2 for some time now.
My solution is to create a custom grub2 boot file in /etc/grub.d/ directory.
The file is named 31_Slackware64-14.1 so that it ends up at the bottom of the grub boot menu.
The contents of the file is this:
Code:

echo "Adding Slackware64-14.1 on /dev/sda5" >&2
cat << EOF
##!/bin/sh
#exec tail -n +3 $0
menuentry "Slackware64-14.1 on /dev/sda5" {
        set root=(hd0,5)
        linux  /boot/vmlinuz-generic-3.10.17 root=/dev/sda5 ro
        initrd  /boot/initrd.gz
}

EOF

This allows me to boot the Slackware 14.1 generic kernel. Be sure to make this file executable.
Ubuntu also creates 4 entries in the grub boot menu for Slackware. It is confusing. This is why I use my custom boot file in /etc/grub.d/ to boot the Slackware generic kernel.
Note that the only parts of that file that you really need are the parts that I have made bold here.

colorpurple21859 11-10-2013 09:47 AM

I vaguely remember having to reinstall grub2 to get changes to take place when grub first came out but I think that changed after a few updates to grub2


All times are GMT -5. The time now is 06:34 PM.