Re: [opensuse-factory] Re: grub2 vs. by-label
[sorry for accident off-list copy] В Wed, 2 Apr 2014 18:34:45 +0200 Olaf Hering <olaf@aepfle.de> пишет:
On Wed, Apr 02, Andrey Borzenkov wrote:
В Wed, 2 Apr 2014 18:23:08 +0200 Olaf Hering <olaf@aepfle.de> пишет:
On Wed, Apr 02, Andrey Borzenkov wrote:
How exactly MBR signature or GPT GUID help here? Not at all. At least grub has no concept of "use partition where the files actually reside". Instead it has some odd device.map. grub2 is (most likely) not any better. grub2 is using filesystem UUID to find partition where files actually reside.
grub2 is the thing in /usr/*bin, not what runs in firmware context.
It is using OS device names. It will consult device.map only if called with deprecated (hdX) disk designation. openSUSE today puts /dev/disk/by-id in bootloader configuration. -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
Andrey Borzenkov wrote:
It is using OS device names. It will consult device.map only if called with deprecated (hdX) disk designation. openSUSE today puts /dev/disk/by-id in bootloader configuration.
Which ones are the OS device names? In /dev/disks, I see * by-path + by-id -- (2 variants of the same info, both based off HW part numbers: changes with new HW and relocated HW (different slot or controller) * by-label -- user specified labels; can stay same w/new hardware, but require OS to be booted (often a ramdisk/initrd version) to read. * by-partlabel -- looks like labels on GPT based partitions (but ignores labels on old-PCBIOS-partitions or LVM partitions). * by-partuuid -- uuid equiv of by-partlable -- limited usefulness * by-uuid - recognized by modern bootloaders w/o OS support, as well as by the UEFI based bios's; Doesn't change w/hardware, but defaults to a new number on creation, but is user-settable. Of the above, only the UUID is recognized by both new BIOS's and modern boot loaders without an OS. by-label requires one to have mounted udev on a running OS with all the drivers for the filesystems one is querying. I would gather that only the UUID is stored in a filesystem-independent format which is why OS-drivers aren't needed. It isn't 'hardwired' like 'by-path' or 'by-id' to specific HW & location. I.e. trying to boot by label when you need the OS to read the label is a bit of a chicken and egg problem -- as you have to specify someplace to load a ramdisk from, *first*, and that won't be by label. -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
В Wed, 02 Apr 2014 11:47:04 -0700 Linda Walsh <suse@tlinx.org> пишет:
Andrey Borzenkov wrote:
It is using OS device names. It will consult device.map only if called with deprecated (hdX) disk designation. openSUSE today puts /dev/disk/by-id in bootloader configuration.
Which ones are the OS device names?
In /dev/disks, I see * by-path + by-id -- (2 variants of the same info, both based off HW part numbers: changes with new HW and relocated HW (different slot or controller) * by-label -- user specified labels; can stay same w/new hardware, but require OS to be booted (often a ramdisk/initrd version) to read. * by-partlabel -- looks like labels on GPT based partitions (but ignores labels on old-PCBIOS-partitions or LVM partitions). * by-partuuid -- uuid equiv of by-partlable -- limited usefulness * by-uuid - recognized by modern bootloaders w/o OS support, as well as by the UEFI based bios's; Doesn't change w/hardware, but defaults to a new number on creation, but is user-settable.
Anyone. It is up to administrator to pass device name to grub-install.
Of the above, only the UUID is recognized by both new BIOS's and modern boot loaders without an OS. by-label requires one to have mounted udev on a running OS with all the drivers for the filesystems one is querying. I would gather that only the UUID is stored in a filesystem-independent format which is why OS-drivers aren't needed.
It isn't 'hardwired' like 'by-path' or 'by-id' to specific HW & location.
I.e. trying to boot by label when you need the OS to read the label is a bit of a chicken and egg problem -- as you have to specify someplace to load a ramdisk from, *first*, and that won't be by label.
-- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
On Wed, Apr 02, Andrey Borzenkov wrote:
On Wed, Apr 02, Andrey Borzenkov wrote:
grub2 is using filesystem UUID to find partition where files actually reside. grub2 is the thing in /usr/*bin, not what runs in firmware context. It is using OS device names. It will consult device.map only if called with deprecated (hdX) disk designation. openSUSE today
В Wed, 2 Apr 2014 18:34:45 +0200 Olaf Hering <olaf@aepfle.de> пишет: puts /dev/disk/by-id in bootloader configuration.
I think the bootloader part has three sides: #1 is first stage. Something has to configure the blocklists, for that it needs some block device name. This is tricky, and requires the smartass bootloader configurator, which will need no device.map. #2 is second stage. Something has to tell second stage where the files to load are located. Since second stage runs in firmware context this can either be filesystem specifc data like UUID or LABEL. Or some firmware accessible path. The latter has to be translated from Linux to firmware notation. I tend to think that the current approach to use filesystem UUID to access the partitions is a usable approach. If the partition content is copied around its required anyway to update the bootloader. If that includes also second stage in addtion to just first stage, thats fine. #3 is passing a cmdline to the OS. And I think thats Sashas point. If fstab contains LABE=X for /, then the bootloader has to follow. Or it should not pass anything at all, leaving everything to the code which actually mounts /, which is the initrd. Olaf -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
On 2014-04-02 21:37, Olaf Hering wrote:
#3 is passing a cmdline to the OS. And I think thats Sashas point. If fstab contains LABE=X for /, then the bootloader has to follow. Or it should not pass anything at all, leaving everything to the code which actually mounts /, which is the initrd.
Grub 1 is capable of booting using labels - this is what I have: kernel /vmlinuz-3.11.10-7-desktop root=/dev/disk/by-label/a_main resume=/dev/disk/by-label/b_swap showopts ... because it is the kernel in fact which needs and reads the parameters that grub gives to the OS. Of course, the syntax is too long, but... grub2 is also also capable, and the syntax is more powerful: linux /vmlinuz-3.11.10-7-desktop root=UUID=00eb9a40-d067-459e-a22f-1d3b667dddbb resume=/dev/disk/by-label/b_swap ... So, IMHO, what grub has in that line is the problem of whatever configures grub, not grub itself. (I suspect that both "UUID=..." and "LABEL=..." would work in both grub versions). The problem with booting is not the parameters given to the kernel, it is how grub knows where to locate the kernel. grub 1 used the syntax: root (hd0,1) which is a syntax related to how the BIOS sees the disks. Grub2 can do more (it is another partition): set root='hd0,msdos9' if [ x$feature_platform_search_hint = xy ]; then search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos9 --hint-efi=hd0,msdos9 --hint-baremetal=ahci0,msdos9 --hint='hd0,msdos9' 00eb9a40-d067-459e-a22f-1d3b667dddbb else search --no-floppy --fs-uuid --set=root 00eb9a40-d067-459e-a22f-1d3b667dddbb fi I don't understand it all, but it seems as if it is using both bios names and UUIDs. -- Cheers / Saludos, Carlos E. R. (from 13.1 x86_64 "Bottle" at Telcontar)
On 2014-04-02 22:43 (GMT+0200) Carlos E. R. composed:
this is what I have:
kernel /vmlinuz-3.11.10-7-desktop root=/dev/disk/by-label/a_main resume=/dev/disk/by-label/b_swap showopts ...
because it is the kernel in fact which needs and reads the parameters that grub gives to the OS. Of course, the syntax is too long, but...
It need not be that long. I've been using root=LABEL= syntax, 13 characters shorter, for menu.lst and fstab since somewhere around 10.2 or maybe earlier. -- "The wise are known for their understanding, and pleasant words are persuasive." Proverbs 16:21 (New Living Translation) Team OS/2 ** Reg. Linux User #211409 ** a11y rocks! Felix Miata *** http://fm.no-ip.com/ -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
On 2014-04-02 23:24, Felix Miata wrote:
It need not be that long. I've been using root=LABEL= syntax, 13 characters shorter, for menu.lst and fstab since somewhere around 10.2 or maybe earlier.
Thanks, I thought it existed. I have just now edited my config to use it on next boot. -- Cheers / Saludos, Carlos E. R. (from 13.1 x86_64 "Bottle" at Telcontar)
On Thursday 2014-04-03 00:49, Carlos E. R. wrote:
On 2014-04-02 23:24, Felix Miata wrote:
It need not be that long. I've been using root=LABEL= syntax, 13 characters shorter, for menu.lst and fstab since somewhere around 10.2 or maybe earlier.
Thanks, I thought it existed. I have just now edited my config to use it on next boot.
But you do still have an initrd line, don't you? -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
On 2014-04-03 21:31, Jan Engelhardt wrote:
On Thursday 2014-04-03 00:49, Carlos E. R. wrote:
Thanks, I thought it existed. I have just now edited my config to use it on next boot.
But you do still have an initrd line, don't you?
Yes, of course. root (hd0,1) kernel /vmlinuz-3.11.10-7-desktop root=LABEL=a_main resume=LABEL=b_swap showopts initrd /initrd-3.11.10-7-desktop It is loaded by grub, it uses the (hd0,1) reference. In grub 1, that means bios numbers. -- Cheers / Saludos, Carlos E. R. (from 13.1 x86_64 "Bottle" at Telcontar)
On 2014-04-03 00:49, Carlos E. R. wrote:
On 2014-04-02 23:24, Felix Miata wrote:
It need not be that long. I've been using root=LABEL= syntax, 13 characters shorter, for menu.lst and fstab since somewhere around 10.2 or maybe earlier.
Thanks, I thought it existed. I have just now edited my config to use it on next boot.
Problem. I have now: kernel /vmlinuz-3.11.10-7-desktop root=LABEL=a_main resume=LABEL=b_swap And system refuses to hibernate. The error is this: Running hook /usr/lib/pm-utils/sleep.d/30s2disk-check hibernate hibernate: INFO: checking for suspend-to-disk prerequisites... ERROR: resume partition '/root/LABEL=b_swap' not active, can not suspend WARNING: /var/run/pm-utils/pm-suspend/storage/inhibit will be created to prevent suspending! (that swap partition is indeed active, but that's not the exact name: it preppends "root/" or something). So the syntax "resume=LABEL=b_swap" in grub 1 does not work. -- Cheers / Saludos, Carlos E. R. (from 13.1 x86_64 "Bottle" at Telcontar)
On 2014-04-04 04:47 (GMT+0200) Carlos E. R. composed:
Carlos E. R. wrote:
Felix Miata wrote:
It need not be that long. I've been using root=LABEL= syntax, 13 characters shorter, for menu.lst and fstab since somewhere around 10.2 or maybe earlier.
Thanks, I thought it existed. I have just now edited my config to use it on next boot.
Problem.
I have now:
kernel /vmlinuz-3.11.10-7-desktop root=LABEL=a_main resume=LABEL=b_swap
And system refuses to hibernate. The error is this:
Running hook /usr/lib/pm-utils/sleep.d/30s2disk-check hibernate hibernate: INFO: checking for suspend-to-disk prerequisites... ERROR: resume partition '/root/LABEL=b_swap' not active, can not suspend WARNING: /var/run/pm-utils/pm-suspend/storage/inhibit will be created to prevent suspending!
(that swap partition is indeed active, but that's not the exact name: it preppends "root/" or something).
So the syntax "resume=LABEL=b_swap" in grub 1 does not work.
Probably means no one ever noticed, or anyone who did notice never reported the problem appropriately. I would never have noticed, because all my Grub stanzas include noresume. -- "The wise are known for their understanding, and pleasant words are persuasive." Proverbs 16:21 (New Living Translation) Team OS/2 ** Reg. Linux User #211409 ** a11y rocks! Felix Miata *** http://fm.no-ip.com/ -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 On 2014-04-04 04:53, Felix Miata wrote:
On 2014-04-04 04:47 (GMT+0200) Carlos E. R. composed:
Probably means no one ever noticed, or anyone who did notice never reported the problem appropriately. I would never have noticed, because all my Grub stanzas include noresume.
I believe I noticed, which would explain why I was not using that syntax. Then I forgot. :-} - -- Cheers / Saludos, Carlos E. R. (from 13.1 x86_64 "Bottle" (Minas Tirith)) -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iF4EAREIAAYFAlM+JXMACgkQja8UbcUWM1xRKwD/cntSKbqLauujRYF1eOIWKE2+ QazNaiFBc3K/0BRoj48A/04JF9Y5cfgte7OmXI6gB0Ht4V5xZOkAObm8wvOGypSi =nIrT -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
Am 04.04.2014 04:47, schrieb Carlos E. R.:
kernel /vmlinuz-3.11.10-7-desktop root=LABEL=a_main resume=LABEL=b_swap
And system refuses to hibernate. The error is this:
Running hook /usr/lib/pm-utils/sleep.d/30s2disk-check hibernate hibernate: INFO: checking for suspend-to-disk prerequisites... ERROR: resume partition '/root/LABEL=b_swap' not active, can not suspend WARNING: /var/run/pm-utils/pm-suspend/storage/inhibit will be created to prevent suspending!
So the syntax "resume=LABEL=b_swap" in grub 1 does not work.
This has nothing to do with grub, initrd, whatever, it's just a not implemented feature in /usr/lib/pm-utils/sleep.d/30s2disk-check which is a bit paranoid to make sure that suspend can actually work. -- Stefan Seyfried "For a successful technology, reality must take precedence over public relations, for nature cannot be fooled." -- Richard Feynman -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
On Friday 2014-04-04 04:47, Carlos E. R. wrote:
Problem.
I have now:
kernel /vmlinuz-3.11.10-7-desktop root=LABEL=a_main resume=LABEL=b_swap
[...] So the syntax "resume=LABEL=b_swap" in grub 1 does not work.
However, grub should be parsing root= or resume= at all. That is a job that falls into the hands of kernel/initrd. -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
On Fri, 4 Apr 2014 20:27, Jan Engelhardt <jengelh@...> wrote:
On Friday 2014-04-04 04:47, Carlos E. R. wrote:
Problem.
I have now:
kernel /vmlinuz-3.11.10-7-desktop root=LABEL=a_main resume=LABEL=b_swap
[...] So the syntax "resume=LABEL=b_swap" in grub 1 does not work.
However, grub should be parsing root= or resume= at all. That is a job that falls into the hands of kernel/initrd.
That would be ideal, but reality says something different about the resume= part. See: /usr/lib/pm-utils/sleep.d/30s2disk-check pm-utils has no way to handle neither LABEL= nor UUID= for resume= If you want that, please "enhance" pm-utils first to handle that. -Yamaban -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
On 2014-04-04 20:52 (GMT+0200) Yamaban composed:
So the syntax "resume=LABEL=b_swap" in grub 1 does not work.
However, grub should be parsing root= or resume= at all. That is a job that falls into the hands of kernel/initrd.
That would be ideal, but reality says something different about the resume= part. See: /usr/lib/pm-utils/sleep.d/30s2disk-check
pm-utils has no way to handle neither LABEL= nor UUID= for resume=
If you want that, please "enhance" pm-utils first to handle that.
https://bugs.freedesktop.org/show_bug.cgi?id=77068 -- "The wise are known for their understanding, and pleasant words are persuasive." Proverbs 16:21 (New Living Translation) Team OS/2 ** Reg. Linux User #211409 ** a11y rocks! Felix Miata *** http://fm.no-ip.com/ -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
Am 04.04.2014 22:40, schrieb Felix Miata:
On 2014-04-04 20:52 (GMT+0200) Yamaban composed:
So the syntax "resume=LABEL=b_swap" in grub 1 does not work. If you want that, please "enhance" pm-utils first to handle that.
Wrong bugtracker, those scripts are not upstream pm-utils but an extension in openSUSE. -- Stefan Seyfried "For a successful technology, reality must take precedence over public relations, for nature cannot be fooled." -- Richard Feynman -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
On Wed, Apr 02, Carlos E. R. wrote:
On 2014-04-02 21:37, Olaf Hering wrote:
#3 is passing a cmdline to the OS. And I think thats Sashas point. If fstab contains LABE=X for /, then the bootloader has to follow. Or it should not pass anything at all, leaving everything to the code which actually mounts /, which is the initrd. Grub 1 is capable of booting using labels - this is what I have: kernel /vmlinuz-3.11.10-7-desktop root=/dev/disk/by-label/a_main resume=/dev/disk/by-label/b_swap showopts ...
These are arbitrary strings which will end up in OS cmdline. grub1 is doing nothing with these strings. I hope!
grub2 is also also capable, and the syntax is more powerful: linux /vmlinuz-3.11.10-7-desktop root=UUID=00eb9a40-d067-459e-a22f-1d3b667dddbb resume=/dev/disk/by-label/b_swap ...
Again, arbitrary strings passed to the OS. The other thing you wrote is my point #2, which is unrelated to Sashas complain. Olaf -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
participants (8)
-
Andrey Borzenkov
-
Carlos E. R.
-
Felix Miata
-
Jan Engelhardt
-
Linda Walsh
-
Olaf Hering
-
Stefan Seyfried
-
Yamaban