Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 403223 - sys-boot/grub:2 - Please add possibility of 'root=PARTUUID=' statement into grub.cfg via grub2-mkconfig
Summary: sys-boot/grub:2 - Please add possibility of 'root=PARTUUID=' statement into g...
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal enhancement (vote)
Assignee: Mike Gilbert
URL: https://savannah.gnu.org/bugs/index.p...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-12 00:18 UTC by Kamen Dokov
Modified: 2013-04-10 06:26 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
80-persistent-storage.rules (80-persistent-storage.rules,5.83 KB, text/plain)
2012-02-12 00:20 UTC, Kamen Dokov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kamen Dokov 2012-02-12 00:18:27 UTC
Currently grub2 can boot with root=UUID but needs an initrd.
With PARTUUID  there is no need of anything else.


Reproducible: Always

Steps to Reproduce:
1.
2.
3.Add UUID statement for rootfs in grub.cfg and leave it without initrd.
Actual Results:  
With +UUID-initrd= kernel panic (unable to find rootfs)

Expected Results:  
To boot with 'root=PARTUUID=' without initrd.

There are audev rules for creating '/dev/disk/by-PARTUUID/' here: 

http://git.kernel.org/?p=linux/hotplug/udev.git;a=blob;f=rules/rules.d/60-persistent-storage.rules;h=b7da8b8bc22e88c4c345963aebae9d5fbb79dcdd;hb=HEAD

With those rules we are avoiding installing sgdisk dependency.

The '10_linux'  script and '/etc/default/grub' file need tweaking  ;)

Sadly my bash skills are very limited :(

That may help: http://archives.gentoo.org/gentoo-user/msg_35eb3187ef8be8a23cdec253b66b5a59.xml
Comment 1 Kamen Dokov 2012-02-12 00:20:07 UTC
Created attachment 301611 [details]
80-persistent-storage.rules
Comment 2 SpanKY gentoo-dev 2012-02-16 05:23:58 UTC
sounds like something that should get fixed upstream
Comment 3 Kamen Dokov 2012-02-16 10:22:15 UTC
(In reply to comment #2)
> sounds like something that should get fixed upstream

I thought that 'grub2-mkconfig -o' is a exclusive Gentoo thing.
Currently it's possible to boot with PARTUUID and I'm doing it on my system.
The only culprit is that 'grub2-mkconfig -o', '10_linux'  script and '/etc/default/grub' does not make the proper input into grub.cfg ;)
Comment 4 SpanKY gentoo-dev 2012-02-16 20:40:23 UTC
hrm, looks like a lot of patches have been merged locally instead of pushing them upstream.  you could be right here.
Comment 5 Tomáš Chvátal (RETIRED) gentoo-dev 2012-02-16 20:51:33 UTC
grub2-mkconfig is not gentoo thing, we just rename it from grub-mkconfig which is even supported by upstream build system.

FWIW I tried to push all the patches but upstream is not exactly caring so what can we do about them.

I would say that if somebody has interesting patch they should push it upstream and if they wont care we should use it...
Comment 6 Kamen Dokov 2012-02-16 21:53:05 UTC
I still have my hopes for solving this problem :)
Comment 7 Mike Gilbert gentoo-dev 2012-03-21 16:06:28 UTC
Please request this as a feature upstream.

As for the udev rules, please file a separate bug.
Comment 8 Kamen Dokov 2012-03-21 16:34:17 UTC
(In reply to comment #7)
> Please request this as a feature upstream.
> 
> As for the udev rules, please file a separate bug.

I think that last udev (182 i think) shipped those rules, am i wrong?
Comment 9 Mike Gilbert gentoo-dev 2012-03-21 16:38:07 UTC
(In reply to comment #8)

That is possible. I don't really pay attention to it.
Comment 10 Kamen Dokov 2012-03-21 17:27:15 UTC
Here it is the upstream bug:

https://savannah.gnu.org/bugs/index.php?35937
Comment 11 Kamen Dokov 2012-03-27 15:20:22 UTC
I've got an answer there:

"Very low priority. Also note tat GRUB doesn't handle root= at all so many of the claims in original post are wrong."

I dont't get it  :(
Comment 12 Mads 2012-11-13 11:50:57 UTC
It does work if you do it manually, I use

GRUB_DEVICE="PARTUUID=AAAAAAAA-AAAA-BBBB-CCCC-C85A5E5660C3"

in /etc/default/grub.
Comment 13 Mads 2013-04-01 11:00:18 UTC
It doesn't work anymore with 3.8.x and newer kernel.

When `mount´ reports the root partition like this:

> # mount
> PARTUUID=AE78FB79-78D8-4E3D-9289-769C658E0A27 on / type xfs (rw,noatime,attr2,discard,nobarrier,inode64,logbsize=256k,noquota)

(which I think is new with the 3.8.x-kernels), then grub2-mkconfig will not be able to resolve what canonical path "PARTUUID=AE78FB79-78D8-4E3D-9289-769C658E0A27" resolves to.

> # grub2-mkconfig -o /boot/grub2/grub.cfg 
> /usr/sbin/grub2-probe: error: failed to get canonical path of PARTUUID=AE78FB79-78D8-4E3D-9289-769C658E0A27.

I'm guessing grub2-probe must be updated to support partition lookup by /dev/disk/by-partuuid and not just by-uuid.
Comment 14 Kamen Dokov 2013-04-01 13:29:35 UTC
Upstream does not care as it seems :(
Comment 15 Mads 2013-04-03 10:44:18 UTC
The source code for util/grub-probe.c and grub-core/kern/fs.c doesn't look that inaccessible... I guess that if I try to fix this it'll be a hack that doesn't actually do any probing, but just returns the PARTUUID=-string given from config.

Since the grub2 ebuild calls epatch_user, this might not be such a bad idea.
Comment 16 Kamen Dokov 2013-04-10 06:26:36 UTC
(In reply to comment #15)
> The source code for util/grub-probe.c and grub-core/kern/fs.c doesn't look
> that inaccessible... I guess that if I try to fix this it'll be a hack that
> doesn't actually do any probing, but just returns the PARTUUID=-string given
> from config.
> 
> Since the grub2 ebuild calls epatch_user, this might not be such a bad idea.

Well, it looks that you know what you are doing ;)