From: Adam Carter <adamcarter3@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 20:58:31 +1000 [thread overview]
Message-ID: <CAC=wYCG3DC7y+2XXprL9tzdZFkfO0ABa_qAVL07STwwqmyFeAQ@mail.gmail.com> (raw)
In-Reply-To: <6685853.amHapi50jO@localhost>
[-- Attachment #1: Type: text/plain, Size: 1875 bytes --]
On Fri, Jul 19, 2019 at 8:27 PM Mick <michaelkintzios@gmail.com> wrote:
> 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:
I experimented found the following worked in /etc/default/grub;
GRUB_DEVICE="PARTUUID=d3554d49-02"
Which writes grub.cfg as;
linux /vmlinuz-5.2.0-gentoo root=PARTUUID=d3554d49-02 ro
init=/usr/lib/systemd/systemd iommu=pt raid=noautodetect
PARTUUID looked up with blkid. No initramfs required :)
[-- Attachment #2: Type: text/html, Size: 2640 bytes --]
next prev parent reply other threads:[~2019-07-19 10:58 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
2019-07-19 10:58 ` Adam Carter [this message]
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='CAC=wYCG3DC7y+2XXprL9tzdZFkfO0ABa_qAVL07STwwqmyFeAQ@mail.gmail.com' \
--to=adamcarter3@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