From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 033EC138334 for ; Fri, 19 Jul 2019 10:58:53 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 13C46E0825; Fri, 19 Jul 2019 10:58:44 +0000 (UTC) Received: from mail-oi1-x22a.google.com (mail-oi1-x22a.google.com [IPv6:2607:f8b0:4864:20::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id AFEF2E041F for ; Fri, 19 Jul 2019 10:58:43 +0000 (UTC) Received: by mail-oi1-x22a.google.com with SMTP id t76so23976121oih.4 for ; Fri, 19 Jul 2019 03:58:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=Gum6AU1LBEg+nwWQGOSVIHRrMqSxJu8d+IhJaxZnMt0=; b=r+UBUYDDCwr3pNabyUsNVDsk9bk/OL6xMfx+CfwczYikH3Nk8Ab/K67c0ZLfZe5zrh vpx8yBUNIIz1gMKnQER9wPshxC8gi39D1uUKS/dMhETU9bFhbM70KcBOUW4izVwXGXhq lqurAMBihoumDKtKaqKVJwaxYvRJp7EqQ0cCnXahGtVD/4tyNqNNLIUCygS5G/UfqQ6w Cjqx6b5Ukvs7cXQHZYYxjv0DwS4yW6i10umoWO5y3QtsejvuW3V3u1mPFWevinP1NAua NPe/LOrOKG6tVHyCS0cXfI2i98JoQrv9JLqbwjlPxSI6seGrv16POgXK6Mtu4/6TfZ4v 3jzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=Gum6AU1LBEg+nwWQGOSVIHRrMqSxJu8d+IhJaxZnMt0=; b=XxXi0yYfOZmUz7f0cLv1ZndB0GSaNjYKcznUwuKkvHDY6RbF4Zg7EsTJ83D/Q5gnZB syU+Rt89pKhhtLTUhBH05CTxrsXIgKBfW7HzE8EbIsHm8pcfeSh0ilIZAvxTdffe9YXj qkgctnzepd1I1n1cDAW4Y23Jx0oLsK1w8upXoYNJeD9Nj0L5zb/HjfCdLw9SukwzTjZ4 gTqVWYx5BiQiSUu9Zy4Y268U2snz88sBK86IHrN6Vg8E+5l7JS6lFtnU8tZPrNQ3R1wj dSNQkpbSDT6uz0u99aJ0cxnN2Sjnbtl5PN+ug2/Mmk87c0AW/VfiRa5DV2Evy0Fak96w bzIQ== X-Gm-Message-State: APjAAAXmnxI6imFhNDYkevagoJzuzM/GQq6DImg000k4tCt8ba3UZ5Mw 3aE9j6YQHd50w5jdOdJh6irrDYlSvCeBA/jG0QIowPaW X-Google-Smtp-Source: APXvYqw6Otb5KHRlntjJHHY4FKDtuJBPSdqBXmsoNujzuGkszt2SDES7xB3v0/iMMw8UgdBGOxUKqoe021A1Cla7Pmo= X-Received: by 2002:a54:4f1b:: with SMTP id e27mr2296200oiy.171.1563533922488; Fri, 19 Jul 2019 03:58:42 -0700 (PDT) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 References: <6685853.amHapi50jO@localhost> In-Reply-To: <6685853.amHapi50jO@localhost> From: Adam Carter Date: Fri, 19 Jul 2019 20:58:31 +1000 Message-ID: Subject: Re: [gentoo-user] Using UUID for root disk in grub requires initramfs? To: gentoo-user@lists.gentoo.org Content-Type: multipart/alternative; boundary="0000000000000b542b058e069c2e" X-Archives-Salt: 3ff9de4c-dbed-40f8-9fab-07dc2cae5024 X-Archives-Hash: 298205f3eac7fb8a39dae32a0402189a --0000000000000b542b058e069c2e Content-Type: text/plain; charset="UTF-8" On Fri, Jul 19, 2019 at 8:27 PM Mick 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 :) --0000000000000b542b058e069c2e Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
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/Co= nfiguration_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 k= ernel
> command line when an initramfs is available.
>
> So it looks like i can't set root=3D to a UUID unless i use an ini= tramfs -
> can anyone confirm?

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


> In /usr/src/linux/admin-guide/kernel-parameters.txt it has;
> root=3D=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0[KNL] Root filesystem<= br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0See name_to_dev_t comment in init/do_mounts.c.
>
> And in do_mounts.c it mentions PARTUUID=3D and PARTLABEL=3D 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<= br> > 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 i= tself.=C2=A0
For this you will have to configure and compile your own kernel.=C2=A0 Use = this
kernel option to specify kernel command line options:

=
I experimented found the following worked in /etc/default/grub;<= /div>

GRUB_DEVICE=3D"PARTUUID=3Dd3554d49-02"

Which writes grub.cfg as;
linux /vmli= nuz-5.2.0-gentoo root=3DPARTUUID=3Dd3554d49-02 ro init=3D/usr/lib/systemd/s= ystemd iommu=3Dpt raid=3Dnoautodetect

= PARTUUID looked up with blkid. No initramfs required :)

=

--0000000000000b542b058e069c2e--