You are not logged in.

#1 2018-09-12 23:06:22

stf92
Member
Registered: 2018-05-06
Posts: 23

SOLVED grub-mkconfig does not get the second Linux OS.

Kernel 4.17.8-1-ARCH

note: this Arch has been installed from one of Arch's a rolling release iso images.

Hi: Im running Arch and Debian at present. I got to boot any of them by running grub-mkconfig from Debian. I want to install a different Linux OS in the Debian partition and hence should run grub-mkconfig from Arch (grub-mkconfig -o /boot/grub/grub.cfg).

Ay, there's the rub! The OS-prober does not get the Debian OS. The os-prober section in /boot/grub/grub.cfg is empty. This file is, maybe, important:

root@darkstar/etc/default# cat grub
# GRUB boot loader configuration

GRUB_DEFAULT=0
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="Arch"
GRUB_CMDLINE_LINUX_DEFAULT="quiet"
GRUB_CMDLINE_LINUX=""

# Preload both GPT and MBR modules so that they are not missed
GRUB_PRELOAD_MODULES="part_gpt part_msdos"

# Uncomment to enable booting from LUKS encrypted devices
#GRUB_ENABLE_CRYPTODISK=y

# Uncomment to enable Hidden Menu, and optionally hide the timeout count
#GRUB_HIDDEN_TIMEOUT=5
#GRUB_HIDDEN_TIMEOUT_QUIET=true

# Uncomment to use basic console
GRUB_TERMINAL_INPUT=console

# Uncomment to disable graphical terminal
#GRUB_TERMINAL_OUTPUT=console

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
GRUB_GFXMODE=auto

# Uncomment to allow the kernel use the same resolution used by grub
GRUB_GFXPAYLOAD_LINUX=keep

# Uncomment if you want GRUB to pass to the Linux kernel the old parameter
# format "root=/dev/xxx" instead of "root=/dev/disk/by-uuid/xxx"
#GRUB_DISABLE_LINUX_UUID=true

# Uncomment to disable generation of recovery mode menu entries
GRUB_DISABLE_RECOVERY=true

# Uncomment and set to the desired menu colors.  Used by normal and wallpaper
# modes only.  Entries specified as foreground/background.
#GRUB_COLOR_NORMAL="light-blue/black"
#GRUB_COLOR_HIGHLIGHT="light-cyan/blue"

# Uncomment one of them for the gfx desired, a image background or a gfxtheme
#GRUB_BACKGROUND="/path/to/wallpaper"
#GRUB_THEME="/path/to/gfxtheme"

# Uncomment to get a beep at GRUB start
#GRUB_INIT_TUNE="480 440 1"

# Uncomment to make GRUB remember the last selection. This requires to
# set 'GRUB_DEFAULT=saved' above.
#GRUB_SAVEDEFAULT="true"
root@darkstar/etc/default# 

However it is essentially the same as the one in the debian partition. Any suggestion? This is irrelevant, but somebody may ask: I always boot in legacy (BIOS compatible) mode and the boot sector is the MBR type. To summarize, Debian and Arch installed on the hard disk up and running, grub-mkconfig run from Debian leaves both OS's ready to use, run from Arch it fails to do so.

This maybe useful:

root@darkstar/etc/grub.d# v
total 60K
-rwxr-xr-x 1 root root 8.7K Jun 24 19:22 00_header
-rwxr-xr-x 1 root root  11K Jun 24 19:22 10_linux
-rwxr-xr-x 1 root root  11K Jun 24 19:22 20_linux_xen
-rwxr-xr-x 1 root root  12K Jun 24 19:22 30_os-prober
-rwxr-xr-x 1 root root  214 Jun 24 19:22 40_custom
-rwxr-xr-x 1 root root  216 Jun 24 19:22 41_custom
-rw-r--r-- 1 root root  483 Jun 24 19:22 README
root@darkstar/etc/grub.d# 

Last edited by stf92 (2018-09-18 18:19:14)

Offline

#2 2018-09-12 23:23:21

2ManyDogs
Forum Fellow
Registered: 2012-01-15
Posts: 4,645

Re: SOLVED grub-mkconfig does not get the second Linux OS.

I never use os-prober. There are many topics here where people have problems with it. When I want to boot another Linux, I add an entry to 40_custom or edit grub.cfg by hand (I know you're not supposed to edit grub.cfg, and I know the edits will be overwritten the next time I run mkconfig, so I usually use 40_custom; but Arch doesn't run mkconfig for kernel updates like Debian does, so custom edits are safe unless I run mkconfig myself).

https://wiki.archlinux.org/index.php/GR … menu_entry

Last edited by 2ManyDogs (2018-09-12 23:24:40)

Offline

#3 2018-09-13 00:35:27

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: SOLVED grub-mkconfig does not get the second Linux OS.

2ManyDogs wrote:

I know you're not supposed to edit grub.cfg

Who told you that horrible, incorrect advice? My grub.cfg was written from scratch, by hand, and if I didn't edit it, it wouldn't exist. hmm

and I know the edits will be overwritten the next time I run mkconfig, so I usually use 40_custom

If you are going to store all your bootloader entries in the 40_custom snippet *anyway*, why not skip the middleman and just... write your own grub.cfg from scratch?

It is dead simple, you already did it so the only thing left is to remove the weird useless cruft before and after.

stf92, if os-prober is playing monkey games with you, maybe this is a sign you should just, like, write your own grub.cfg. It's pretty simple: https://ptpb.pw/mk7y


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#4 2018-09-13 00:37:05

2ManyDogs
Forum Fellow
Registered: 2012-01-15
Posts: 4,645

Re: SOLVED grub-mkconfig does not get the second Linux OS.

I was being polite. I often edit grub.cfg, and use a custom config on some of my machines. I thought using 40_custom might be a bit less intimidating for someone in Newbie Corner.

Last edited by 2ManyDogs (2018-09-13 00:44:34)

Offline

#5 2018-09-13 07:48:12

seth
Member
Registered: 2012-09-03
Posts: 51,253

Re: SOLVED grub-mkconfig does not get the second Linux OS.

Rule out the D'ohhh: "pacman -Qs os-prober"
Other than this: did you try to run os-prober directly? Any errors there?

Offline

#6 2018-09-15 19:41:22

stf92
Member
Registered: 2018-05-06
Posts: 23

Re: SOLVED grub-mkconfig does not get the second Linux OS.

I ran os-prober directly and it detected the Debian OS. Then I ran grub-mkconfig -o /boot/grub/grub.cfg and this time Debian was detected and an os-prober section with data perteining to Debian was created. I then renamed the grub.cfg in the debian partition so the boot loader could not see it and rebooted. But then I was presented with a grub prompt only.

Offline

#7 2018-09-15 19:44:10

seth
Member
Registered: 2012-09-03
Posts: 51,253

Re: SOLVED grub-mkconfig does not get the second Linux OS.

I then renamed the grub.cfg in the debian partition so the boot loader could not see it and rebooted. But then I was presented with a grub prompt only.

You did what?
This quite frankly sounds as if you're booting from a debian managed boot partition?

Offline

#8 2018-09-15 22:44:45

stf92
Member
Registered: 2018-05-06
Posts: 23

Re: SOLVED grub-mkconfig does not get the second Linux OS.

I have no boot partition. Only one for debian and another for Arch. I now want to replace debian by another Linux distro. And I want to be sure grub-mkconfig run from Arch will let me boot Arch and the new Linux.

Last edited by stf92 (2018-09-15 23:01:42)

Offline

#9 2018-09-16 06:27:32

seth
Member
Registered: 2012-09-03
Posts: 51,253

Re: SOLVED grub-mkconfig does not get the second Linux OS.

Whereever you installed grub from *the last time* will control the boot process.
Looks a lot like that's debian.

Offline

#10 2018-09-17 00:35:55

stf92
Member
Registered: 2018-05-06
Posts: 23

Re: SOLVED grub-mkconfig does not get the second Linux OS.

Thanks a lot. Now I don't see in the wiki an answer to these questions: I boot in the BIOS compatibility (legacy) mood (BIOS menu). And I want an MBR type boot sector. Though I read the grub-install man page, I'm unable to find the options to accomplish those goals.

Offline

#11 2018-09-17 00:52:07

loqs
Member
Registered: 2014-03-06
Posts: 17,373

Re: SOLVED grub-mkconfig does not get the second Linux OS.

GRUB#Master_Boot_Record_.28MBR.29_specific_instructions covers BIOS+MBR

Last edited by loqs (2018-09-17 00:52:26)

Offline

#12 2018-09-18 18:20:13

stf92
Member
Registered: 2018-05-06
Posts: 23

Re: SOLVED grub-mkconfig does not get the second Linux OS.

Thanks.

Offline

Board footer

Powered by FluxBB