Gentoo Archives: gentoo-user

From: Mick <michaelkintzios@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Using UUID for root disk in grub requires initramfs?
Date: Fri, 19 Jul 2019 10:27:38
Message-Id: 6685853.amHapi50jO@localhost
In Reply to: [gentoo-user] Using UUID for root disk in grub requires initramfs? by Adam Carter
1 On Friday, 19 July 2019 10:29:09 BST Adam Carter wrote:
2 > This
3 > https://wiki.gentoo.org/wiki/GRUB2/Configuration_variables
4 >
5 > has
6 >
7 > GRUB_DISABLE_LINUX_UUID false If true, ${GRUB_DEVICE} is passed in the root
8 > parameter on the kernel command line.
9 >
10 > If false, ${GRUB_DEVICE_UUID} is passed in the root parameter on the kernel
11 > command line when an initramfs is available.
12 >
13 > So it looks like i can't set root= to a UUID unless i use an initramfs -
14 > can anyone confirm?
15
16 This would be correct if GRUB (with/out initramfs) happened to be the only way
17 to configure Linux. Thankfully we have more choices, in Gentoo at least. ;-)
18
19
20 > In /usr/src/linux/admin-guide/kernel-parameters.txt it has;
21 > root= [KNL] Root filesystem
22 > See name_to_dev_t comment in init/do_mounts.c.
23 >
24 > And in do_mounts.c it mentions PARTUUID= and PARTLABEL= but i dont know C
25 > so don't know what to make of it.
26 >
27 > Background is that after adding a new disk the system doesn't boot, so i'm
28 > assuming that the /dev/sdX device names are now pointing to different
29 > hardware, so i want to fix that by using persistent names.
30
31 You could use UUID, or partition label (if GPT is used on the disk), but by-
32 pass GRUB's facility to configure the UUID and use the kernel .config itself.
33 For this you will have to configure and compile your own kernel. Use this
34 kernel option to specify kernel command line options:
35
36 Processor type and features -->
37 ...
38
39 [*] Built-in kernel command line
40 (root=PARTUUID=XXXXXXXXXXXXXXXXXXXXXXXXX other_options_here)
41
42 As long as you use 'make oldconfig' for subsequent kernels the UUID will be
43 retained.
44
45 --
46 Regards,
47
48 Mick

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies

Subject Author
Re: [gentoo-user] Using UUID for root disk in grub requires initramfs? Adam Carter <adamcarter3@×××××.com>