public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
From: Mick <michaelkintzios@gmail.com>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] Using UUID for root disk in grub requires initramfs?
Date: Fri, 19 Jul 2019 11:27:19 +0100	[thread overview]
Message-ID: <6685853.amHapi50jO@localhost> (raw)
In-Reply-To: <CAC=wYCGVykRxQAfLO-tTMByebMy3cyxuK6n7z5qr1QTucGzK0w@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1680 bytes --]

On Friday, 19 July 2019 10:29:09 BST Adam Carter wrote:
> This
> https://wiki.gentoo.org/wiki/GRUB2/Configuration_variables
> 
> has
> 
> GRUB_DISABLE_LINUX_UUID false If true, ${GRUB_DEVICE} is passed in the root
> parameter on the kernel command line.
> 
> If false, ${GRUB_DEVICE_UUID} is passed in the root parameter on the kernel
> command line when an initramfs is available.
> 
> So it looks like i can't set root= to a UUID unless i use an initramfs -
> can anyone confirm?

This would be correct if GRUB (with/out initramfs) happened to be the only way 
to configure Linux.  Thankfully we have more choices, in Gentoo at least.  ;-)


> In /usr/src/linux/admin-guide/kernel-parameters.txt it has;
> root=           [KNL] Root filesystem
>                         See name_to_dev_t comment in init/do_mounts.c.
> 
> And in do_mounts.c it mentions PARTUUID= and PARTLABEL= but i dont know C
> so don't know what to make of it.
> 
> Background is that after adding a new disk the system doesn't boot, so i'm
> assuming that the /dev/sdX device names are now pointing to different
> hardware, so i want to fix that by using persistent names.

You could use UUID, or partition label (if GPT is used on the disk), but by-
pass GRUB's facility to configure the UUID and use the kernel .config itself.  
For this you will have to configure and compile your own kernel.  Use this 
kernel option to specify kernel command line options:

Processor type and features -->
...

 [*] Built-in kernel command line
     (root=PARTUUID=XXXXXXXXXXXXXXXXXXXXXXXXX other_options_here)

As long as you use 'make oldconfig' for subsequent kernels the UUID will be 
retained.

-- 
Regards,

Mick

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2019-07-19 10:27 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-19  9:29 [gentoo-user] Using UUID for root disk in grub requires initramfs? Adam Carter
2019-07-19 10:27 ` Mick [this message]
2019-07-19 10:58   ` Adam Carter
2019-07-19 16:37     ` [gentoo-user] " Ian Zimmerman
2019-07-19 16:59       ` Mike Gilbert
2019-07-19 23:19       ` Adam Carter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6685853.amHapi50jO@localhost \
    --to=michaelkintzios@gmail.com \
    --cc=gentoo-user@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox