Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Why doesn't Gentoo use UUID=... in fstab? -- Solved
View unanswered posts
View posts from last 24 hours

Goto page 1, 2  Next  
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
1clue
Advocate
Advocate


Joined: 05 Feb 2006
Posts: 2569

PostPosted: Fri Apr 18, 2014 4:33 pm    Post subject: Why doesn't Gentoo use UUID=... in fstab? -- Solved Reply with quote

I guess the title says it all.

I just installed Gentoo after a long time of no actual installs, and while some things changed others have not.

I've often had trouble when adding or removing a disk, the existing disks are numbered differently when I boot again, causing boot failure.

I see grub2 evidently went to UUIDs but /etc/fstab does not. My other Gentoo box has UUIDs for fstab but if I remember correctly I changed them over.

So I guess the reason for the post is, why not? Is there something I don't know which increases risk when you use UUIDs?

Thanks.


Last edited by 1clue on Fri Apr 18, 2014 8:17 pm; edited 1 time in total
Back to top
View user's profile Send private message
Anon-E-moose
Watchman
Watchman


Joined: 23 May 2008
Posts: 6095
Location: Dallas area

PostPosted: Fri Apr 18, 2014 5:11 pm    Post subject: Reply with quote

From "man fstab"

Code:
The first field (fs_spec).
              This field describes the block special device or remote filesystem to be mounted.

              For  ordinary  mounts it will hold (a link to) a block special device node (as created by mknod(8)) for
              the device to be mounted, like `/dev/cdrom' or `/dev/sdb7'.  For NFS mounts one will have <host>:<dir>,
              e.g., `knuth.aeb.nl:/'.  For procfs, use `proc'.

              Instead  of  giving the device explicitly, one may indicate the filesystem that is to be mounted by its
              UUID  or  LABEL  (cf.   e2label(8)  or  xfs_admin(8)),  writing  LABEL=<label>  or  UUID=<uuid>,  e.g.,
              `LABEL=Boot' or `UUID=3e6be9de-8139-11d1-9106-a43f08d823a6'.

              It's also possible to use PARTUUID= and PARTLABEL=. These partitions identifiers are supported for GUID
              Partition Table (GPT) and MAC partition table only.

              See blkid(8) or lsblk(8) for more details about devices identifiers.


I've gone to using LABELS in fstab
but as I've quoted you could just as easily use UUID.
It's just not done automatically.
_________________
PRIME x570-pro, 3700x, 6.1 zen kernel
gcc 13, profile 17.0 (custom bare multilib), openrc, wayland
Back to top
View user's profile Send private message
1clue
Advocate
Advocate


Joined: 05 Feb 2006
Posts: 2569

PostPosted: Fri Apr 18, 2014 5:29 pm    Post subject: Reply with quote

Yes, I've been using UUID for quite some time, I'm just wondering if there's a real reason why Gentoo doesn't do so automatically.

I don't use labels because I use VMs and LVM and don't want any confusion.

Thanks.
Back to top
View user's profile Send private message
Voltago
Advocate
Advocate


Joined: 02 Sep 2003
Posts: 2593
Location: userland

PostPosted: Fri Apr 18, 2014 5:55 pm    Post subject: Reply with quote

Perhaps using UUIDs is best if you're also using logical volumes, but if you're content with a classical, static partition layout, it just doesn't seem necessary.
Back to top
View user's profile Send private message
Anon-E-moose
Watchman
Watchman


Joined: 23 May 2008
Posts: 6095
Location: Dallas area

PostPosted: Fri Apr 18, 2014 5:57 pm    Post subject: Reply with quote

As far as why not automatically, I don't know.

But I haven't installed from scratch in a long time so I don't know what's available nowadays.
_________________
PRIME x570-pro, 3700x, 6.1 zen kernel
gcc 13, profile 17.0 (custom bare multilib), openrc, wayland
Back to top
View user's profile Send private message
gotyaoi
Tux's lil' helper
Tux's lil' helper


Joined: 01 Apr 2013
Posts: 137

PostPosted: Fri Apr 18, 2014 7:48 pm    Post subject: Reply with quote

If you mean the one present in the stage3, the handbook says something like this:
Quote:
Important: The default /etc/fstab file provided by Gentoo is not a valid fstab file. You have to create your own /etc/fstab.

And then gives some examples, but I think the assumption is that you can write it however you want.

https://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=1&chap=8
Back to top
View user's profile Send private message
1clue
Advocate
Advocate


Joined: 05 Feb 2006
Posts: 2569

PostPosted: Fri Apr 18, 2014 8:16 pm    Post subject: Reply with quote

OK that answers my question I guess.

I haven't installed from scratch on Gentoo in more than a year. I guess I figured that since I had UUID-based fstab on my old box that it was there automatically, don't know why.

To me it doesn't make much sense to use anything but UUID, but I guess thinking about simple setups, the current way probably works as well as anything.

Thanks.
Back to top
View user's profile Send private message
saellaven
l33t
l33t


Joined: 23 Jul 2006
Posts: 646

PostPosted: Fri Apr 18, 2014 8:21 pm    Post subject: Reply with quote

Last I knew, and FWIW, I haven't looked into this in a while, the Linux kernel doesn't speak UUID... so be forewarned to not try to mount root with a UUID (or label for that matter).

Mounting by UUID/label requires mount, libblkid.so and libuuid.so, so you may need an initramfs/initrd to have root mounted by either. Also, if for some reason, those tools aren't available when you go to mount partitions* then you will not be able to bring up any filesystems referenced by them.


* they are all from sys-apps/util-linux and currently stored in /bin and /lib, but per the Council's decision to stop supporting a separate /usr, the maintainer(s) of util-linux are now free to install them anywhere they desire on a whim, even if it means breaking existing systems
Back to top
View user's profile Send private message
1clue
Advocate
Advocate


Joined: 05 Feb 2006
Posts: 2569

PostPosted: Fri Apr 18, 2014 11:15 pm    Post subject: Reply with quote

I've been using UUID on everything for a few years now. Including root. I'm not sure if it matters if the kernel understands UUID, but grub2 does so IMO that's all that matters.
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 7470

PostPosted: Sat Apr 19, 2014 1:14 am    Post subject: Reply with quote

1clue wrote:

To me it doesn't make much sense to use anything but UUID, but I guess thinking about simple setups, the current way probably works as well as anything.

There's never one case 1clue...

It make sense to not using UUID to mount a disk to a specific place, but using label instead.
Per example, using any disks, as long as its label is EXTERNAL and mount always at /mnt/EXTERNAL via label, allowing someone to have multi disks (so multi UUID) but always connecting one of them only, but whatever disk is connected, its mount point will remain the same.
Back to top
View user's profile Send private message
Anon-E-moose
Watchman
Watchman


Joined: 23 May 2008
Posts: 6095
Location: Dallas area

PostPosted: Sat Apr 19, 2014 10:35 am    Post subject: Reply with quote

I set up my usb flash drives with the same label so that I always have the same user allowed mount point.

As Krinn says every case is different.
_________________
PRIME x570-pro, 3700x, 6.1 zen kernel
gcc 13, profile 17.0 (custom bare multilib), openrc, wayland
Back to top
View user's profile Send private message
mv
Watchman
Watchman


Joined: 20 Apr 2005
Posts: 6747

PostPosted: Sat Apr 19, 2014 12:14 pm    Post subject: Reply with quote

1clue wrote:
I've been using UUID on everything for a few years now. Including root. I'm not sure if it matters if the kernel understands UUID, but grub2 does so IMO that's all that matters.

I think you misunderstand something: The UUIDs in grub2 only help you to start the kernel from the correct partition. Then the control is passed to the kernel, and it depends on the kenerl alone what he chooses as /dev/root (that is, from which partition to read the init-files and later /etc/fstab). If you use an initrd, this can be setup in the initrd, but otherwise you are not able to use UUID at this step - grub2 cannot help you here anymore, because it is already finished.
Fortunately, new kernel versions know PARTUUID=... even on dos partition tables as I learnt recently. However, PARTUUID is a different thing than UUID; for instance, in case of dos partition tables, it would change if you add a partition in front of your root partition.
Back to top
View user's profile Send private message
1clue
Advocate
Advocate


Joined: 05 Feb 2006
Posts: 2569

PostPosted: Sat Apr 19, 2014 7:05 pm    Post subject: Reply with quote

@mv,

If what you're saying is true, then my system can't boot right now. Which is false.

/etc/fstab:
Code:

UUID=93d12727-ec84-4e05-98a8-5a8f3f1fd8a4   /boot         ext2   noauto,noatime   1 2   #/dev/sda2
UUID=85a849ee-f20a-4f76-b790-e6217f6deb91   /         ext3   noatime      0 1   #/dev/sda3
UUID=5c94e0ad-bba1-48c6-a0fe-cc0103e21acb   none         swap   sw      0 0
/dev/cdrom               /mnt/cdrom      auto   noauto,ro   0 0
tmpfs                            /var/tmp/portage   tmpfs   auto      0 0


blkid:
Code:

/dev/sda2: UUID="93d12727-ec84-4e05-98a8-5a8f3f1fd8a4" TYPE="ext2" PARTLABEL="/boot" PARTUUID="c6a94411-dea4-43e6-aa8a-a62626b4d53d"
/dev/sda3: UUID="85a849ee-f20a-4f76-b790-e6217f6deb91" TYPE="ext4" PARTLABEL="/" PARTUUID="d8ad9cca-5d1b-4985-8c00-2f3082179e17"
/dev/sda4: UUID="BYUpjw-iQ7V-32Y6-0TQd-RBTl-zlF9-ammBCk" TYPE="LVM2_member" PARTLABEL="Linux LVM" PARTUUID="97f61253-cc4c-4ac9-8419-272226c83870"
/dev/sda1: PARTLABEL="bios" PARTUUID="e2cfb363-18cb-46b5-97e6-180b70ddad4b"
/dev/mapper/hddvg1-host_swap: UUID="5c94e0ad-bba1-48c6-a0fe-cc0103e21acb" TYPE="swap"


And frankly I have a couple dozen Ubuntu Server 12.04 setups on VMs all over the place that have been doing this for at least a couple years now, although for all I know they have an initrd.
Back to top
View user's profile Send private message
py-ro
Veteran
Veteran


Joined: 24 Sep 2002
Posts: 1734
Location: Velbert

PostPosted: Sat Apr 19, 2014 8:09 pm    Post subject: Reply with quote

1clue wrote:
@mv,
And frankly I have a couple dozen Ubuntu Server 12.04 setups on VMs all over the place that have been doing this for at least a couple years now, although for all I know they have an initrd.


That is the point, root=UUID only works with initrd.
Back to top
View user's profile Send private message
1clue
Advocate
Advocate


Joined: 05 Feb 2006
Posts: 2569

PostPosted: Sun Apr 20, 2014 12:49 am    Post subject: Reply with quote

py-ro wrote:
1clue wrote:
@mv,
And frankly I have a couple dozen Ubuntu Server 12.04 setups on VMs all over the place that have been doing this for at least a couple years now, although for all I know they have an initrd.


That is the point, root=UUID only works with initrd.


And I'm saying that's false. My previous Gentoo which has been updated for a long time has no initrd, and neither does the install I just finished. The one I just finished has its fstab and blkid results posted above. Both systems boot fine with everything UUID and NO initrd. The Ubuntu junk I have no idea, I just use those for quick and dirty VMs where I don't really care.
Back to top
View user's profile Send private message
jathlon
Tux's lil' helper
Tux's lil' helper


Joined: 26 Sep 2006
Posts: 89
Location: Canada

PostPosted: Sun Apr 20, 2014 4:44 am    Post subject: Reply with quote

1clue wrote:
And I'm saying that's false. My previous Gentoo which has been updated for a long time has no initrd, and neither does the install I just finished. The one I just finished has its fstab and blkid results posted above. Both systems boot fine with everything UUID and NO initrd. The Ubuntu junk I have no idea, I just use those for quick and dirty VMs where I don't really care.


Could we see your grub(2).conf?
Back to top
View user's profile Send private message
py-ro
Veteran
Veteran


Joined: 24 Sep 2002
Posts: 1734
Location: Velbert

PostPosted: Sun Apr 20, 2014 11:11 am    Post subject: Reply with quote

@1clue

There is simply no code to handle this.

My 1st guess would be grub-mkconfig setting it automagic for you.

From the parsing code in init/do_mounts.c:

Code:

/*
 *      Convert a name into device number.  We accept the following variants:
 *
 *      1) device number in hexadecimal represents itself
 *      2) /dev/nfs represents Root_NFS (0xff)
 *      3) /dev/<disk_name> represents the device number of disk
 *      4) /dev/<disk_name><decimal> represents the device number
 *         of partition - device number of disk plus the partition number
 *      5) /dev/<disk_name>p<decimal> - same as the above, that form is
 *         used when disk name of partitioned disk ends on a digit.
 *      6) PARTUUID=00112233-4455-6677-8899-AABBCCDDEEFF representing the
 *         unique id of a partition if the partition table provides it.
 *         The UUID may be either an EFI/GPT UUID, or refer to an MSDOS
 *         partition using the format SSSSSSSS-PP, where SSSSSSSS is a zero-
 *         filled hex representation of the 32-bit "NT disk signature", and PP
 *         is a zero-filled hex representation of the 1-based partition number.
 *      7) PARTUUID=<UUID>/PARTNROFF=<int> to select a partition in relation to
 *         a partition with a known unique id.
 *      8) <major>:<minor> major and minor number of the device separated by
 *         a colon.
 *
 *      If name doesn't have fall into the categories above, we return (0,0).
 *      block_class is used to check if something is a disk name. If the disk
 *      name contains slashes, the device name has them replaced with
 *      bangs.
 */


Then look at the following Lines, there is no UUID Case.
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 7470

PostPosted: Sun Apr 20, 2014 11:41 am    Post subject: Reply with quote

Without knowing answer, that seems to contradict you py-ro :)

py-ro wrote:

Code:

 *      6) PARTUUID=00112233-4455-6677-8899-AABBCCDDEEFF representing the
 *         unique id of a partition if the partition table provides it.
 *         The UUID may be either an EFI/GPT UUID, or refer to an MSDOS
 *         partition using the format SSSSSSSS-PP

Back to top
View user's profile Send private message
py-ro
Veteran
Veteran


Joined: 24 Sep 2002
Posts: 1734
Location: Velbert

PostPosted: Sun Apr 20, 2014 11:55 am    Post subject: Reply with quote

@krinn PARTUUID =! UUID

UUID is meant to be inside the Filesystem, while PARTUUID is inside Partitiontable.
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 7470

PostPosted: Sun Apr 20, 2014 12:05 pm    Post subject: Reply with quote

I think i got that right py-ro (the diff with PARTUUID and UUID the EFI/GPT part)

But (even more shorten answer then) :
Code:

*      6) PARTUUID=00112233-4455-6677-8899-AABBCCDDEEFF representing the
...The UUID may be either an EFI/GPT UUID...

So it seems it allow EFI/GPT to be use thru PARTUUID as well.
Back to top
View user's profile Send private message
py-ro
Veteran
Veteran


Joined: 24 Sep 2002
Posts: 1734
Location: Velbert

PostPosted: Sun Apr 20, 2014 12:16 pm    Post subject: Reply with quote

That is the Partition one. GPT = GUID Partition Table, the one which won't work is the Filesystem one. Theye are booth UUIDs. Later one is adressed by root=UUID=xxx, the 1st one by root=PARTUUID=xxx.

root=UUID needs a Ramdisk, root=PARTUUID not.
Back to top
View user's profile Send private message
1clue
Advocate
Advocate


Joined: 05 Feb 2006
Posts: 2569

PostPosted: Mon Apr 21, 2014 3:55 am    Post subject: Reply with quote

I'm really curious about this, because I skipped the initrd part of the handbook, and FWIW I would be a little put off if one somehow got installed without my knowing it.

And if you'll look at my blkid and fstab entries above, I'm using UUID not PARTUUID.


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
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 loadfont unicode ; then
  set gfxmode=1920x1080
  load_video
  insmod gfxterm
  set locale_dir=$prefix/locale
  set lang=en_US
  insmod gettext
fi
terminal_output gfxterm
if sleep --interruptible 0 ; then
  set timeout=10
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-85a849ee-f20a-4f76-b790-e6217f6deb91' {
   load_video
   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-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2  93d12727-ec84-4e05-98a8-5a8f3f1fd8a4
   else
     search --no-floppy --fs-uuid --set=root 93d12727-ec84-4e05-98a8-5a8f3f1fd8a4
   fi
   echo   'Loading Linux 3.13.6-hardened-r3-kr1 ...'
   linux   /kernel-3.13.6-hardened-r3-kr1 root=/dev/sda3 ro 
}
submenu 'Advanced options for Gentoo GNU/Linux' $menuentry_id_option 'gnulinux-advanced-85a849ee-f20a-4f76-b790-e6217f6deb91' {
   menuentry 'Gentoo GNU/Linux, with Linux 3.13.6-hardened-r3-kr1' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.13.6-hardened-r3-kr1-advanced-85a849ee-f20a-4f76-b790-e6217f6deb91' {
      load_video
      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-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2  93d12727-ec84-4e05-98a8-5a8f3f1fd8a4
      else
        search --no-floppy --fs-uuid --set=root 93d12727-ec84-4e05-98a8-5a8f3f1fd8a4
      fi
      echo   'Loading Linux 3.13.6-hardened-r3-kr1 ...'
      linux   /kernel-3.13.6-hardened-r3-kr1 root=/dev/sda3 ro 
   }
   menuentry 'Gentoo GNU/Linux, with Linux 3.13.6-hardened-r3-kr1 (recovery mode)' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.13.6-hardened-r3-kr1-recovery-85a849ee-f20a-4f76-b790-e6217f6deb91' {
      load_video
      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-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2  93d12727-ec84-4e05-98a8-5a8f3f1fd8a4
      else
        search --no-floppy --fs-uuid --set=root 93d12727-ec84-4e05-98a8-5a8f3f1fd8a4
      fi
      echo   'Loading Linux 3.13.6-hardened-r3-kr1 ...'
      linux   /kernel-3.13.6-hardened-r3-kr1 root=/dev/sda3 ro single
   }
   menuentry 'Gentoo GNU/Linux, with Linux 3.12.13-gentoo-kr3' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.12.13-gentoo-kr3-advanced-85a849ee-f20a-4f76-b790-e6217f6deb91' {
      load_video
      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-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2  93d12727-ec84-4e05-98a8-5a8f3f1fd8a4
      else
        search --no-floppy --fs-uuid --set=root 93d12727-ec84-4e05-98a8-5a8f3f1fd8a4
      fi
      echo   'Loading Linux 3.12.13-gentoo-kr3 ...'
      linux   /kernel-3.12.13-gentoo-kr3 root=/dev/sda3 ro 
   }
   menuentry 'Gentoo GNU/Linux, with Linux 3.12.13-gentoo-kr3 (recovery mode)' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.12.13-gentoo-kr3-recovery-85a849ee-f20a-4f76-b790-e6217f6deb91' {
      load_video
      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-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2  93d12727-ec84-4e05-98a8-5a8f3f1fd8a4
      else
        search --no-floppy --fs-uuid --set=root 93d12727-ec84-4e05-98a8-5a8f3f1fd8a4
      fi
      echo   'Loading Linux 3.12.13-gentoo-kr3 ...'
      linux   /kernel-3.12.13-gentoo-kr3 root=/dev/sda3 ro single
   }
   menuentry 'Gentoo GNU/Linux, with Linux 3.12.13-gentoo-kr2' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.12.13-gentoo-kr2-advanced-85a849ee-f20a-4f76-b790-e6217f6deb91' {
      load_video
      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-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2  93d12727-ec84-4e05-98a8-5a8f3f1fd8a4
      else
        search --no-floppy --fs-uuid --set=root 93d12727-ec84-4e05-98a8-5a8f3f1fd8a4
      fi
      echo   'Loading Linux 3.12.13-gentoo-kr2 ...'
      linux   /kernel-3.12.13-gentoo-kr2 root=/dev/sda3 ro 
   }
   menuentry 'Gentoo GNU/Linux, with Linux 3.12.13-gentoo-kr2 (recovery mode)' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.12.13-gentoo-kr2-recovery-85a849ee-f20a-4f76-b790-e6217f6deb91' {
      load_video
      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-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2  93d12727-ec84-4e05-98a8-5a8f3f1fd8a4
      else
        search --no-floppy --fs-uuid --set=root 93d12727-ec84-4e05-98a8-5a8f3f1fd8a4
      fi
      echo   'Loading Linux 3.12.13-gentoo-kr2 ...'
      linux   /kernel-3.12.13-gentoo-kr2 root=/dev/sda3 ro single
   }
   menuentry 'Gentoo GNU/Linux, with Linux 3.12.13-gentoo' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.12.13-gentoo-advanced-85a849ee-f20a-4f76-b790-e6217f6deb91' {
      load_video
      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-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2  93d12727-ec84-4e05-98a8-5a8f3f1fd8a4
      else
        search --no-floppy --fs-uuid --set=root 93d12727-ec84-4e05-98a8-5a8f3f1fd8a4
      fi
      echo   'Loading Linux 3.12.13-gentoo ...'
      linux   /kernel-3.12.13-gentoo root=/dev/sda3 ro 
   }
   menuentry 'Gentoo GNU/Linux, with Linux 3.12.13-gentoo (recovery mode)' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.12.13-gentoo-recovery-85a849ee-f20a-4f76-b790-e6217f6deb91' {
      load_video
      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-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2  93d12727-ec84-4e05-98a8-5a8f3f1fd8a4
      else
        search --no-floppy --fs-uuid --set=root 93d12727-ec84-4e05-98a8-5a8f3f1fd8a4
      fi
      echo   'Loading Linux 3.12.13-gentoo ...'
      linux   /kernel-3.12.13-gentoo root=/dev/sda3 ro single
   }
}

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


Joined: 23 Jul 2006
Posts: 646

PostPosted: Mon Apr 21, 2014 4:27 am    Post subject: Reply with quote

I use LILO and it's been years since I bothered to even mess with grub (it was grub 1 and I didn't like it), so I don't know the grub2.conf syntax all that well...

But I'm guessing these are your actual kernel loading lines:

linux /kernel-3.13.6-hardened-r3-kr1 root=/dev/sda3 ro
linux /kernel-3.13.6-hardened-r3-kr1 root=/dev/sda3 ro
linux /kernel-3.13.6-hardened-r3-kr1 root=/dev/sda3 ro single
linux /kernel-3.12.13-gentoo-kr3 root=/dev/sda3 ro
linux /kernel-3.12.13-gentoo-kr3 root=/dev/sda3 ro single

etc

You'll note that the kernel isn't using your UUID, but /dev/sda3 (which I'm guesing is 93d12727-ec84-4e05-98a8-5a8f3f1fd8a4 and the third partition of your first hard drive (both by the sda3 and the hd0,gpt2)). So, it looks like grub is using the UUID for itself as a sanity check, but is passing the kernel /dev/sda3 as the root.
Back to top
View user's profile Send private message
mv
Watchman
Watchman


Joined: 20 Apr 2005
Posts: 6747

PostPosted: Mon Apr 21, 2014 7:40 am    Post subject: Reply with quote

saellaven wrote:
So, it looks like grub is using the UUID for itself as a sanity check, but is passing the kernel /dev/sda3 as the root.

Your analysis is correct. In particular, if there is some hardware attached which causes /dev/sda* to become e.g. /dev/sdb* with your kernel then grub would still boot the kernel from the correct partition, but the kernel would panic, claiming that it cannot find the root partition. (This happens long before /etc/fstab is read.)
Back to top
View user's profile Send private message
1clue
Advocate
Advocate


Joined: 05 Feb 2006
Posts: 2569

PostPosted: Mon Apr 21, 2014 3:19 pm    Post subject: Reply with quote

OK so let me pose this question:

How do I set things up so that no matter what happens regarding new hardware, all the partitions are attached in the proper order?

I thought that UUID was supposed to solve it.
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
Goto page 1, 2  Next
Page 1 of 2

 
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