LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE
User Name
Password
SUSE / openSUSE This Forum is for the discussion of Suse Linux.

Notices


Reply
  Search this Thread
Old 01-27-2020, 06:23 PM   #1
feb11
LQ Newbie
 
Registered: Apr 2014
Location: St.Petersburg, RU
Distribution: Slackware
Posts: 22

Rep: Reputation: Disabled
Grub2 won't boot Suse


Hi,
I got a new Ideapad 330 laptop some time ago, installed Slackware 14.2 and it boots fine with Grub. Grub is installed into the MBR of the hard drive. BIOS is in legacy mode, no UEFI/gpt.

On one of the partitions of the same hard drive I later installed openSuse, skipping ther bootloader part. Then in Slackware, I added the following code to the grub config, so that it could boot Suse:

/etc/grub.d/12_suse:

#!/bin/sh
exec tail -n +3 $0
menuentry "SUSE sda2" {
insmod gzio
insmod part_msdos
insmod ext2
set root='hd0,msdos2'
echo 'Loading Suse ...'
linux /boot/vmlinuz root=/dev/sda2 ro
initrd /boot/initrd
}
(tried various combinations of the syntax)

Then I do:
sudo /usr/sbin/grub-mkconfig
sudo /usr/sbin/grub-install /dev/sda
(no errors)

No error messages but upon reboot, the grub menu only offers to boot my Slackware install, no trace of Suse in the menu.

This is the first time I'm using grub, have been sticking to lilo for the last 20 years.
What am I doing wrong here and how do I make grub boot Suse from the hard drive?

Thanks
 
Old 01-27-2020, 07:06 PM   #2
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
Not sure if the configuration is done differently on Slackware (or OpenSUSE), but here are a few thoughts.

Check whether the Grub config file contains the menuentry in the first place. It's normally /boot/grub/grub.cfg.

Usually, you add custom menuentries to 40_custom, at the end of the grub-mkconfig process. Perhaps 12_suse positions the menuentry at a stage in the config file where Grub is unable to recognize it as a menu point.

grub-install is the program that alters the MBR and puts Grub onto the disk, normally in the space between the MBR and the first partition (UEFI: In the EFI system partition). You should not have to run grub-install each time you change the Grub configuration, and who knows perhaps it interferes with your menuentry.

Last edited by berndbausch; 01-27-2020 at 07:19 PM.
 
1 members found this post helpful.
Old 01-27-2020, 07:10 PM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,126

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Quote:
Originally Posted by feb11 View Post

set root='hd0,msdos2'
This is a grub variable, and needs to establish the grub root, not the Linux root. Often doesn't matter but as you explicitly chose not to install grub there, you need to make this your Slack (grub) root location. Then rerun the mkconfig.
 
Old 01-27-2020, 09:13 PM   #4
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,346

Rep: Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589
This is your problem
Quote:
sudo /usr/sbin/grub-mkconfig
run
Code:
sudo grub-mkconfig -o /boot/grub/grub.cfg
in slackware

There is nothing wrong with the
Quote:
set root='hd0,msdos2'
if opensuse is on the second partition.

You only have to run grub-install once to install grub boot code into the mbr. Your suppose to run grub-mkconfig -o /boot/grub/grub.cfg anytime you want to make changes to the /boot/grub/grub.cfg.

In reality Slackware doesn't run grub-mkconfig with kernel updates, so unless your using the os-prober function to find other distros kernels, or using the actual kernel versions instead of vmlinuz, vmlinuz-huge and/or vmlinuz-generic you can edit the /boot/grub/grub.cfg directly and never run grub-mkconfig

Last edited by colorpurple21859; 01-27-2020 at 09:50 PM.
 
1 members found this post helpful.
Old 01-28-2020, 09:18 AM   #5
feb11
LQ Newbie
 
Registered: Apr 2014
Location: St.Petersburg, RU
Distribution: Slackware
Posts: 22

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by colorpurple21859 View Post
This is your problem
run
Code:
sudo grub-mkconfig -o /boot/grub/grub.cfg
in slackware

There is nothing wrong with the if opensuse is on the second partition.
Yup
Quote:
You only have to run grub-install once to install grub boot code into the mbr.
Right, and I thought so initially too. Only added this step when things didn't work
Quote:
Your suppose to run grub-mkconfig -o /boot/grub/grub.cfg anytime you want to make changes to the /boot/grub/grub.cfg.

In reality Slackware doesn't run grub-mkconfig with kernel updates, so unless your using the os-prober function to find other distros kernels, or using the actual kernel versions instead of vmlinuz, vmlinuz-huge and/or vmlinuz-generic you can edit the /boot/grub/grub.cfg directly and never run grub-mkconfig
 
Old 01-28-2020, 09:27 AM   #6
feb11
LQ Newbie
 
Registered: Apr 2014
Location: St.Petersburg, RU
Distribution: Slackware
Posts: 22

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by berndbausch View Post
Not sure if the configuration is done differently on Slackware (or OpenSUSE), but here are a few thoughts.

Check whether the Grub config file contains the menuentry in the first place. It's normally /boot/grub/grub.cfg.
Thaks, this really helped. The config did not contain the entry. Running "sudo grub-mkconfig -o /boot/grub/grub.cfg" instead of "sudo grub-mkconfig" solved the problem, and I got the menu entry. So I got another problem instead: when picking Suse sda2 from the grub menu, the thing still won't boot, complaining of an "unknown filesystem". guess it's something related to btrfs, and I see other people had similar problem. Will dig a bit deeper later tonight.
Quote:
Usually, you add custom menuentries to 40_custom, at the end of the grub-mkconfig process. Perhaps 12_suse positions the menuentry at a stage in the config file where Grub is unable to recognize it as a menu point.
I used 40_custom initially, but then tried 12_suse when things didn't work. The docs weren't clear enough for me on where I should put my stuff.

Quote:
grub-install is the program that alters the MBR and puts Grub onto the disk, normally in the space between the MBR and the first partition (UEFI: In the EFI system partition). You should not have to run grub-install each time you change the Grub configuration, and who knows perhaps it interferes with your menuentry.
 
Old 01-28-2020, 09:30 AM   #7
feb11
LQ Newbie
 
Registered: Apr 2014
Location: St.Petersburg, RU
Distribution: Slackware
Posts: 22

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by colorpurple21859 View Post
This is your problem
run
Code:
sudo grub-mkconfig -o /boot/grub/grub.cfg
in slackware
Thanks, forgot to mention in the original reply that this solved the problem.
 
Old 01-28-2020, 10:34 AM   #8
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,346

Rep: Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589
Quote:
: when picking Suse sda2 from the grub menu, the thing still won't boot, complaining of an "unknown filesystem". guess it's something related to btrfs, and I see other people had similar problem. Will dig a bit deeper later tonight.
replace
Code:
insmod ext2
with
Code:
insmod btrfs
in your config file should do the trick.

Last edited by colorpurple21859; 01-28-2020 at 10:36 AM.
 
Old 01-28-2020, 08:47 PM   #9
feb11
LQ Newbie
 
Registered: Apr 2014
Location: St.Petersburg, RU
Distribution: Slackware
Posts: 22

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by colorpurple21859 View Post
replace
Code:
insmod ext2
with
Code:
insmod btrfs
in your config file should do the trick.
Unfortunately, it's not as simple. I'm still getting "unknown filesystem" message, followed by "you need to load the kernel first".

I can't seem to find a good working example of the files in /etc/grub.d so I'm not going to waste my time on this any more. Will either reinstall Suse with ext4fs as root, or pick some other distro. (All I need is a 64 bit envoronment for Android development, no matter which distro)
 
Old 01-28-2020, 09:15 PM   #10
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,346

Rep: Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589
did you edit /boot/grub/grub.cfg or your config file. If it was your config file then you need to run grub-mkconfig -o /boot/grub/grub.cfg again.

Last edited by colorpurple21859; 01-28-2020 at 09:19 PM.
 
Old 01-29-2020, 11:35 AM   #11
feb11
LQ Newbie
 
Registered: Apr 2014
Location: St.Petersburg, RU
Distribution: Slackware
Posts: 22

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by colorpurple21859 View Post
did you edit /boot/grub/grub.cfg or your config file. If it was your config file then you need to run grub-mkconfig -o /boot/grub/grub.cfg again.
No I did not edit /boot/grub/grub.cfg by hand because it explicitly says it will be overwritten. So I guess the right way is to edit my config files then run grub-mkconfig, otherwise I risk ovewriting my changes at some later point.

Anyway, the problem with "unknown filesystem" was likely not related to grub, but rather to my Suse install. Because I tried booting Suse from my old usb install media and it failed! With a hugely informative message "Can not boot!", written in red. So I'm now in the process of overwriting the Suse install with Slackware64, will see how it works.

The only question that remains at this point is: can I boot Slackware64 with a 32-bit grub from my existing slackware 32 install? If not, I'll have to install the boot loader in the 64 bit OS.
 
Old 01-29-2020, 11:50 AM   #12
feb11
LQ Newbie
 
Registered: Apr 2014
Location: St.Petersburg, RU
Distribution: Slackware
Posts: 22

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by feb11 View Post
The only question that remains at this point is: can I boot Slackware64 with a 32-bit grub from my existing slackware 32 install?
Whoohoo! I got the answer already. the 32-bit grub booted Slackware64 without problem. Bye bye Suse, better luck next time!
 
Old 01-29-2020, 07:36 PM   #13
feb11
LQ Newbie
 
Registered: Apr 2014
Location: St.Petersburg, RU
Distribution: Slackware
Posts: 22

Original Poster
Rep: Reputation: Disabled
Some more info on the topic in case someone encounters problems booting Suse with Grub installed from other distro, offers 3 workarounds:
GRUB2 from other distribution cannot boot into distribution using BTRFS as root
 
Old 01-31-2020, 01:44 PM   #14
mrmazda
LQ Guru
 
Registered: Aug 2016
Location: SE USA
Distribution: openSUSE 24/7; Debian, Knoppix, Mageia, Fedora, others
Posts: 5,808
Blog Entries: 1

Rep: Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066
Distros other than SLE and openSUSE seem to have been rejecting offering support for BTRFS to varying degrees. As a long time openSUSE user I've been rejecting it completely, as have a considerable number other long time openSUSE users who are support forum participants. IMO, BTRFS is basically about SLE support and snapper rollbacks, which naturally flow through to openSUSE along with other core components due to their synergistic relationship.
 
1 members found this post helpful.
Old 02-02-2020, 08:34 AM   #15
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,346

Rep: Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589
If you want to try opensuse again, two work arounds

1. Install opensuse grub to opensuse partition, create a custom grub entry to chainload from slackware

2. Create a /suse directory on the slackware partition, copy the kernel and initrd from opensuse /boot to the /suse on the slackware partition. Create a custom entry to boot the /suse/<suse kernel/initrd> in slackware. With this work around will have to copy the new kernel/initrd over every time there is a kernel update in opensuse.

Last edited by colorpurple21859; 02-02-2020 at 08:37 AM.
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Revert grub2-efi to grub2-bios Atmchicago Fedora 1 03-24-2014 01:24 AM
[SOLVED] OpenSuSe12.3 - Help Fix Grub2 Syntax Errors (was - Replace Grub2 w/ Lilo) enorbet SUSE / openSUSE 9 12-08-2013 04:09 AM
grub2 can't see my win 7 partition and yast2 bootloader can't reinstall grub2 jjrojaspy SUSE / openSUSE 5 07-07-2013 10:38 PM
kcm-grub2 - No valid GRUB2/BURG installation could be detected cristi92b Linux - Newbie 2 06-14-2012 08:01 AM
[SOLVED] GRUB2 after a minor update of GRUB2 /boot prefix no longer needed?? wikapuki Linux - Software 1 10-24-2010 02:39 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE

All times are GMT -5. The time now is 12:05 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration