Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Grub doesn't create the correct UUID for my boot drive.
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
RayDude
Advocate
Advocate


Joined: 29 May 2004
Posts: 2062
Location: San Jose, CA

PostPosted: Mon Jul 17, 2017 5:36 pm    Post subject: Grub doesn't create the correct UUID for my boot drive. Reply with quote

My work system was running fine until I installed the CK kernel. Ever since I did that and even though I switched back to the gentoo kernel, it won't find the correct root drive. I end up hand editing the boot menu to select the correct /dev/nvme device to get the system to boot.

I have re-emerged grub. I have reinstalled it and generated a new config file. I've done the last thing at least twice. No matter what I do, the UUID posted by Grub in the beginning is not even close to what is listed in the grub config files.

Does anyone have any experience with this?

Thanks in advance.
_________________
Some day there will only be free software.
Back to top
View user's profile Send private message
sebB
l33t
l33t


Joined: 02 Mar 2011
Posts: 806
Location: S.O. France

PostPosted: Mon Jul 17, 2017 8:38 pm    Post subject: Reply with quote

Can you post your grub config, your grub.cfg and blkid?

How do you install it?
Back to top
View user's profile Send private message
saboya
Guru
Guru


Joined: 28 Nov 2006
Posts: 552
Location: Brazil

PostPosted: Mon Jul 17, 2017 11:51 pm    Post subject: Reply with quote

Is it the drive UUID or PARTUUID?
Back to top
View user's profile Send private message
RayDude
Advocate
Advocate


Joined: 29 May 2004
Posts: 2062
Location: San Jose, CA

PostPosted: Tue Jul 18, 2017 5:22 pm    Post subject: Reply with quote

I'm using UUID, or rather grub is. I don't set this stuff, grub does. My /etc/fstab has UUID and works fine.

Edit: I just realized that grub mkconfig sets it to UUID, but then complains on boot that it can't find UUID and wants PARTUUID.

This is the install script:
Code:
fire ~ # cat grub-install.sh
#!/bin/bash
grub2-install --target=x86_64-efi --efi-directory=/boot /dev/nvme0


This is make config:
Code:
fire ~ # cat grub-mkconfig.sh
#!/bin/bash
grub2-mkconfig -o /boot/grub/grub.cfg


Code:
fire ~ # cat /boot/grub/grub.cfg
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub2-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 ext2
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root  56dfbb62-a5d0-4e54-9cc1-27d3f963604d
else
  search --no-floppy --fs-uuid --set=root 56dfbb62-a5d0-4e54-9cc1-27d3f963604d
fi
    font="/usr/share/grub/unicode.pf2"
fi

if loadfont $font ; then
  set gfxmode=1024x768x32
  load_video
  insmod gfxterm
  set locale_dir=$prefix/locale
  set lang=en_US
  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 'Gentoo GNU/Linux' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-56dfbb62-a5d0-4e54-9cc1-27d3f963604d' {
        load_video
        set gfxpayload=keep
        insmod gzio
        insmod part_gpt
        insmod fat
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root  A885-4066
        else
          search --no-floppy --fs-uuid --set=root A885-4066
        fi
        echo    'Loading Linux 4.11.3-gentoo ...'
        linux   /vmlinuz-4.11.3-gentoo root=UUID=56dfbb62-a5d0-4e54-9cc1-27d3f963604d ro 
        echo    'Loading initial ramdisk ...'
        initrd  /early_ucode.cpio
}
submenu 'Advanced options for Gentoo GNU/Linux' $menuentry_id_option 'gnulinux-advanced-56dfbb62-a5d0-4e54-9cc1-27d3f963604d' {
        menuentry 'Gentoo GNU/Linux, with Linux 4.11.3-gentoo' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.11.3-gentoo-advanced-56dfbb62-a5d0-4e54-9cc1-27d3f963604d' {
                load_video
                set gfxpayload=keep
                insmod gzio
                insmod part_gpt
                insmod fat
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root  A885-4066
                else
                  search --no-floppy --fs-uuid --set=root A885-4066
                fi
                echo    'Loading Linux 4.11.3-gentoo ...'
                linux   /vmlinuz-4.11.3-gentoo root=UUID=56dfbb62-a5d0-4e54-9cc1-27d3f963604d ro 
                echo    'Loading initial ramdisk ...'
                initrd  /early_ucode.cpio
        }
        menuentry 'Gentoo GNU/Linux, with Linux 4.11.3-gentoo (recovery mode)' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.11.3-gentoo-recovery-56dfbb62-a5d0-4e54-9cc1-27d3f963604d' {
                load_video
                set gfxpayload=keep
                insmod gzio
                insmod part_gpt
                insmod fat
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root  A885-4066
                else
                  search --no-floppy --fs-uuid --set=root A885-4066
                fi
                echo    'Loading Linux 4.11.3-gentoo ...'
                linux   /vmlinuz-4.11.3-gentoo root=UUID=56dfbb62-a5d0-4e54-9cc1-27d3f963604d ro single
                echo    'Loading initial ramdisk ...'
                initrd  /early_ucode.cpio
        }
        menuentry 'Gentoo GNU/Linux, with Linux 4.11.3-gentoo.old' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.11.3-gentoo.old-advanced-56dfbb62-a5d0-4e54-9cc1-27d3f963604d' {
                load_video
                set gfxpayload=keep
                insmod gzio
                insmod part_gpt
                insmod fat
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root  A885-4066
                else
                  search --no-floppy --fs-uuid --set=root A885-4066
                fi
                echo    'Loading Linux 4.11.3-gentoo.old ...'
                linux   /vmlinuz-4.11.3-gentoo.old root=UUID=56dfbb62-a5d0-4e54-9cc1-27d3f963604d ro 
                echo    'Loading initial ramdisk ...'
                initrd  /early_ucode.cpio
        }
        menuentry 'Gentoo GNU/Linux, with Linux 4.11.3-gentoo.old (recovery mode)' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.11.3-gentoo.old-recovery-56dfbb62-a5d0-4e54-9cc1-27d3f963604d' {
                load_video
                set gfxpayload=keep
                insmod gzio
                insmod part_gpt
                insmod fat
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root  A885-4066
                else
                  search --no-floppy --fs-uuid --set=root A885-4066
                fi
                echo    'Loading Linux 4.11.3-gentoo.old ...'
                linux   /vmlinuz-4.11.3-gentoo.old root=UUID=56dfbb62-a5d0-4e54-9cc1-27d3f963604d ro single
                echo    'Loading initial ramdisk ...'
                initrd  /early_ucode.cpio
        }
        menuentry 'Gentoo GNU/Linux, with Linux 4.9.16-gentoo' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.9.16-gentoo-advanced-56dfbb62-a5d0-4e54-9cc1-27d3f963604d' {
                load_video
                set gfxpayload=keep
                insmod gzio
                insmod part_gpt
                insmod fat
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root  A885-4066
                else
                  search --no-floppy --fs-uuid --set=root A885-4066
                fi
                echo    'Loading Linux 4.9.16-gentoo ...'
                linux   /vmlinuz-4.9.16-gentoo root=UUID=56dfbb62-a5d0-4e54-9cc1-27d3f963604d ro 
                echo    'Loading initial ramdisk ...'
                initrd  /early_ucode.cpio
        }
        menuentry 'Gentoo GNU/Linux, with Linux 4.9.16-gentoo (recovery mode)' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.9.16-gentoo-recovery-56dfbb62-a5d0-4e54-9cc1-27d3f963604d' {
                load_video
                set gfxpayload=keep
                insmod gzio
                insmod part_gpt
                insmod fat
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root  A885-4066
                else
                  search --no-floppy --fs-uuid --set=root A885-4066
                fi
                echo    'Loading Linux 4.9.16-gentoo ...'
                linux   /vmlinuz-4.9.16-gentoo root=UUID=56dfbb62-a5d0-4e54-9cc1-27d3f963604d ro single
                echo    'Loading initial ramdisk ...'
                initrd  /early_ucode.cpio
        }
        menuentry 'Gentoo GNU/Linux, with Linux 4.9.16-gentoo.old' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.9.16-gentoo.old-advanced-56dfbb62-a5d0-4e54-9cc1-27d3f963604d' {
                load_video
                set gfxpayload=keep
                insmod gzio
                insmod part_gpt
                insmod fat
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root  A885-4066
                else
                  search --no-floppy --fs-uuid --set=root A885-4066
                fi
                echo    'Loading Linux 4.9.16-gentoo.old ...'
                linux   /vmlinuz-4.9.16-gentoo.old root=UUID=56dfbb62-a5d0-4e54-9cc1-27d3f963604d ro 
                echo    'Loading initial ramdisk ...'
                initrd  /early_ucode.cpio
        }
        menuentry 'Gentoo GNU/Linux, with Linux 4.9.16-gentoo.old (recovery mode)' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.9.16-gentoo.old-recovery-56dfbb62-a5d0-4e54-9cc1-27d3f963604d' {
                load_video
                set gfxpayload=keep
                insmod gzio
                insmod part_gpt
                insmod fat
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root  A885-4066
                else
                  search --no-floppy --fs-uuid --set=root A885-4066
                fi
                echo    'Loading Linux 4.9.16-gentoo.old ...'
                linux   /vmlinuz-4.9.16-gentoo.old root=UUID=56dfbb62-a5d0-4e54-9cc1-27d3f963604d ro single
                echo    'Loading initial ramdisk ...'
                initrd  /early_ucode.cpio
        }
        menuentry 'Gentoo GNU/Linux, with Linux 4.9.6-gentoo-r1' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.9.6-gentoo-r1-advanced-56dfbb62-a5d0-4e54-9cc1-27d3f963604d' {
                load_video
                set gfxpayload=keep
                insmod gzio
                insmod part_gpt
                insmod fat
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root  A885-4066
                else
                  search --no-floppy --fs-uuid --set=root A885-4066
                fi
                echo    'Loading Linux 4.9.6-gentoo-r1 ...'
                linux   /vmlinuz-4.9.6-gentoo-r1 root=UUID=56dfbb62-a5d0-4e54-9cc1-27d3f963604d ro 
                echo    'Loading initial ramdisk ...'
                initrd  /early_ucode.cpio
        }
        menuentry 'Gentoo GNU/Linux, with Linux 4.9.6-gentoo-r1 (recovery mode)' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.9.6-gentoo-r1-recovery-56dfbb62-a5d0-4e54-9cc1-27d3f963604d' {
                load_video
                set gfxpayload=keep
                insmod gzio
                insmod part_gpt
                insmod fat
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root  A885-4066
                else
                  search --no-floppy --fs-uuid --set=root A885-4066
                fi
                echo    'Loading Linux 4.9.6-gentoo-r1 ...'
                linux   /vmlinuz-4.9.6-gentoo-r1 root=UUID=56dfbb62-a5d0-4e54-9cc1-27d3f963604d ro single
                echo    'Loading initial ramdisk ...'
                initrd  /early_ucode.cpio
        }
        menuentry 'Gentoo GNU/Linux, with Linux 4.9.6-gentoo-r1.old' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.9.6-gentoo-r1.old-advanced-56dfbb62-a5d0-4e54-9cc1-27d3f963604d' {
                load_video
                set gfxpayload=keep
                insmod gzio
                insmod part_gpt
                insmod fat
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root  A885-4066
                else
                  search --no-floppy --fs-uuid --set=root A885-4066
                fi
                echo    'Loading Linux 4.9.6-gentoo-r1.old ...'
                linux   /vmlinuz-4.9.6-gentoo-r1.old root=UUID=56dfbb62-a5d0-4e54-9cc1-27d3f963604d ro 
                echo    'Loading initial ramdisk ...'
                initrd  /early_ucode.cpio
        }
        menuentry 'Gentoo GNU/Linux, with Linux 4.9.6-gentoo-r1.old (recovery mode)' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.9.6-gentoo-r1.old-recovery-56dfbb62-a5d0-4e54-9cc1-27d3f963604d' {
                load_video
                set gfxpayload=keep
                insmod gzio
                insmod part_gpt
                insmod fat
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root  A885-4066
                else
                  search --no-floppy --fs-uuid --set=root A885-4066
                fi
                echo    'Loading Linux 4.9.6-gentoo-r1.old ...'
                linux   /vmlinuz-4.9.6-gentoo-r1.old root=UUID=56dfbb62-a5d0-4e54-9cc1-27d3f963604d ro single
                echo    'Loading initial ramdisk ...'
                initrd  /early_ucode.cpio
        }
}

### 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 'Windows Boot Manager (on /dev/nvme0n1p2)' --class windows --class os $menuentry_id_option 'osprober-efi-A885-4066' {
        insmod part_gpt
        insmod fat
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root  A885-4066
        else
          search --no-floppy --fs-uuid --set=root A885-4066
        fi
        chainloader /EFI/Microsoft/Boot/bootmgfw.efi
}
### 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 ###


Code:
fire ~ # cat /etc/default/grub
# Copyright 1999-2015 Gentoo Foundation
# 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:
#     'grub2-mkconfig -o /boot/grub/grub.cfg'
#
# See the grub info page for documentation on possible variables and
# their associated values.

GRUB_DISTRIBUTOR="Gentoo"

# 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=""
#
# 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 starfield is by default provided with use truetype.
# NOTE: when enabling custom theme, ensure you have required font/etc.
#GRUB_THEME="/boot/grub/themes/starfield/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"
GRUB_GFXMODE=1024x768x32
GRUB_GFXPAYLOAD_LINUX=keep


Code:
[code]fi[/code]re ~ # blkid
/dev/nvme0n1: PTUUID="02154bb5-b21c-455d-be54-c20aa6a892d8" PTTYPE="gpt"
/dev/nvme0n1p1: UUID="3C95-C980" TYPE="vfat" PARTLABEL="grub" PARTUUID="d7acb7e9-a08e-4742-b7a0-467d212cd711"
/dev/nvme0n1p2: UUID="A885-4066" TYPE="vfat" PARTLABEL="boot" PARTUUID="d55f5355-d270-4a67-af6d-cd86b5b1e06a"
/dev/nvme0n1p3: UUID="F62A83F92A83B561" TYPE="ntfs" PARTLABEL="Windows" PARTUUID="fd7fbd55-0eb5-4d05-aa95-379fc861f5e3"
/dev/nvme0n1p4: UUID="2eeeda00-5343-4ee5-a77c-8e4e3db7a7c3" TYPE="swap" PARTLABEL="swap" PARTUUID="c32984c7-d584-4153-8c31-12363f59ff1f"
/dev/nvme0n1p5: UUID="56dfbb62-a5d0-4e54-9cc1-27d3f963604d" TYPE="ext4" PARTLABEL="Gentoo" PARTUUID="e151f69b-8fd7-45d9-a8c9-a51127395607"

_________________
Some day there will only be free software.
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 3664

PostPosted: Tue Jul 18, 2017 6:30 pm    Post subject: Re: Grub doesn't create the correct UUID for my boot drive. Reply with quote

RayDude wrote:
I have re-emerged grub. I have reinstalled it and generated a new config file. I've done the last thing at least twice. No matter what I do, the UUID posted by Grub in the beginning is not even close to what is listed in the grub config files.

Silly question: Did you have /boot mounted when doing this?
And (I'm not sure, where grub collects UUIDs), are you having UUIDs in /etc/fstab?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54236
Location: 56N 3W

PostPosted: Tue Jul 18, 2017 7:52 pm    Post subject: Reply with quote

RayDude,

blkid:
/dev/nvme0n1p5: UUID="56dfbb62-a5d0-4e54-9cc1-27d3f963604d" TYPE="ext4" PARTLABEL="Gentoo" PARTUUID="e151f69b-8fd7-45d9-a8c9-a51127395607"

That's your root filesystem UUID.

Thats the same as on the kernel loading lines in the menu and submenu.
Code:
linux   /vmlinuz-4.11.3-gentoo root=UUID=56dfbb62-a5d0-4e54-9cc1-27d3f963604d ro

So that works.

That's the kernel use of the term root.
Grub uses the term root for the filesystem where grubs files, the kernel and initrd are stored.
The difference is determined by context.

What am I missing?
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
ian.au
Guru
Guru


Joined: 07 Apr 2011
Posts: 592
Location: Australia

PostPosted: Wed Jul 19, 2017 4:53 am    Post subject: Reply with quote

RayDude,

Here's a random thought, do you have the multislot flag set on sys-boot/grub-2.xx?
If not you need to revert your scripts to use grub-mkconfig and grub-install commands (as opposed to the grub2-* variants.
per this news item:
Code:
ian@lw3 ~ $ eselect news read 39
2016-08-11-grub2_multislot_default
  Title                     Grub2 multislot default setting is changing
  Author                    William Hubbs <williamh@gentoo.org>
  Author                    Ian Stakenvicius <axs@gentoo.org>
  Posted                    2016-08-11
  Revision                  1

The multislot use flag in sys-boot/grub-2.x is no longer enabled by
default.

When the flag is enabled, all upstream binaries and documentation are
renamed to "grub2" so as not to collide with grub-0.  Now that the use
flag is no longer default-enabled, these names will revert back to
their upstream defaults.  For example, grub2-mkconfig will become
grub-mkconfig, grub2-install will become grub-install, etc.

If you wish to retain the previous naming scheme, please make sure to
explicitly enable USE="multislot" on sys-boot/grub in the usual manner.


[Moderator edit: changed [quote] tags to [code] tags to preserve output layout. -Hu]
Back to top
View user's profile Send private message
RayDude
Advocate
Advocate


Joined: 29 May 2004
Posts: 2062
Location: San Jose, CA

PostPosted: Wed Jul 19, 2017 3:36 pm    Post subject: Re: Grub doesn't create the correct UUID for my boot drive. Reply with quote

charles17 wrote:
RayDude wrote:
I have re-emerged grub. I have reinstalled it and generated a new config file. I've done the last thing at least twice. No matter what I do, the UUID posted by Grub in the beginning is not even close to what is listed in the grub config files.

Silly question: Did you have /boot mounted when doing this?
And (I'm not sure, where grub collects UUIDs), are you having UUIDs in /etc/fstab?


Yes. I have /boot mounted. Thanks for the suggestion though, everything helps.
_________________
Some day there will only be free software.
Back to top
View user's profile Send private message
RayDude
Advocate
Advocate


Joined: 29 May 2004
Posts: 2062
Location: San Jose, CA

PostPosted: Wed Jul 19, 2017 3:40 pm    Post subject: Reply with quote

ian.au wrote:
RayDude,

Here's a random thought, do you have the multislot flag set on sys-boot/grub-2.xx?
If not you need to revert your scripts to use grub-mkconfig and grub-install commands (as opposed to the grub2-* variants.
per this news item:
Quote:
ian@lw3 ~ $ eselect news read 39
2016-08-11-grub2_multislot_default
Title Grub2 multislot default setting is changing
Author William Hubbs <williamh@gentoo.org>
Author Ian Stakenvicius <axs@gentoo.org>
Posted 2016-08-11
Revision 1

The multislot use flag in sys-boot/grub-2.x is no longer enabled by
default.

When the flag is enabled, all upstream binaries and documentation are
renamed to "grub2" so as not to collide with grub-0. Now that the use
flag is no longer default-enabled, these names will revert back to
their upstream defaults. For example, grub2-mkconfig will become
grub-mkconfig, grub2-install will become grub-install, etc.

If you wish to retain the previous naming scheme, please make sure to
explicitly enable USE="multislot" on sys-boot/grub in the usual manner.


Nice idea! But, alas, it is set (although I don't remember setting it).

Code:
sudo emerge -pv grub
Password:
 * Last emerge --sync was 44d 3m 7s ago.

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R    ] sys-boot/grub-2.02_beta3-r1:2/2.02_beta3-r1::gentoo  USE="device-mapper fonts multislot nls sdl themes truetype -debug -doc -efiemu (-libzfs) -mount -static {-test}" GRUB_PLATFORMS="efi-64 -coreboot -efi-32 -emu -ieee1275 -loongson -multiboot -pc -qemu -qemu-mips -uboot -xen -xen-32" 0 KiB

Total: 1 package (1 reinstall), Size of downloads: 0 KiB

_________________
Some day there will only be free software.
Back to top
View user's profile Send private message
RayDude
Advocate
Advocate


Joined: 29 May 2004
Posts: 2062
Location: San Jose, CA

PostPosted: Wed Jul 19, 2017 3:42 pm    Post subject: Reply with quote

NeddySeagoon wrote:
RayDude,

blkid:
/dev/nvme0n1p5: UUID="56dfbb62-a5d0-4e54-9cc1-27d3f963604d" TYPE="ext4" PARTLABEL="Gentoo" PARTUUID="e151f69b-8fd7-45d9-a8c9-a51127395607"

That's your root filesystem UUID.

Thats the same as on the kernel loading lines in the menu and submenu.
Code:
linux   /vmlinuz-4.11.3-gentoo root=UUID=56dfbb62-a5d0-4e54-9cc1-27d3f963604d ro

So that works.

That's the kernel use of the term root.
Grub uses the term root for the filesystem where grubs files, the kernel and initrd are stored.
The difference is determined by context.

What am I missing?


That's the thing. It lists the PARTUUIDs when it crashes in the failed boot. I wonder if there's a way to specify grub-mkconfig to use the PARTUUID...
_________________
Some day there will only be free software.
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 3664

PostPosted: Wed Jul 19, 2017 3:50 pm    Post subject: Reply with quote

RayDude wrote:
That's the thing. It lists the PARTUUIDs when it crashes in the failed boot. I wonder if there's a way to specify grub-mkconfig to use the PARTUUID...

Can the PARTUUIDs from crash be found in output of blkid?
And, can you boot the system at all? If not, sysresccd has a mode for booting unbootable linux systems.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54236
Location: 56N 3W

PostPosted: Wed Jul 19, 2017 7:39 pm    Post subject: Reply with quote

RayDude,

Mounting by (filesystem) UUID requires an initrd, since you need the userspace mount command.
The kernel understands PARTUUID without outside help.

PARTUUIDs and filesystem UUIDs are for completely different block data structures.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
RayDude
Advocate
Advocate


Joined: 29 May 2004
Posts: 2062
Location: San Jose, CA

PostPosted: Wed Jul 19, 2017 9:36 pm    Post subject: Reply with quote

charles17 wrote:
RayDude wrote:
That's the thing. It lists the PARTUUIDs when it crashes in the failed boot. I wonder if there's a way to specify grub-mkconfig to use the PARTUUID...

Can the PARTUUIDs from crash be found in output of blkid?
And, can you boot the system at all? If not, sysresccd has a mode for booting unbootable linux systems.


I believe the UUIDs listed in crash are the PARTUUIDs from blkid.
_________________
Some day there will only be free software.
Back to top
View user's profile Send private message
RayDude
Advocate
Advocate


Joined: 29 May 2004
Posts: 2062
Location: San Jose, CA

PostPosted: Wed Jul 19, 2017 9:39 pm    Post subject: Reply with quote

NeddySeagoon wrote:
RayDude,

Mounting by (filesystem) UUID requires an initrd, since you need the userspace mount command.
The kernel understands PARTUUID without outside help.

PARTUUIDs and filesystem UUIDs are for completely different block data structures.


I'm confused. Can you please clarify?

I have two systems using UUID without initrd which boot just fine. Am I just getting lucky?

Can I specify the PARTUUID to the kernel? Can I tell grub to specify the PARTUUID?
_________________
Some day there will only be free software.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54236
Location: 56N 3W

PostPosted: Wed Jul 19, 2017 10:23 pm    Post subject: Reply with quote

RayDude,

The UUID, as in root=UUID= on the kernel command line specifies a property of the filesystem contained on a lower level block device.
The PARTUUID as is root=PARTUUID= on the kernel command line specifies a property of a partition which carries the filesystem.

Code:
/sbin/blkid
/dev/sda1: UUID="9392926d-6408-6e7a-8663-82834138a597" TYPE="linux_raid_member" PARTUUID="0553caf4-01"
/dev/sde1: UUID="c400b18c-0210-4338-a0fd-f437ecbaaf99" TYPE="ext4" PARTLABEL="ext4" PARTUUID="150e6ef1-7ba8-409c-9c3f-dbdecdc9f18b"

In the above, sda has an MSDOS partition table and sde is gpt. Hence, the different formats of PARTUUID

Consider the following thought experiment. Take a brand new drive - not eves a partition table,
Make a partition table.
Make a partition. This partition has a PARTUUID but as yet, there is no filesystem, so there is no UUID.
Make a filesystem on this partition. The PARTUUID has not changed and the UUID, belonging to the the filesystem has been created.
Make a new filesystem, overwriting the existing filesystem. The PARTUUID has not changed but the UUID is completely different.

The mount command, given a UUID, will search all available filesystems (supported by the kernel) to mount the given filesystem.
The kernel can't do that to mount root without an initrd, since it needs the mount command.

The kernel can use PARTUUID without mount, so without an initrd root=PARTUUID= works and root=UUID= leads to a kernel panic.

You may be telling grub that the root partition is UUID whatever, but grub is not using root=UUID= on the kernel command line without an initrd.
Look at
Code:
cat /proc/cmdline
root=UUID=cf559dbe-81bb-45b7-bbdd-0bcdc81e066b vga=0x317 video=vesafb:mtrr:3,ywrap

I have an initrd as I have root on LVM2 on raid5.

You can tell grub to use PARTUUID but I'm a grub legacy user, so I've not done it.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
RayDude
Advocate
Advocate


Joined: 29 May 2004
Posts: 2062
Location: San Jose, CA

PostPosted: Wed Jul 19, 2017 11:26 pm    Post subject: Reply with quote

NeddySeagoon wrote:
RayDude,

The UUID, as in root=UUID= on the kernel command line specifies a property of the filesystem contained on a lower level block device.
The PARTUUID as is root=PARTUUID= on the kernel command line specifies a property of a partition which carries the filesystem.

Code:
/sbin/blkid
/dev/sda1: UUID="9392926d-6408-6e7a-8663-82834138a597" TYPE="linux_raid_member" PARTUUID="0553caf4-01"
/dev/sde1: UUID="c400b18c-0210-4338-a0fd-f437ecbaaf99" TYPE="ext4" PARTLABEL="ext4" PARTUUID="150e6ef1-7ba8-409c-9c3f-dbdecdc9f18b"

In the above, sda has an MSDOS partition table and sde is gpt. Hence, the different formats of PARTUUID

Consider the following thought experiment. Take a brand new drive - not eves a partition table,
Make a partition table.
Make a partition. This partition has a PARTUUID but as yet, there is no filesystem, so there is no UUID.
Make a filesystem on this partition. The PARTUUID has not changed and the UUID, belonging to the the filesystem has been created.
Make a new filesystem, overwriting the existing filesystem. The PARTUUID has not changed but the UUID is completely different.

The mount command, given a UUID, will search all available filesystems (supported by the kernel) to mount the given filesystem.
The kernel can't do that to mount root without an initrd, since it needs the mount command.

The kernel can use PARTUUID without mount, so without an initrd root=PARTUUID= works and root=UUID= leads to a kernel panic.

You may be telling grub that the root partition is UUID whatever, but grub is not using root=UUID= on the kernel command line without an initrd.
Look at
Code:
cat /proc/cmdline
root=UUID=cf559dbe-81bb-45b7-bbdd-0bcdc81e066b vga=0x317 video=vesafb:mtrr:3,ywrap

I have an initrd as I have root on LVM2 on raid5.

You can tell grub to use PARTUUID but I'm a grub legacy user, so I've not done it.


Thanks for the explanation.

Grub is the one setting the command line, not me. So I'm still lost how to get it to behave.
_________________
Some day there will only be free software.
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 8291
Location: Saint Amant, Acadiana

PostPosted: Thu Jul 20, 2017 12:00 am    Post subject: Reply with quote

Quote:
Grub is the one setting the command line, not me. So I'm still lost how to get it to behave.

Do it manually, even Grub developers agree automatic creation of grub.cfg is a hit and miss. Let Ubuntu do it automatically, you are running Gentoo.

https://www.gnu.org/software/grub/manual/grub.html#Configuration
_________________
My Gentoo installation notes.
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
RayDude
Advocate
Advocate


Joined: 29 May 2004
Posts: 2062
Location: San Jose, CA

PostPosted: Thu Jul 20, 2017 8:11 pm    Post subject: Reply with quote

Jaglover wrote:
Quote:
Grub is the one setting the command line, not me. So I'm still lost how to get it to behave.

Do it manually, even Grub developers agree automatic creation of grub.cfg is a hit and miss. Let Ubuntu do it automatically, you are running Gentoo.

https://www.gnu.org/software/grub/manual/grub.html#Configuration


I figured it out...

Although I don't actually understand what is going on.

When the failure started happening, I had installed an initrd to patch the intel corei7's microcode. I removed that from the grub config file and voila! grub-mkconfig started working for me.

I'm sure there's a proper way to fix this, but since I don't actually think the intel bug I read about is fixed in the micro code I installed, I might as well not use it.
_________________
Some day there will only be free software.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo 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