You are not logged in.
Pages: 1
My computer was configured to triple boot Ubuntu Server 16.04, Arch Linux, and Gentoo Linux.
After starting the Linux from Scratch project, (I know, I have a problem) I'd inadvertently made it to where my computer wouldn't boot. I was stuck in GRUB Menu. I used my Arch ISO to mount the boot and root partitions for Arch, Chroot into the system, and re-install Grub. I can now get Arch to boot, but when I run OS-prober, it can't find Ubuntu or Gentoo anymore. At one point, I could get Gentoo to boot, but after some tinkering, I managed to make that break too. In fact, the Grub entry for Gentoo shows the Gentoo kernel using the root partition for Ubuntu instead of the root partition for Gentoo.
>inb4 RTFM
>inb4 post to Ubuntu/Gentoo.
I'm at a loss and I'm unsure where to post this question, so I've decided to post this to forums for all three distros.
From what I understand, GRUB should be installed on one distro, then use os-prober to find the others. Initially, it was Ubuntu that held the GRUB installation. Now it's Arch. Is it for this reason that Ubuntu won't boot? And if so, how do I fix it? I am trying very hard to figure this out and troubleshoot the issue rather than re-installation.
sda2 is boot
sda3 is swap
sda4 is Ubuntu
sda5 is Arch
sda6 is Gentoo
Offline
Hello there,
Out of curiosity, are you booting using UEFI or Legacy BIOS? This could give inclination to how the layout should for everything to work properly. Alternatively, is your /home separated for each distribution? Is backing up /home and reinstalling out of the question?
Regards
Offline
Legacy BIOS.
/home is separate for each distro
Last edited by nickademus4070 (2019-01-14 19:57:39)
Offline
Did yoy remember to mount sda4 and sda6 before running OS-prober?
Offline
Where should I mount them to?
Offline
os-prober ofen causes problems. If Arch is booting, it is simple to write grub stanzas for the other Linux systems. See https://wiki.archlinux.org/index.php/GRUB#GNU/Linux
You can either put these in /etc/grub.d/40_custom and then rerun grub-mkconfig, put them in /boot/grub/custom.cfg, or add them directly to grub.cfg (note that any changes you add directly to grub.cfg will be lost if you run grub-mkconfig again). Make sure you get the partitions and kernel and initrd names right.
If you still have problems, post your grub.cfg file (use [ code ] tags).
I should also mention that another alternative is to write your entire grub.cfg from scratch. This avoids the problems with grub-mkconfig and os-prober entirely. See https://wiki.archlinux.org/index.php/Us … figuration and https://ptpb.pw/mk7y
Offline
os-prober ofen causes problems. If Arch is booting, it is simple to write grub stanzas for the other Linux systems. See https://wiki.archlinux.org/index.php/GRUB#GNU/Linux
You can either put these in /etc/grub.d/40_custom and then rerun grub-mkconfig, put them in /boot/grub/custom.cfg, or add them directly to grub.cfg (note that any changes you add directly to grub.cfg will be lost if you run grub-mkconfig again). Make sure you get the partitions and kernel and initrd names right.
If you still have problems, post your grub.cfg file (use [ code ] tags).
I should also mention that another alternative is to write your entire grub.cfg from scratch. This avoids the problems with grub-mkconfig and os-prober entirely. See https://wiki.archlinux.org/index.php/Us … figuration and https://ptpb.pw/mk7y
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#
### BEGIN /etc/grub.d/00_header ###
insmod part_gpt
insmod part_msdos
if [ -s $prefix/grubenv ]; then
load_env
fi
if [ "${next_entry}" ] ; then
set default="${next_entry}"
set next_entry=
save_env next_entry
set boot_once=true
else
set default="0"
fi
if [ x"${feature_menuentry_id}" = xy ]; then
menuentry_id_option="--id"
else
menuentry_id_option=""
fi
export menuentry_id_option
if [ "${prev_saved_entry}" ]; then
set saved_entry="${prev_saved_entry}"
save_env saved_entry
set prev_saved_entry=
save_env prev_saved_entry
set boot_once=true
fi
function savedefault {
if [ -z "${boot_once}" ]; then
saved_entry="${chosen}"
save_env saved_entry
fi
}
function load_video {
if [ x$feature_all_video_module = xy ]; then
insmod all_video
else
insmod efi_gop
insmod efi_uga
insmod ieee1275_fb
insmod vbe
insmod vga
insmod video_bochs
insmod video_cirrus
fi
}
if [ x$feature_default_font_path = xy ] ; then
font=unicode
else
insmod part_gpt
insmod ext2
set root='hd0,gpt5'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-ieee1275='ieee1275//disk@0,gpt5' --hint-bios=hd0,gpt5 --hint-efi=hd0,gpt5 --hint-baremetal=ahci0,gpt5 78c45d10-b684-42a4-a048-4e8bd355596a
else
search --no-floppy --fs-uuid --set=root 78c45d10-b684-42a4-a048-4e8bd355596a
fi
font="/usr/share/grub/unicode.pf2"
fi
if loadfont $font ; then
set gfxmode=auto
load_video
insmod gfxterm
set locale_dir=$prefix/locale
set lang=en_US
insmod gettext
fi
terminal_input console
terminal_output gfxterm
if [ x$feature_timeout_style = xy ] ; then
set timeout_style=menu
set timeout=5
# Fallback normal timeout code in case the timeout_style feature is
# unavailable.
else
set timeout=5
fi
### END /etc/grub.d/00_header ###
### BEGIN /etc/grub.d/10_linux ###
menuentry 'Arch Linux' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-78c45d10-b684-42a4-a048-4e8bd355596a' {
load_video
set gfxpayload=keep
insmod gzio
insmod part_gpt
insmod ext2
set root='hd0,gpt2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-ieee1275='ieee1275//disk@0,gpt2' --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2 b066be4e-cbf0-499f-b14c-273c0f21cbc1
else
search --no-floppy --fs-uuid --set=root b066be4e-cbf0-499f-b14c-273c0f21cbc1
fi
echo 'Loading Linux linux ...'
linux /vmlinuz-linux root=UUID=78c45d10-b684-42a4-a048-4e8bd355596a rw quiet
echo 'Loading initial ramdisk ...'
initrd /initramfs-linux.img
}
submenu 'Advanced options for Arch Linux' $menuentry_id_option 'gnulinux-advanced-78c45d10-b684-42a4-a048-4e8bd355596a' {
menuentry 'Arch Linux, with Linux linux' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-advanced-78c45d10-b684-42a4-a048-4e8bd355596a' {
load_video
set gfxpayload=keep
insmod gzio
insmod part_gpt
insmod ext2
set root='hd0,gpt2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-ieee1275='ieee1275//disk@0,gpt2' --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2 b066be4e-cbf0-499f-b14c-273c0f21cbc1
else
search --no-floppy --fs-uuid --set=root b066be4e-cbf0-499f-b14c-273c0f21cbc1
fi
echo 'Loading Linux linux ...'
linux /vmlinuz-linux root=UUID=78c45d10-b684-42a4-a048-4e8bd355596a rw quiet
echo 'Loading initial ramdisk ...'
initrd /initramfs-linux.img
}
menuentry 'Arch Linux, with Linux linux (fallback initramfs)' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-fallback-78c45d10-b684-42a4-a048-4e8bd355596a' {
load_video
set gfxpayload=keep
insmod gzio
insmod part_gpt
insmod ext2
set root='hd0,gpt2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-ieee1275='ieee1275//disk@0,gpt2' --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2 b066be4e-cbf0-499f-b14c-273c0f21cbc1
else
search --no-floppy --fs-uuid --set=root b066be4e-cbf0-499f-b14c-273c0f21cbc1
fi
echo 'Loading Linux linux ...'
linux /vmlinuz-linux root=UUID=78c45d10-b684-42a4-a048-4e8bd355596a rw quiet
echo 'Loading initial ramdisk ...'
initrd /initramfs-linux-fallback.img
}
menuentry 'Arch Linux, with Linux kernel-genkernel-x86_64-4.9.16-gentoo' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-kernel-genkernel-x86_64-4.9.16-gentoo-advanced-78c45d10-b684-42a4-a048-4e8bd355596a' {
load_video
set gfxpayload=keep
insmod gzio
insmod part_gpt
insmod ext2
set root='hd0,gpt2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-ieee1275='ieee1275//disk@0,gpt2' --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2 b066be4e-cbf0-499f-b14c-273c0f21cbc1
else
search --no-floppy --fs-uuid --set=root b066be4e-cbf0-499f-b14c-273c0f21cbc1
fi
echo 'Loading Linux kernel-genkernel-x86_64-4.9.16-gentoo ...'
linux /kernel-genkernel-x86_64-4.9.16-gentoo root=/dev/sda5 rw quiet
}
}
### END /etc/grub.d/10_linux ###
### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###
### BEGIN /etc/grub.d/30_os-prober ###
menuentry 'Gentoo/Linux (on /dev/sda4)' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-simple-564c57d6-b6ea-45ee-b482-b5ac231af1f5' {
insmod part_gpt
insmod ext2
set root='hd0,gpt2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-ieee1275='ieee1275//disk@0,gpt2' --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2 b066be4e-cbf0-499f-b14c-273c0f21cbc1
else
search --no-floppy --fs-uuid --set=root b066be4e-cbf0-499f-b14c-273c0f21cbc1
fi
linux /vmlinuz-linux root=UUID=78c45d10-b684-42a4-a048-4e8bd355596a rw quiet
initrd /initramfs-linux.img
}
submenu 'Advanced options for Gentoo/Linux (on /dev/sda4)' $menuentry_id_option 'osprober-gnulinux-advanced-564c57d6-b6ea-45ee-b482-b5ac231af1f5' {
menuentry 'Arch Linux (on /dev/sda4)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/vmlinuz-linux--564c57d6-b6ea-45ee-b482-b5ac231af1f5' {
insmod part_gpt
insmod ext2
set root='hd0,gpt2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-ieee1275='ieee1275//disk@0,gpt2' --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2 b066be4e-cbf0-499f-b14c-273c0f21cbc1
else
search --no-floppy --fs-uuid --set=root b066be4e-cbf0-499f-b14c-273c0f21cbc1
fi
linux /vmlinuz-linux root=UUID=78c45d10-b684-42a4-a048-4e8bd355596a rw quiet
initrd /initramfs-linux.img
}
menuentry 'Arch Linux, with Linux linux (on /dev/sda4)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/vmlinuz-linux--564c57d6-b6ea-45ee-b482-b5ac231af1f5' {
insmod part_gpt
insmod ext2
set root='hd0,gpt2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-ieee1275='ieee1275//disk@0,gpt2' --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2 b066be4e-cbf0-499f-b14c-273c0f21cbc1
else
search --no-floppy --fs-uuid --set=root b066be4e-cbf0-499f-b14c-273c0f21cbc1
fi
linux /vmlinuz-linux root=UUID=78c45d10-b684-42a4-a048-4e8bd355596a rw quiet
initrd /initramfs-linux.img
}
menuentry 'Arch Linux, with Linux linux (fallback initramfs) (on /dev/sda4)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/vmlinuz-linux--564c57d6-b6ea-45ee-b482-b5ac231af1f5' {
insmod part_gpt
insmod ext2
set root='hd0,gpt2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-ieee1275='ieee1275//disk@0,gpt2' --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2 b066be4e-cbf0-499f-b14c-273c0f21cbc1
else
search --no-floppy --fs-uuid --set=root b066be4e-cbf0-499f-b14c-273c0f21cbc1
fi
linux /vmlinuz-linux root=UUID=78c45d10-b684-42a4-a048-4e8bd355596a rw quiet
initrd /initramfs-linux-fallback.img
}
menuentry 'Arch Linux, with Linux kernel-genkernel-x86_64-4.9.16-gentoo (on /dev/sda4)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/kernel-genkernel-x86_64-4.9.16-gentoo--564c57d6-b6ea-45ee-b482-b5ac231af1f5' {
insmod part_gpt
insmod ext2
set root='hd0,gpt2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-ieee1275='ieee1275//disk@0,gpt2' --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2 b066be4e-cbf0-499f-b14c-273c0f21cbc1
else
search --no-floppy --fs-uuid --set=root b066be4e-cbf0-499f-b14c-273c0f21cbc1
fi
linux /kernel-genkernel-x86_64-4.9.16-gentoo root=/dev/sda5 rw quiet
}
}
### END /etc/grub.d/30_os-prober ###
### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###
### BEGIN /etc/grub.d/41_custom ###
if [ -f ${config_directory}/custom.cfg ]; then
source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f $prefix/custom.cfg ]; then
source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###Offline
With Ubuntu on sda4 and Gentoo on sda6, how would you suggest I add/edit the entry?
Offline
add menuentries identically to ArchLinux entry except the string
linux /kernel root=UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx rw quiet
where kernel is your Ubuntu or Gentoo kernel file name and xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx is UUID of Ubuntu(sda4) or Gentoo(sda6) partitions.
EDIT: Also you can try to make experiment: load Ubuntu and Gentoo with Arch kernel.
Last edited by Kirill Bugaev (2019-01-14 23:26:29)
Offline
With Ubuntu on sda4 and Gentoo on sda6, how would you suggest I add/edit the entry?
Did you look at the information I linked? There are plenty of examples.
Offline
@nickademus4070
This may seem a bit over your head but quite simple, the templates here https://wiki.archlinux.org/index.php/GRUB#GNU/Linux in /etc/grub.d/40_custom are best choices I think. AFAIK, there is a pacman hook that gets run when you update grub. I fear, is those OS are bootable? You might end up to another challenge if they aren't?
linux /kernel root=UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx rw quiet
where kernel
How would grub find the kernel? The below is not important
Alternatively let GRUB search for the right partition by UUID or label
Btw, kernel naming maybe an issue in /boot
Regards
Offline
The simple solution is probably to use my pending rewrite of the grub wiki page. https://wiki.archlinux.org/index.php/Us … figuration
I'm in the process of merging to the main page, with the objective of making it more clear, how to write grub.cfg by hand. It's far, far easier than it looks, which I mostly blame on grub-mkconfig being quite stupid.
Managing AUR repos The Right Way -- aurpublish (now a standalone tool)
Offline
@nickademus4070
Kirill Bugaev wrote:linux /kernel root=UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx rw quiet
where kernelHow would grub find the kernel? The below is not important
...
search --no-floppy --fs-uuid --set=root b066be4e-cbf0-499f-b14c-273c0f21cbc1
...b066be4e-cbf0-499f-b14c-273c0f21cbc1 is /boot partition.
Such configuration works on my machine:
menuentry 'Arch Linux' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-677ae77d-7b09-4ab4-8326-f0e08b16909d' {
load_video
set gfxpayload=keep
insmod gzio
insmod part_msdos
insmod ext2
set root='hd0,msdos5'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-ieee1275='ieee1275//disk@0,msdos5' --hint-bios=hd0,msdos5 --hint-efi=hd0,msdos5 --hint-baremetal=ahci0,msdos5 b34c8789-9fb8-4c4c-a0df-f8c84f28e2b0
else
search --no-floppy --fs-uuid --set=root b34c8789-9fb8-4c4c-a0df-f8c84f28e2b0
fi
echo 'Loading Linux linux original ...'
linux /vmlinuz-linux root=UUID=677ae77d-7b09-4ab4-8326-f0e08b16909d resume=UUID=31ffa7c2-871a-423e-b09c-d3eec054b6e5 rw quiet
echo 'Loading initial original ramdisk ...'
initrd /amd-ucode.img /initramfs-linux.img
}Last edited by Kirill Bugaev (2019-01-14 23:52:50)
Offline
UPDATE:
I ran a GParted Rescue operation and I'm baffled as to how this could have possibly happened but my Ubuntu partition is gone. I must be mis-remembering because sda4 is indeed my Gentoo Root partition. sda5 is still Arch, sda6 appears to have become unformatted.
$ lsblk -f
NAME FSTYPE LABEL UUID FSAVAIL FSUSE% MOUNTPOINT
sda
├─sda1
├─sda2 ext4 b066be4e-cbf0-499f-b14c-273c0f21cbc1 813M 10% /boot
├─sda3 swap eea3b823-ad85-4fa2-96c3-c231b62d9b7c [SWAP]
├─sda4 ext4 564c57d6-b6ea-45ee-b482-b5ac231af1f5
├─sda5 ext4 78c45d10-b684-42a4-a048-4e8bd355596a 64.1G 39% /
└─sda6
sr0 Offline
So I'm going to go ahead and end this in the Gentoo forums. I appreciate all your help and apologize for my stupidity lol
Offline
Pages: 1