You are not logged in.

#1 2013-11-15 19:53:53

ThePacman
Member
From: Classified
Registered: 2013-09-19
Posts: 127

[SOLVED] Is there a better way to get Grub to boot by label?

I'm creating a live USB, and it would be *extremely* useful to have Grub pass the kernel "root=LABEL=<whatever>" (right now I'm using UUID, but I'd like to switch over to label.)

I know that I can just modify /boot/grub/grub.cfg directly, but this is not supposed to be done - is there any way I can change something in /etc/default/grub or /etc/grub.d/?

[SOLVED]

Last edited by ThePacman (2013-11-16 17:58:10)


Fedora believes in "software freedom" - that is, restricting user software choices to those deemed appropriately licensed by The Powers That Be.
Arch believes in "freedom", as well - the user has control over his or her system and can do what he wants with it.
https://fedoraproject.org/wiki/Forbidden_items | https://wiki.archlinux.org/index.php/The_Arch_Way

Offline

#2 2013-11-15 20:14:50

teateawhy
Member
From: GER
Registered: 2012-03-05
Posts: 1,138
Website

Re: [SOLVED] Is there a better way to get Grub to boot by label?

Offline

#3 2013-11-15 23:42:55

ThePacman
Member
From: Classified
Registered: 2013-09-19
Posts: 127

Re: [SOLVED] Is there a better way to get Grub to boot by label?

Aha, thanks.
(I'd been poking around at https://wiki.archlinux.org/index.php/GRUB#Using_labels and forgot to check the rest of the page..)


Fedora believes in "software freedom" - that is, restricting user software choices to those deemed appropriately licensed by The Powers That Be.
Arch believes in "freedom", as well - the user has control over his or her system and can do what he wants with it.
https://fedoraproject.org/wiki/Forbidden_items | https://wiki.archlinux.org/index.php/The_Arch_Way

Offline

#4 2013-11-15 23:51:26

ThePacman
Member
From: Classified
Registered: 2013-09-19
Posts: 127

Re: [SOLVED] Is there a better way to get Grub to boot by label?

Hold on, it seems that GRUB_CMDLINE_LINUX just gets appended, leaving my kernel getting passed two root= arguments, one with UUID and the other with label.

I've tried GRUB_CMDLINE_LINUX and GRUB_CMDLINE_LINUX_DEFAULT, but neither seems to behave correctly.

(I did remember to run grub-mkconfig -o /boot/grub/grub.cfg after each change.)


Fedora believes in "software freedom" - that is, restricting user software choices to those deemed appropriately licensed by The Powers That Be.
Arch believes in "freedom", as well - the user has control over his or her system and can do what he wants with it.
https://fedoraproject.org/wiki/Forbidden_items | https://wiki.archlinux.org/index.php/The_Arch_Way

Offline

#5 2013-11-15 23:54:11

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [SOLVED] Is there a better way to get Grub to boot by label?

I don't think those instructions are telling you to change things in /etc/default/grub, but rather to actually change the generated entries in /boot/grub/grub.cfg.

Offline

#6 2013-11-16 02:08:41

ThePacman
Member
From: Classified
Registered: 2013-09-19
Posts: 127

Re: [SOLVED] Is there a better way to get Grub to boot by label?

WonderWoofy wrote:

I don't think those instructions are telling you to change things in /etc/default/grub, but rather to actually change the generated entries in /boot/grub/grub.cfg.

And what I'd specified in the original post is that I'm looking for a better way to change it, something that won't get overwritten when I run a grub-mkconfig, something that is.. well, not just editing that file.

#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

Fedora believes in "software freedom" - that is, restricting user software choices to those deemed appropriately licensed by The Powers That Be.
Arch believes in "freedom", as well - the user has control over his or her system and can do what he wants with it.
https://fedoraproject.org/wiki/Forbidden_items | https://wiki.archlinux.org/index.php/The_Arch_Way

Offline

#7 2013-11-16 02:50:36

progandy
Member
Registered: 2012-05-17
Posts: 5,312

Re: [SOLVED] Is there a better way to get Grub to boot by label?

I believe you should add the following to /etc/default/grub

export GRUB_DISABLE_LINUX_UUID=true
export GRUB_DEVICE="LABEL=mylabel"

| alias CUTF='LANG=en_XX.UTF-8@POSIX ' | alias ENGLISH='LANG=C.UTF-8 ' |

Offline

#8 2013-11-16 02:55:19

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [SOLVED] Is there a better way to get Grub to boot by label?

ThePacman wrote:

And what I'd specified in the original post is that I'm looking for a better way to change it, something that won't get overwritten when I run a grub-mkconfig, something that is.. well, not just editing that file.

Yeah, I read that.  I just wanted to point out that the instructions you linked to were not what you apparently thought they were... which I guess you had realized by that point.  It wasn't meant to be a solution, sorry.

Offline

#9 2013-11-16 17:56:05

ThePacman
Member
From: Classified
Registered: 2013-09-19
Posts: 127

Re: [SOLVED] Is there a better way to get Grub to boot by label?

progandy wrote:

I believe you should add the following to /etc/default/grub

export GRUB_DISABLE_LINUX_UUID=true
export GRUB_DEVICE="LABEL=mylabel"

Perfect, thanks!


Fedora believes in "software freedom" - that is, restricting user software choices to those deemed appropriately licensed by The Powers That Be.
Arch believes in "freedom", as well - the user has control over his or her system and can do what he wants with it.
https://fedoraproject.org/wiki/Forbidden_items | https://wiki.archlinux.org/index.php/The_Arch_Way

Offline

Board footer

Powered by FluxBB