Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Pentoo&Ubuntu dual boot
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
vkadab63
n00b
n00b


Joined: 05 Oct 2022
Posts: 3

PostPosted: Wed Oct 05, 2022 9:18 am    Post subject: Pentoo&Ubuntu dual boot Reply with quote

Greetings to all, I had this issue for a long time now, I have googled and tried a lot of stuff but couldn't manage to configure this properly.
As a lot of instructions suggested, Ubuntu should always be installed second, since its logic is smarter in making dual boot work as desired, and that is what I did.

I have one HDD, Pentoo (based on Gentoo) was the first to be installed. Installation wizard created 3 partitions (I see these numbers from Ubuntu Gparted):
/dev/sda1 - fat32 - /boot/efi
/dev/sda3 - btrfs - Pentoo partition
/dev/sda4 - linux swap

Later, I have used Ubuntu live USB, opened up Gparted and took some space from sda3, left in without formatting. Then, I have started installation, Ubuntu recognized existing OS as Gentoo and offer to install Ubuntu alongside it and I chose the free space for it.

After rebooting, Grub is opened and I see both Ubuntu and Gentoo (Pentoo) options, but Pentoo just wouldn't boot (i will edit this post and include screenshot of error).

Running blkid in terminal, gave me this:
Quote:
/dev/sda2: UUID="ebc0a870-0408-477c-bbe1-eb0b1c9c30ba" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="4cf91a28-ed86-4aba-9075-d5376dee948d"
/dev/sda1: UUID="9AF8-BEF8" BLOCK_SIZE="512" TYPE="vfat" PARTLABEL="EFI System Partition" PARTUUID="2f654df1-92e8-4e11-add0-e4476e731f7b"
/dev/sda3: UUID="6a6d4d40-837e-4787-84d6-7fc82e5faae5" UUID_SUB="c1d644db-e32b-4bf9-8254-37203bbacd88" BLOCK_SIZE="4096" TYPE="btrfs" PARTLABEL="Pentoo" PARTUUID="e60aa43a-e136-4b37-86da-b32275d1d553"
/dev/sda4: UUID="9f51d22e-ed7b-42a5-916e-2491db547cb7" TYPE="swap" PARTUUID="7552c76b-d8c2-4da3-adb1-593f3d5079b9"


Running efibootmgr -v gave me this:
Quote:
BootCurrent: 000C
Timeout: 0 seconds
BootOrder: 000C,000F,0010,0009,0011,000A,000D,000E,0000,0001,0002,0003,0004,0005,0006,0007,0008,000B,0013
Boot0000 Startup Menu FvVol(cdbb7b35-6833-4ed6-9ab2-57d2acddf6f0)/FvFile(9d8243e8-8381-453d-aceb-c350ee7757ca)....ISPH
Boot0001 System Information FvVol(cdbb7b35-6833-4ed6-9ab2-57d2acddf6f0)/FvFile(9d8243e8-8381-453d-aceb-c350ee7757ca)......ISPH
Boot0002 Bios Setup FvVol(cdbb7b35-6833-4ed6-9ab2-57d2acddf6f0)/FvFile(9d8243e8-8381-453d-aceb-c350ee7757ca)......ISPH
Boot0003 3rd Party Option ROM Management FvVol(cdbb7b35-6833-4ed6-9ab2-57d2acddf6f0)/FvFile(9d8243e8-8381-453d-aceb-c350ee7757ca)......ISPH
Boot0004 System Diagnostics FvVol(cdbb7b35-6833-4ed6-9ab2-57d2acddf6f0)/FvFile(9d8243e8-8381-453d-aceb-c350ee7757ca)......ISPH
Boot0005 System Diagnostics FvVol(cdbb7b35-6833-4ed6-9ab2-57d2acddf6f0)/FvFile(9d8243e8-8381-453d-aceb-c350ee7757ca)......ISPH
Boot0006 System Diagnostics FvVol(cdbb7b35-6833-4ed6-9ab2-57d2acddf6f0)/FvFile(9d8243e8-8381-453d-aceb-c350ee7757ca)......ISPH
Boot0007 System Diagnostics FvVol(cdbb7b35-6833-4ed6-9ab2-57d2acddf6f0)/FvFile(9d8243e8-8381-453d-aceb-c350ee7757ca)......ISPH
Boot0008 Boot Menu FvVol(cdbb7b35-6833-4ed6-9ab2-57d2acddf6f0)/FvFile(9d8243e8-8381-453d-aceb-c350ee7757ca)......ISPH
Boot0009 USB: BBS(65535,,0x0)/PciRoot(0x0)/Pci(0x1d,0x0)......ISPH
Boot000A* #0100 ID09 LUN0 ATA TOSHIBA DT01AC BBS(HD,Harddisk1,0x0)/PciRoot(0x0)/Pci(0x1,0x0)/Pci(0x0,0x0)......ISPH
Boot000B Network Boot FvVol(cdbb7b35-6833-4ed6-9ab2-57d2acddf6f0)/FvFile(9d8243e8-8381-453d-aceb-c350ee7757ca)......ISPH
Boot000C* ubuntu HD(1,GPT,2f654df1-92e8-4e11-add0-e4476e731f7b,0x800,0x100000)/File(\EFI\ubuntu\shimx64.efi)....ISPH
Boot000D* IBA GE Slot 00C8 v1550 BBS(Network,Network1,0x0)/PciRoot(0x0)/Pci(0x19,0x0)......ISPH
Boot000E* IBA GE Slot 0500 v1550 BBS(Network,Network1,0x0)/PciRoot(0x0)/Pci(0x1c,0x0)/Pci(0x0,0x0)......ISPH
Boot000F USB: PciRoot(0x0)/Pci(0x1d,0x0)N.....YM....R,Y.....ISPH
Boot0010* hp DVDRW DU8A6SH PciRoot(0x0)/Pci(0x1f,0x2)/Sata(0,0,0)N.....YM....R,Y.....ISPH
Boot0011* hp DVDRW DU8A6SH BBS(CDROM,CDROM1,0x400)/PciRoot(0x0)/Pci(0x1f,0x2)......ISPH
Boot0012* Pentoo HD(1,GPT,2f654df1-92e8-4e11-add0-e4476e731f7b,0x800,0x100000)/File(\EFI\Pentoo\BOOTX64.EFI)
Boot0013 HP Recovery FvVol(cdbb7b35-6833-4ed6-9ab2-57d2acddf6f0)/FvFile(9d8243e8-8381-453d-aceb-c350ee7757ca)......ISPH


I have tried pentoo telegram group but I am getting godlike tier answers, but I am so far away from it with my knowledge.

However, when I am running Ubuntu, Pentoo partition is sometimes visible and sometimes is not and my current fstab file (when its not visible) looks like this:
Quote:
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/sda2 during installation
UUID=ebc0a870-0408-477c-bbe1-eb0b1c9c30ba / ext4 errors=remount-ro 0 1
# /boot/efi was on /dev/sda1 during installation
UUID=9AF8-BEF8 /boot/efi vfat umask=0077 0 1
/swapfile none swap sw 0 0


Pls help, I need both since I am using Pluto+, GnuRadio and HackRF for my SDR tasks.
I need both since I can compare GRC packages and versions, as older ones have working Osmann blocks and Pentoo comes with all dependencies preinstalled. Also, I can run it easily everywhere from Live USB.[/code]
Back to top
View user's profile Send private message
alamahant
Advocate
Advocate


Joined: 23 Mar 2019
Posts: 3879

PostPosted: Wed Oct 05, 2022 10:40 am    Post subject: Reply with quote

Plz chroot into your pentoo via ubuntu and run
Code:

rm /boot//efi/EFI/Pentoo/BOOTX64.EFI
grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=Pentoo --recheck
exit
reboot

If successful in Pentoo run
Code:

sed -i '/PROBER/d'  /etc/default/grub
echo "GRUB_DISABLE_OS_PROBER=false" >> /etc/default/grub
grub-mkconfig -o /boot/grub/grub.cfg

BUT
Quote:

Later, I have used Ubuntu live USB, opened up Gparted and took some space from sda3, left in without formatting

maybe you somehow messed your btrfs.
Plz post Pentoo's
/etc/default/grub
_________________
:)


Last edited by alamahant on Thu Oct 06, 2022 11:48 am; edited 1 time in total
Back to top
View user's profile Send private message
vkadab63
n00b
n00b


Joined: 05 Oct 2022
Posts: 3

PostPosted: Thu Oct 06, 2022 10:28 am    Post subject: Reply with quote

I found a way of booting Pentoo successfully, and here's how:
When Grub start menu appeared, I have chosen Pentoo installation, pressed E to open up boot commands and params. Last line was:
Code:
initrd     /intel-uc.img


However, I took a pic of the menu when I only had Pentoo and the booting was normal. I compared the two and found the difference at the last line, so I added it:
Code:
initrd    /intel-uc.img /amd-uc.img /initramfs-5.18.13-pentoo.img


After this step, I was able to boot into Pentoo correctly.
I was trying to use grep to find which file contains this command but couldnt find it. There is /boot/grub/grub.cfg file containing the same params, but this one should not be edited since its created by /etc/grub.d and /etc/default/grub
30_os-prober is the file that generates these lines in grub.cfg, but I dont know how to add these two images to initrd

Screenshot here: https://ibb.co/LQQVzpj


Quote:
Plz chroot into your pentoo via ubuntu and run

At this point, my Pentoo boot dir is completely empty, probably run over while installing Ubuntu.

Thanks for the help (:

Here is Pentoo's /etc/default/grub :
Code:
# Copyright 1999-2020 Pentoo Authors
# Distributed under the terms of the GNU General Public License v2
#
# To populate all changes in this file you need to regenerate your
# grub configuration file afterwards:
#     'grub-mkconfig -o /boot/grub/grub.cfg'
#
# See the grub info page for documentation on possible variables and
# their associated values.

GRUB_DISTRIBUTOR="Pentoo"

# Default menu entry
#GRUB_DEFAULT=0

# Boot the default entry this many seconds after the menu is displayed
#GRUB_TIMEOUT=5
#GRUB_TIMEOUT_STYLE=menu

# Append parameters to the linux kernel command line
GRUB_CMDLINE_LINUX="real_root=UUID=6a6d4d40-837e-4787-84d6-7fc82e5faae5 video=efifb console=tty1 net.ifnames=0 ro"
#
# Examples:
#
# Boot with network interface renaming disabled
# GRUB_CMDLINE_LINUX="net.ifnames=0"
#
# Boot with systemd instead of sysvinit (openrc)
# GRUB_CMDLINE_LINUX="init=/usr/lib/systemd/systemd"

# Append parameters to the linux kernel command line for non-recovery entries
#GRUB_CMDLINE_LINUX_DEFAULT=""

# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=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=640x480

# Set to 'text' to force the Linux kernel to boot in normal text
# mode, 'keep' to preserve the graphics mode set using
# 'GRUB_GFXMODE', 'WIDTHxHEIGHT'['xDEPTH'] to set a particular
# graphics mode, or a sequence of these separated by commas or
# semicolons to try several modes in sequence.
#GRUB_GFXPAYLOAD_LINUX=

# Path to theme spec txt file.
# The pentoo is by default provided with use truetype.
# NOTE: when enabling custom theme, ensure you have required font/etc.
#GRUB_THEME="/boot/grub/themes/pentoo/theme.txt"

# Background image used on graphical terminal.
# Can be in various bitmap formats.
#GRUB_BACKGROUND="/boot/grub/mybackground.png"

# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to kernel
#GRUB_DISABLE_LINUX_UUID=true

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

# Uncomment to disable generation of the submenu and put all choices on
# the top-level menu.
# Besides the visual affect of no sub menu, this makes navigation of the
# menu easier for a user who can't see the screen.
#GRUB_DISABLE_SUBMENU=y

# Uncomment to play a tone when the main menu is displayed.
# This is useful, for example, to allow users who can't see the screen
# to know when they can make a choice on the menu.
#GRUB_INIT_TUNE="60 800 1"
Back to top
View user's profile Send private message
alamahant
Advocate
Advocate


Joined: 23 Mar 2019
Posts: 3879

PostPosted: Thu Oct 06, 2022 11:47 am    Post subject: Reply with quote

Quote:

However, I took a pic of the menu when I only had Pentoo and the booting was normal. I compared the two and found the difference at the last line, so I added it:
Code:
initrd /intel-uc.img /amd-uc.img /initramfs-5.18.13-pentoo.img


After this step, I was able to boot into Pentoo correctly.

and
Quote:

At this point, my Pentoo boot dir is completely empty, probably run over while installing Ubuntu.

these two are mutually exclusive.
If /boot is /empty then where does
/initramfs-5.18.13-pentoo.img
reside?
Plz do this
Code:

Plz chroot into your pentoo via ubuntu and run
Code:
mount -a
rm /boot/efi/EFI/Pentoo/BOOTX64.EFI
grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=Pentoo --recheck
exit
reboot

If successful in Pentoo run
Code:

sed -i '/PROBER/d'  /etc/default/grub
echo "GRUB_DISABLE_OS_PROBER=false" >> /etc/default/grub
grub-mkconfig -o /boot/grub/grub.cfg

_________________
:)
Back to top
View user's profile Send private message
vkadab63
n00b
n00b


Joined: 05 Oct 2022
Posts: 3

PostPosted: Fri Oct 07, 2022 7:05 am    Post subject: Reply with quote

It was a little misunderstanding on my side, after googling how to mount Pentoo and chroot into it, it was clear and I have followed your steps.
After running
Code:
grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=Pentoo --recheck
Installing for x86_64-efi platform.
Installation finished. No error reported.

I have Pentoo folders in both /EFI/ and /EFI/EFI.

However, after rebooting and opening edit commands in Grub meny, images are not there at initrd line.
When I try to boot after correcting it, I get two EFI stub errors:
exit_boot() and efi_main()

Now, my Pentoo /mnt/pentoo/boot/grub/grub.cfg looks like this:
Code:
#
# 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 ###
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 btrfs
set root='hd4,gpt3'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-ieee1275='ieee1275//disk@2,gpt3' --hint-bios=hd4,gpt3 --hint-efi=hd4,gpt3 --hint-baremetal=ahci4,gpt3  6a6d4d40-837e-4787-84d6-7fc82e5faae5
else
  search --no-floppy --fs-uuid --set=root 6a6d4d40-837e-4787-84d6-7fc82e5faae5
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=C
  insmod gettext
fi
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 'Pentoo GNU/Linux' --class pentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-6a6d4d40-837e-4787-84d6-7fc82e5faae5' {
   load_video
   if [ "x$grub_platform" = xefi ]; then
      set gfxpayload=keep
   fi
   insmod gzio
   insmod part_gpt
   insmod fat
   set root='hd4,gpt1'
   if [ x$feature_platform_search_hint = xy ]; then
     search --no-floppy --fs-uuid --set=root --hint-ieee1275='ieee1275//disk@2,gpt1' --hint-bios=hd4,gpt1 --hint-efi=hd4,gpt1 --hint-baremetal=ahci4,gpt1  9AF8-BEF8
   else
     search --no-floppy --fs-uuid --set=root 9AF8-BEF8
   fi
   echo   'Loading Linux 5.18.13-pentoo ...'
   linux   /vmlinuz-5.18.13-pentoo root=UUID=6a6d4d40-837e-4787-84d6-7fc82e5faae5 ro real_root=UUID=6a6d4d40-837e-4787-84d6-7fc82e5faae5 video=efifb console=tty1 net.ifnames=0 ro
   echo   'Loading initial ramdisk ...'
   initrd   /intel-uc.img /amd-uc.img /initramfs-5.18.13-pentoo.img
}
submenu 'Advanced options for Pentoo GNU/Linux' $menuentry_id_option 'gnulinux-advanced-6a6d4d40-837e-4787-84d6-7fc82e5faae5' {
   menuentry 'Pentoo GNU/Linux, with Linux 5.18.13-pentoo' --class pentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.18.13-pentoo-advanced-6a6d4d40-837e-4787-84d6-7fc82e5faae5' {
      load_video
      if [ "x$grub_platform" = xefi ]; then
         set gfxpayload=keep
      fi
      insmod gzio
      insmod part_gpt
      insmod fat
      set root='hd4,gpt1'
      if [ x$feature_platform_search_hint = xy ]; then
        search --no-floppy --fs-uuid --set=root --hint-ieee1275='ieee1275//disk@2,gpt1' --hint-bios=hd4,gpt1 --hint-efi=hd4,gpt1 --hint-baremetal=ahci4,gpt1  9AF8-BEF8
      else
        search --no-floppy --fs-uuid --set=root 9AF8-BEF8
      fi
      echo   'Loading Linux 5.18.13-pentoo ...'
      linux   /vmlinuz-5.18.13-pentoo root=UUID=6a6d4d40-837e-4787-84d6-7fc82e5faae5 ro real_root=UUID=6a6d4d40-837e-4787-84d6-7fc82e5faae5 video=efifb console=tty1 net.ifnames=0 ro
      echo   'Loading initial ramdisk ...'
      initrd   /intel-uc.img /amd-uc.img /initramfs-5.18.13-pentoo.img
   }
   menuentry 'Pentoo GNU/Linux, with Linux 5.18.13-pentoo (recovery mode)' --class pentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.18.13-pentoo-recovery-6a6d4d40-837e-4787-84d6-7fc82e5faae5' {
      load_video
      if [ "x$grub_platform" = xefi ]; then
         set gfxpayload=keep
      fi
      insmod gzio
      insmod part_gpt
      insmod fat
      set root='hd4,gpt1'
      if [ x$feature_platform_search_hint = xy ]; then
        search --no-floppy --fs-uuid --set=root --hint-ieee1275='ieee1275//disk@2,gpt1' --hint-bios=hd4,gpt1 --hint-efi=hd4,gpt1 --hint-baremetal=ahci4,gpt1  9AF8-BEF8
      else
        search --no-floppy --fs-uuid --set=root 9AF8-BEF8
      fi
      echo   'Loading Linux 5.18.13-pentoo ...'
      linux   /vmlinuz-5.18.13-pentoo root=UUID=6a6d4d40-837e-4787-84d6-7fc82e5faae5 ro single real_root=UUID=6a6d4d40-837e-4787-84d6-7fc82e5faae5 video=efifb console=tty1 net.ifnames=0 ro
      echo   'Loading initial ramdisk ...'
      initrd   /intel-uc.img /amd-uc.img /initramfs-5.18.13-pentoo.img
   }
}

### 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 ###
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/30_uefi-firmware ###
menuentry 'UEFI Firmware Settings' $menuentry_id_option 'uefi-firmware' {
   fwsetup
}
### END /etc/grub.d/30_uefi-firmware ###

### BEGIN /etc/grub.d/35_fwupd ###
### END /etc/grub.d/35_fwupd ###

### 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 ###
Back to top
View user's profile Send private message
alamahant
Advocate
Advocate


Joined: 23 Mar 2019
Posts: 3879

PostPosted: Fri Oct 07, 2022 6:24 pm    Post subject: Reply with quote

Quote:

After running
Code:
grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=Pentoo --recheck
Installing for x86_64-efi platform.
Installation finished. No error reported.

I have Pentoo folders in both /EFI/ and /EFI/EFI.

Ok you can safely remove the /boot/EFI files and only keep the /boot/efi/EFI ones provided that /boot/EFI does not contain the ubuntu folder.
Try
Code:

ls /boot/efi/EFI

I guess you have two folders:One for ubuntu and one for Pentoo.
Ok now run from within chroot
Code:

### PLZ FIRST REBUILD YOUR INITRAMFS then
grub-mkconfig -o /boot/grub/grub.cfg
efibootmgr
efibootmgr -n <Pentoo-id> ### not really necessary to set next boot because you re-installed grub and by default Pentoo is the one to boot into.
exit
reboot

Hopefully you will boot into Pentoo.
_________________
:)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum