Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[S-ED] Is it posiible to boot with grub2+uuid root-initrd ?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
Kollin
Veteran
Veteran


Joined: 25 Feb 2006
Posts: 1099
Location: Sofia/Bulgaria

PostPosted: Fri Feb 10, 2012 1:33 am    Post subject: [S-ED] Is it posiible to boot with grub2+uuid root-initrd ? Reply with quote

My grub.cfg:

Code:
#
# 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
set default="0"
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 {
  insmod vbe
  insmod vga
  insmod video_bochs
  insmod video_cirrus
}

insmod part_gpt
insmod ext2
set root='(hd0,gpt2)'
search --no-floppy --fs-uuid --set=root 69cdb644-4e09-48ad-8836-3074b67978b0
if loadfont /usr/share/grub2/unicode.pf2 ; then
  set gfxmode=1280x1024
  load_video
  insmod gfxterm
fi
terminal_output gfxterm
insmod part_gpt
insmod ext2
set root='(hd0,gpt1)'
search --no-floppy --fs-uuid --set=root 644f54be-f7eb-4b9e-af9a-d206fe9ec964
insmod png
background_image -m stretch /grub2/01356_crepuscule_1600x1200.png
if sleep --interruptible 0 ; then
  set timeout=10
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/10_linux ###
menuentry 'GNU/Linux, with Linux 3.1.10-gentoo-r1' --class gnu-linux --class gnu --class os {
   load_video
   insmod gzio
   insmod part_gpt
   insmod ext2
   set root='(hd0,gpt1)'
   search --no-floppy --fs-uuid --set=root 644f54be-f7eb-4b9e-af9a-d206fe9ec964
   echo   'Loading Linux 3.1.10-gentoo-r1 ...'
   linux   /vmlinuz-3.1.10-gentoo-r1 root=UUID=69cdb644-4e09-48ad-8836-3074b67978b0 ro rootfstype=ext4 video=uvesafb:1280x1024-32@75,ywrap,mtrr:3
}
menuentry 'GNU/Linux, with Linux 3.1.10-gentoo-r1 (recovery mode)' --class gnu-linux --class gnu --class os {
   load_video
   insmod gzio
   insmod part_gpt
   insmod ext2
   set root='(hd0,gpt1)'
   search --no-floppy --fs-uuid --set=root 644f54be-f7eb-4b9e-af9a-d206fe9ec964
   echo   'Loading Linux 3.1.10-gentoo-r1 ...'
   linux   /vmlinuz-3.1.10-gentoo-r1 root=UUID=69cdb644-4e09-48ad-8836-3074b67978b0 ro single rootfstype=ext4 video=uvesafb:1280x1024-32@75,ywrap,mtrr:3
}
menuentry 'GNU/Linux, with Linux 3.1.10-gentoo-r1.old' --class gnu-linux --class gnu --class os {
   load_video
   insmod gzio
   insmod part_gpt
   insmod ext2
   set root='(hd0,gpt1)'
   search --no-floppy --fs-uuid --set=root 644f54be-f7eb-4b9e-af9a-d206fe9ec964
   echo   'Loading Linux 3.1.10-gentoo-r1.old ...'
   linux   /vmlinuz-3.1.10-gentoo-r1.old root=UUID=69cdb644-4e09-48ad-8836-3074b67978b0 ro rootfstype=ext4 video=uvesafb:1280x1024-32@75,ywrap,mtrr:3
}
menuentry 'GNU/Linux, with Linux 3.1.10-gentoo-r1.old (recovery mode)' --class gnu-linux --class gnu --class os {
   load_video
   insmod gzio
   insmod part_gpt
   insmod ext2
   set root='(hd0,gpt1)'
   search --no-floppy --fs-uuid --set=root 644f54be-f7eb-4b9e-af9a-d206fe9ec964
   echo   'Loading Linux 3.1.10-gentoo-r1.old ...'
   linux   /vmlinuz-3.1.10-gentoo-r1.old root=UUID=69cdb644-4e09-48ad-8836-3074b67978b0 ro single rootfstype=ext4 video=uvesafb:1280x1024-32@75,ywrap,mtrr:3
}
### 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/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  $prefix/custom.cfg ]; then
  source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###




My fstab :

Code:


UUID=644f54be-f7eb-4b9e-af9a-d206fe9ec964      /boot            ext2      noauto,noatime,user         1 2
UUID=69cdb644-4e09-48ad-8836-3074b67978b0      /            ext4      noatime,nodiratime,auto_da_alloc    0 1
UUID=91c838e0-e761-4817-9b53-32317d320205      none            swap      sw               0 0
UUID=7952e128-144e-42d9-9fbb-008ddd12e36a      /home            ext4      noatime,nodiratime,auto_da_alloc    0 1
UUID=9fdc98bd-0be5-4377-a992-8a902d9ec543      /home/kollin/downloads      ext4      noatime,nodiratime,auto_da_alloc    0 1
UUID=abc876f0-8587-490d-b2ed-2b3ade7c7d28      /usr/portage         ext4      noatime,nodiratime,auto_da_alloc    0 1
#tmpfs                     /var/tmp/portage           tmpfs      size=4096M,nr_inodes=10M,mode=0777   0 1
tmpfs                     /var/tmp/portage           tmpfs      size=6144M,nr_inodes=10M,mode=0777   0 1
#UUID=806e8107-6922-4a2c-a1da-0566dab87dab      /var/tmp/portage      ext4      noatime,nodiratime,auto_da_alloc    0 1
UUID=1a531f23-de19-458d-8232-cc79cba0b24f      /home/kollin/backup      ext4      noatime,nodiratime,auto_da_alloc    0 1
UUID=ef1a3ca9-47cc-4624-a879-b97179009944      /tmp            ext4      noatime,nodiratime,auto_da_alloc    0 1
UUID=148a846a-4cfd-4198-ac91-ab8dbca047f4      /home/kollin/downloads/1sda6   ext4      noatime,nodiratime,auto_da_alloc    0 1
UUID=f08eed40-6afb-4cf8-aa9c-9ab270a4de53      /home/kollin/downloads/2sda7   ext4      noatime,nodiratime,auto_da_alloc    0 1
UUID=8fb18050-d145-438c-bd11-1216d096973a      /home/kollin/downloads/3sda8   ext4      noatime,nodiratime,auto_da_alloc    0 1
/dev/cdrom                  /mnt/cdrom         auto         noauto,user         0 0
/dev/sr0                  /mnt/sr0         auto      noauto,user            0 0
/dev/sr1                  /mnt/sr1         auto      noauto,user            0 0

/dev/fd0                  /mnt/floppy         auto      noauto,user            0 0

# glibc 2.2 and above expects tmpfs to be mounted at /dev/shm for
# POSIX shared memory (shm_open, shm_unlink).
# (tmpfs is a dynamically expandable/shrinkable ramdisk, and will
#  use almost no memory if not populated with files)
shm                     /dev/shm         tmpfs      nodev,nosuid,noexec         0 0


Grub2 useflags:

Code:
emerge -pv '=sys-boot/grub-1.99-r2'

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

Calculating dependencies          ... done!
[ebuild   R   *] sys-boot/grub-1.99-r2  USE="nls sdl truetype -custom-cflags -debug -device-mapper -efiemu -static" GRUB_PLATFORMS="pc -coreboot -efi-32 -efi-64 -emu -ieee1275 -multiboot -qemu -qemu-mips -yeeloong" 0 kB

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


I tried several combinations with uuid root partition an nothing works./dev/sda2 should be explicitly specified after vmlinuz or kernel panic follows :?
Is that even possible without initrd image?
_________________
"Dear Enemy: may the Lord hate you and all your kind, may you be turned orange in hue, and may your head fall off at an awkward moment."
"Linux is like a wigwam - no windows, no gates, apache inside..."


Last edited by Kollin on Sun Feb 12, 2012 12:29 am; edited 1 time in total
Back to top
View user's profile Send private message
andrewthomas
Tux's lil' helper
Tux's lil' helper


Joined: 27 Apr 2010
Posts: 93

PostPosted: Sat Feb 11, 2012 1:21 pm    Post subject: Re: Is it posiible to boot with grub2 + uuid root - initrd ? Reply with quote

Kollin wrote:


I tried several combinations with uuid root partition an nothing works./dev/sda2 should be explicitly specified after vmlinuz or kernel panic follows :?
Is that even possible without initrd image?

No.

To Use UUID's, you must use an initrd.
Back to top
View user's profile Send private message
Gusar
Advocate
Advocate


Joined: 09 Apr 2005
Posts: 2643
Location: Slovenia

PostPosted: Sat Feb 11, 2012 1:46 pm    Post subject: Reply with quote

You can if you use gpt partitions:
Code:
root=PARTUUID=uuid_here

Note, this is the *partition* uuid, not the filesystem uuid. Different things. You can see it in gdisk under "Partition unique GUID" by pressing "i" on the relevant partition.
Back to top
View user's profile Send private message
Kollin
Veteran
Veteran


Joined: 25 Feb 2006
Posts: 1099
Location: Sofia/Bulgaria

PostPosted: Sat Feb 11, 2012 2:39 pm    Post subject: Reply with quote

andrewthomas wrote:

No.

To Use UUID's, you must use an initrd.


Thank you, I thought so :wink:



Gusar wrote:
You can if you use gpt partitions:
Code:
root=PARTUUID=uuid_here

Note, this is the *partition* uuid, not the filesystem uuid. Different things. You can see it in gdisk under "Partition unique GUID" by pressing "i" on the relevant partition.


Perfect, I'll try that.I use GPT anyway :D
_________________
"Dear Enemy: may the Lord hate you and all your kind, may you be turned orange in hue, and may your head fall off at an awkward moment."
"Linux is like a wigwam - no windows, no gates, apache inside..."
Back to top
View user's profile Send private message
Kollin
Veteran
Veteran


Joined: 25 Feb 2006
Posts: 1099
Location: Sofia/Bulgaria

PostPosted: Sat Feb 11, 2012 5:54 pm    Post subject: Reply with quote

That works perfectly!

Now what needs to be changed into /etc/grub.d/10_linux script and /etc/default/grub config file in such manner so grub2-mkconfig updates grub.cfg with PARTUUID instead UUID:

/etc/grub.d/10_linux script

Code:


#! /bin/sh
set -e

# grub-mkconfig helper script.
# Copyright (C) 2006,2007,2008,2009,2010  Free Software Foundation, Inc.
#
# GRUB is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# GRUB is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GRUB.  If not, see <http://www.gnu.org/licenses/>.

prefix=/usr
exec_prefix=${prefix}
bindir=/bin
libdir=/lib64
. ${libdir}/grub/grub-mkconfig_lib

export TEXTDOMAIN=grub
export TEXTDOMAINDIR=${prefix}/share/locale

CLASS="--class gnu-linux --class gnu --class os"

if [ "x${GRUB_DISTRIBUTOR}" = "x" ] ; then
  OS=GNU/Linux
else
  OS="${GRUB_DISTRIBUTOR} GNU/Linux"
  CLASS="--class $(echo ${GRUB_DISTRIBUTOR} | tr 'A-Z' 'a-z' | cut -d' ' -f1) ${CLASS}"
fi

# loop-AES arranges things so that /dev/loop/X can be our root device, but
# the initrds that Linux uses don't like that.
case ${GRUB_DEVICE} in
  /dev/loop/*|/dev/loop[0-9])
    GRUB_DEVICE=`losetup ${GRUB_DEVICE} | sed -e "s/^[^(]*(\([^)]\+\)).*/\1/"`
  ;;
esac

if [ "x${GRUB_DEVICE_UUID}" = "x" ] || [ "x${GRUB_DISABLE_LINUX_UUID}" = "xtrue" ] \
    || ! test -e "/dev/disk/by-uuid/${GRUB_DEVICE_UUID}" \
    || uses_abstraction "${GRUB_DEVICE}" lvm; then
  LINUX_ROOT_DEVICE=${GRUB_DEVICE}
else
  LINUX_ROOT_DEVICE=UUID=${GRUB_DEVICE_UUID}
fi

if [ "x`${grub_probe} --device ${GRUB_DEVICE} --target=fs 2>/dev/null || true`" = xbtrfs ]; then
  rootsubvol="`make_system_path_relative_to_its_root /`"
  rootsubvol="${rootsubvol#/}"
  if [ "x${rootsubvol}" != x ]; then
    GRUB_CMDLINE_LINUX="rootflags=subvol=${rootsubvol} ${GRUB_CMDLINE_LINUX}"
  fi
fi

linux_entry ()
{
  os="$1"
  version="$2"
  recovery="$3"
  args="$4"
  if ${recovery} ; then
    title="$(gettext_quoted "%s, with Linux %s (recovery mode)")"
  else
    title="$(gettext_quoted "%s, with Linux %s")"
  fi
  printf "menuentry '${title}' ${CLASS} {\n" "${os}" "${version}"
  if ! ${recovery} ; then
      save_default_entry | sed -e "s/^/\t/"
  fi

  # Use ELILO's generic "efifb" when it's known to be available.
  # FIXME: We need an interface to select vesafb in case efifb can't be used.
  if [ "x$GRUB_GFXPAYLOAD_LINUX" = x ]; then
      cat << EOF
   load_video
EOF
      if grep -qx "CONFIG_FB_EFI=y" "${config}" 2> /dev/null \
     && grep -qx "CONFIG_VT_HW_CONSOLE_BINDING=y" "${config}" 2> /dev/null; then
     cat << EOF
   set gfxpayload=keep
EOF
      fi
  else
      if [ "x$GRUB_GFXPAYLOAD_LINUX" != xtext ]; then
     cat << EOF
   load_video
EOF
      fi
     cat << EOF
   set gfxpayload=$GRUB_GFXPAYLOAD_LINUX
EOF
  fi

  cat << EOF
   insmod gzio
EOF

  if [ x$dirname = x/ ]; then
    if [ -z "${prepare_root_cache}" ]; then
      prepare_root_cache="$(prepare_grub_to_access_device ${GRUB_DEVICE} | sed -e "s/^/\t/")"
    fi
    printf '%s\n' "${prepare_root_cache}"
  else
    if [ -z "${prepare_boot_cache}" ]; then
      prepare_boot_cache="$(prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/")"
    fi
    printf '%s\n' "${prepare_boot_cache}"
  fi
  message="$(gettext_printf "Loading Linux %s ..." ${version})"
  cat << EOF
   echo   '$message'
   linux   ${rel_dirname}/${basename} root=${linux_root_device_thisversion} ro ${args}
EOF
  if test -n "${initrd}" ; then
    message="$(gettext_printf "Loading initial ramdisk ...")"
    cat << EOF
   echo   '$message'
   initrd   ${rel_dirname}/${initrd}
EOF
  fi
  cat << EOF
}
EOF
}

case x`uname -m` in
    xi?86 | xx86_64)
   list=`for i in /boot/vmlinuz-* /vmlinuz-* /boot/kernel-* ; do
                  if grub_file_is_not_garbage "$i" ; then echo -n "$i " ; fi
              done` ;;
    *)
   list=`for i in /boot/vmlinuz-* /boot/vmlinux-* /vmlinuz-* /vmlinux-* /boot/kernel-* ; do
                  if grub_file_is_not_garbage "$i" ; then echo -n "$i " ; fi
        done` ;;
esac

prepare_boot_cache=
prepare_root_cache=

while [ "x$list" != "x" ] ; do
  linux=`version_find_latest $list`
  echo "Found linux image: $linux" >&2
  basename=`basename $linux`
  dirname=`dirname $linux`
  rel_dirname=`make_system_path_relative_to_its_root $dirname`
  version=`echo $basename | sed -e "s,^[^0-9]*-,,g"`
  alt_version=`echo $version | sed -e "s,\.old$,,g"`
  linux_root_device_thisversion="${LINUX_ROOT_DEVICE}"

  initrd=
  for i in "initrd.img-${version}" "initrd-${version}.img" \
      "initrd-${version}" "initramfs-${version}.img" \
      "initrd.img-${alt_version}" "initrd-${alt_version}.img" \
      "initrd-${alt_version}" "initramfs-${alt_version}.img" \
      "initramfs-genkernel-${version}" \
      "initramfs-genkernel-${alt_version}"; do
    if test -e "${dirname}/${i}" ; then
      initrd="$i"
      break
    fi
  done

  config=
  for i in "${dirname}/config-${version}" "${dirname}/config-${alt_version}" "/etc/kernels/kernel-config-${version}" ; do
    if test -e "${i}" ; then
      config="${i}"
      break
    fi
  done

  initramfs=
  if test -n "${config}" ; then
      initramfs=`grep CONFIG_INITRAMFS_SOURCE= "${config}" | cut -f2 -d= | tr -d \"`
  fi

  if test -n "${initrd}" ; then
    echo "Found initrd image: ${dirname}/${initrd}" >&2
  elif test -z "${initramfs}" ; then
    # "UUID=" magic is parsed by initrd or initramfs.  Since there's
    # no initrd or builtin initramfs, it can't work here.
    linux_root_device_thisversion=${GRUB_DEVICE}
  fi

  linux_entry "${OS}" "${version}" false \
      "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}"
  if [ "x${GRUB_DISABLE_RECOVERY}" != "xtrue" ]; then
    linux_entry "${OS}" "${version}" true \
   "single ${GRUB_CMDLINE_LINUX}"
  fi

  list=`echo $list | tr ' ' '\n' | grep -vx $linux | tr '\n' ' '`
done


/etc/default/grub:

Code:
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sys-boot/grub/files/grub.default,v 1.2 2011/08/30 06:45:04 scarabeus Exp $
#
# To populate all changes in this file you need to regenerate your
# grub configuration file afterwards:
#     'grub2-mkconfig -o /boot/grub2/grub.cfg'
#
# See the grub info page for documentation on possible variables and
# their associated values.

GRUB_DEFAULT=0
GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=10

GRUB_CMDLINE_LINUX_DEFAULT=""
GRUB_CMDLINE_LINUX="rootfstype=ext4 video=uvesafb:1280x1024-32@75,ywrap,mtrr:3"

# 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=1280x1024

# Background image used on graphical terminal.
# Can be in various bitmap formats.
GRUB_BACKGROUND="/boot/grub2/01356_crepuscule_1600x1200.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

_________________
"Dear Enemy: may the Lord hate you and all your kind, may you be turned orange in hue, and may your head fall off at an awkward moment."
"Linux is like a wigwam - no windows, no gates, apache inside..."
Back to top
View user's profile Send private message
Kollin
Veteran
Veteran


Joined: 25 Feb 2006
Posts: 1099
Location: Sofia/Bulgaria

PostPosted: Sat Feb 11, 2012 11:09 pm    Post subject: Reply with quote

I found a udev rules (in git.kernel.org) that can create '/dev/by-partuuid/' devices. That can be used for the 10_linux script to create 'root=PARTUUID= ' reference in grub.cfg instead UUID one.
Those udev rules work nicely.Just be sure to add them as 80-persistent-storage.rules instead of 60-persistent-storage.rules into '/etc/udev/rules.d/' and restart udev ;)

http://git.kernel.org/?p=linux/hotplug/udev.git;a=blob;f=rules/rules.d/60-persistent-storage.rules;h=b7da8b8bc22e88c4c345963aebae9d5fbb79dcdd;hb=HEAD

Sadly my Bash skills are not much better than my Swahili skills :wink:

P.S. Interesting reading : http://archives.gentoo.org/gentoo-user/msg_35eb3187ef8be8a23cdec253b66b5a59.xml
_________________
"Dear Enemy: may the Lord hate you and all your kind, may you be turned orange in hue, and may your head fall off at an awkward moment."
"Linux is like a wigwam - no windows, no gates, apache inside..."
Back to top
View user's profile Send private message
Gusar
Advocate
Advocate


Joined: 09 Apr 2005
Posts: 2643
Location: Slovenia

PostPosted: Sat Feb 11, 2012 11:38 pm    Post subject: Reply with quote

I cringe every time I see anything about grub2. This over-engineered monster of a... thing... is just... gaaaaah... :)

I'd say forget about that crap and just write grub.cfg manually. And while you're at it, drop grub2 altogether and switch to a *real* bootloader :twisted:
Back to top
View user's profile Send private message
Kollin
Veteran
Veteran


Joined: 25 Feb 2006
Posts: 1099
Location: Sofia/Bulgaria

PostPosted: Sun Feb 12, 2012 12:25 am    Post subject: Reply with quote

Gusar wrote:
I cringe every time I see anything about grub2. This over-engineered monster of a... thing... is just... gaaaaah... :)

I'd say forget about that crap and just write grub.cfg manually. And while you're at it, drop grub2 altogether and switch to a *real* bootloader :twisted:


Yeah grub2 is still rough around the edges, and there is a certain lack of KISS principle implementation ... but everything will be fine in the end ;)

P.S.An improvement suggestion bug posted: https://bugs.gentoo.org/show_bug.cgi?id=403223
_________________
"Dear Enemy: may the Lord hate you and all your kind, may you be turned orange in hue, and may your head fall off at an awkward moment."
"Linux is like a wigwam - no windows, no gates, apache inside..."
Back to top
View user's profile Send private message
vyedmic
n00b
n00b


Joined: 02 Dec 2010
Posts: 21

PostPosted: Sat Oct 19, 2013 8:20 pm    Post subject: Reply with quote

Hello,

I have tried the

Code:
root=PARTUUID=uuid


and it doesn't work for me, can you please post your config to see what stupid mistake I made?

Thanks.

EDIT: Solved, didn't get rid of --fs-uuid parameter :roll:

EDIT2: GRUB2 is cool ;)
Back to top
View user's profile Send private message
Kollin
Veteran
Veteran


Joined: 25 Feb 2006
Posts: 1099
Location: Sofia/Bulgaria

PostPosted: Sun Oct 20, 2013 9:57 am    Post subject: Reply with quote

vyedmic wrote:
Hello,

I have tried the

Code:
root=PARTUUID=uuid


and it doesn't work for me, can you please post your config to see what stupid mistake I made?

Thanks.

EDIT: Solved, didn't get rid of --fs-uuid parameter :roll:

EDIT2: GRUB2 is cool ;)



Here is my working config, as you can see --fs-uuid parameter is still there :

Code:
#
# 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
set default="0"

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,gpt2'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2 --hint='hd0,gpt2'  06feed9a-d367-4fec-84ab-f567d824a600
else
  search --no-floppy --fs-uuid --set=root 06feed9a-d367-4fec-84ab-f567d824a600
fi
    font="/usr/share/grub/unicode.pf2"
fi

if loadfont $font ; then
  set gfxmode=1280x1024
  load_video
  insmod gfxterm
  set locale_dir=$prefix/locale
  set lang=en_GB
  insmod gettext
fi
terminal_output gfxterm
insmod part_gpt
insmod ext2
set root='hd0,gpt1'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1 --hint='hd0,gpt1'  644f54be-f7eb-4b9e-af9a-d206fe9ec964
else
  search --no-floppy --fs-uuid --set=root 644f54be-f7eb-4b9e-af9a-d206fe9ec964
fi
insmod png
background_image -m stretch /grub2/01356_crepuscule_1600x1200.png
if sleep --interruptible 0 ; then
  set timeout=10
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/10_linux ###
menuentry 'GNU/Linux' --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-06feed9a-d367-4fec-84ab-f567d824a600' {
   load_video
   insmod gzio
   insmod part_gpt
   insmod ext2
   set root='hd0,gpt1'
   if [ x$feature_platform_search_hint = xy ]; then
     search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1 --hint='hd0,gpt1'  644f54be-f7eb-4b9e-af9a-d206fe9ec964
   else
     search --no-floppy --fs-uuid --set=root 644f54be-f7eb-4b9e-af9a-d206fe9ec964
   fi
   echo   'Loading Linux 3.9.1-gentoo-r1 ...'
   linux   /vmlinuz-3.9.1-gentoo-r1 root=PARTUUID=CA311C5D-C0FE-4DA9-8F33-429893307C89 ro rootfstype=ext4 video=uvesafb:1280x1024-32@75,ywrap,mtrr:3
}
submenu 'Advanced options for GNU/Linux' $menuentry_id_option 'gnulinux-advanced-06feed9a-d367-4fec-84ab-f567d824a600' {
   menuentry 'GNU/Linux, with Linux 3.9.1-gentoo-r1' --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.9.1-gentoo-r1-advanced-06feed9a-d367-4fec-84ab-f567d824a600' {
      load_video
      insmod gzio
      insmod part_gpt
      insmod ext2
      set root='hd0,gpt1'
      if [ x$feature_platform_search_hint = xy ]; then
        search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1 --hint='hd0,gpt1'  644f54be-f7eb-4b9e-af9a-d206fe9ec964
      else
        search --no-floppy --fs-uuid --set=root 644f54be-f7eb-4b9e-af9a-d206fe9ec964
      fi
      echo   'Loading Linux 3.9.1-gentoo-r1 ...'
      linux   /vmlinuz-3.9.1-gentoo-r1 root=PARTUUID=CA311C5D-C0FE-4DA9-8F33-429893307C89 ro rootfstype=ext4 video=uvesafb:1280x1024-32@75,ywrap,mtrr:3
   }
   menuentry 'GNU/Linux, with Linux 3.3.8-gentoo' --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.3.8-gentoo-advanced-06feed9a-d367-4fec-84ab-f567d824a600' {
      load_video
      insmod gzio
      insmod part_gpt
      insmod ext2
      set root='hd0,gpt1'
      if [ x$feature_platform_search_hint = xy ]; then
        search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1 --hint='hd0,gpt1'  644f54be-f7eb-4b9e-af9a-d206fe9ec964
      else
        search --no-floppy --fs-uuid --set=root 644f54be-f7eb-4b9e-af9a-d206fe9ec964
      fi
      echo   'Loading Linux 3.3.8-gentoo ...'
      linux   /vmlinuz-3.3.8-gentoo root=UUID=06feed9a-d367-4fec-84ab-f567d824a600 ro rootfstype=ext4 video=uvesafb:1280x1024-32@75,ywrap,mtrr:3
   }
   menuentry 'GNU/Linux, with Linux 3.3.8-gentoo.old' --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.3.8-gentoo.old-advanced-06feed9a-d367-4fec-84ab-f567d824a600' {
      load_video
      insmod gzio
      insmod part_gpt
      insmod ext2
      set root='hd0,gpt1'
      if [ x$feature_platform_search_hint = xy ]; then
        search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1 --hint='hd0,gpt1'  644f54be-f7eb-4b9e-af9a-d206fe9ec964
      else
        search --no-floppy --fs-uuid --set=root 644f54be-f7eb-4b9e-af9a-d206fe9ec964
      fi
      echo   'Loading Linux 3.3.8-gentoo.old ...'
      linux   /vmlinuz-3.3.8-gentoo.old root=UUID=06feed9a-d367-4fec-84ab-f567d824a600 ro rootfstype=ext4 video=uvesafb:1280x1024-32@75,ywrap,mtrr:3
   }
   menuentry 'GNU/Linux, with Linux 3.1.10-gentoo-r1' --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.1.10-gentoo-r1-advanced-06feed9a-d367-4fec-84ab-f567d824a600' {
      load_video
      insmod gzio
      insmod part_gpt
      insmod ext2
      set root='hd0,gpt1'
      if [ x$feature_platform_search_hint = xy ]; then
        search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1 --hint='hd0,gpt1'  644f54be-f7eb-4b9e-af9a-d206fe9ec964
      else
        search --no-floppy --fs-uuid --set=root 644f54be-f7eb-4b9e-af9a-d206fe9ec964
      fi
      echo   'Loading Linux 3.1.10-gentoo-r1 ...'
      linux   /vmlinuz-3.1.10-gentoo-r1 root=UUID=06feed9a-d367-4fec-84ab-f567d824a600 ro rootfstype=ext4 video=uvesafb:1280x1024-32@75,ywrap,mtrr:3
   }
   menuentry 'GNU/Linux, with Linux 3.1.10-gentoo-r1.old' --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.1.10-gentoo-r1.old-advanced-06feed9a-d367-4fec-84ab-f567d824a600' {
      load_video
      insmod gzio
      insmod part_gpt
      insmod ext2
      set root='hd0,gpt1'
      if [ x$feature_platform_search_hint = xy ]; then
        search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1 --hint='hd0,gpt1'  644f54be-f7eb-4b9e-af9a-d206fe9ec964
      else
        search --no-floppy --fs-uuid --set=root 644f54be-f7eb-4b9e-af9a-d206fe9ec964
      fi
      echo   'Loading Linux 3.1.10-gentoo-r1.old ...'
      linux   /vmlinuz-3.1.10-gentoo-r1.old root=UUID=06feed9a-d367-4fec-84ab-f567d824a600 ro rootfstype=ext4 video=uvesafb:1280x1024-32@75,ywrap,mtrr:3
   }
}

### 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/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 ###

_________________
"Dear Enemy: may the Lord hate you and all your kind, may you be turned orange in hue, and may your head fall off at an awkward moment."
"Linux is like a wigwam - no windows, no gates, apache inside..."
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things 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