linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrei Borzenkov <arvidjaar@gmail.com>
To: Chris Murphy <lists@colorremedies.com>
Cc: Goffredo Baroncelli <kreijack@inwind.it>,
	Btrfs BTRFS <linux-btrfs@vger.kernel.org>
Subject: Re: GRUB bug with Btrfs multiple devices
Date: Sat, 30 Nov 2019 20:02:30 +0300	[thread overview]
Message-ID: <8a86c7ef-39ab-7c35-f39b-e05ab7543a11@gmail.com> (raw)
In-Reply-To: <CAJCQCtQxR4Xnikz7vVxOX-gzU6aWzu5eHeG95HOKsx40ziTGLg@mail.gmail.com>

30.11.2019 19:31, Chris Murphy пишет:
> On Sat, Nov 30, 2019 at 12:31 AM Andrei Borzenkov <arvidjaar@gmail.com> wrote:
>>
>> 30.11.2019 00:11, Chris Murphy пишет:
>>> On Fri, Nov 29, 2019 at 1:50 PM Andrei Borzenkov <arvidjaar@gmail.com> wrote:
>>>>
>>>> 27.11.2019 02:53, Chris Murphy пишет:
>>>>>
>>>>> The storage is one CD-ROM drive and one SSD drive. That's it. So I
>>>>> don't know why there's hd2 and hd3, it seems like GRUB is confused
>>>>> about how many drives there are, but that pre-dates this problem.
>>>>>
>>>>
>>>> grub enumerates what EFI provides. What "lsefi" in grub says?
>>>
>>> https://photos.app.goo.gl/pBxLJNdbzz6J9Vo56
>>>
>>
>> These are vendor media device paths handles that are children of (some)
>> disk partitions. GRUB already tries to skip such handles:
>>
>>
>>         /* Ghosts proudly presented by Apple.  */
>>         if (GRUB_EFI_DEVICE_PATH_TYPE (dp) == GRUB_EFI_MEDIA_DEVICE_PATH_TYPE
>>             && GRUB_EFI_DEVICE_PATH_SUBTYPE (dp)
>>             == GRUB_EFI_VENDOR_MEDIA_DEVICE_PATH_SUBTYPE)
>>           {
>>             grub_efi_vendor_device_path_t *vendor =
>> (grub_efi_vendor_device_path_t *) dp;
>>             const struct grub_efi_guid apple = GRUB_EFI_VENDOR_APPLE_GUID;
>>
>>             if (vendor->header.length == sizeof (*vendor)
>>                 && grub_memcmp (&vendor->vendor_guid, &apple,
>>                                 sizeof (vendor->vendor_guid)) == 0
>>                 && find_parent_device (devices, d))
>>               continue;
>>           }
>>
>> but these have different GUID. Google search comes with something
>> hinting on Apple still (like
>> https://www.macos86.it/topic/1136-asus-x202e-hm76-vs-n56vb-hm76/page/2/?tab=comments#comment-31186).
>>    Device paths look like
>>
>> PciRoot(0x0)\Pci(0x1F,0x2)\Sata(0x0,0xFFFF,0x0)\HD(4,GPT,A640EF60-F7E9-4945-81A9-B04CCE53EE97,0x176F4800,0x482FC88)\VenMedia(BE74FCF7-0B7C-49F3-9147-01F4042E6842,4F20CFA89785973FAAF730597BFC41BA)
>>
>> where vendor GUID is BE74FCF7-0B7C-49F3-9147-01F4042E6842
>>
>> So we have hard disk, then partition as child and then this vendor media
>> as child of partition.
>>
>> This should certainly be reported to grub list. What system is it - is
>> it Apple?
> 
> Yes. Macbook Pro 8,2 (2011). I'll report the phantom device problem to
> grub-devel@
> 
> But still an open question is what's the instigator or secondary
> factor because this wasn't happening before adding an unused but
> already existing partition as a 2nd Btrfs device.

GRUB is normally using hints - grub-install (and grub-mkconfig) tries to 
guess firmware device name. At boot time grub tries to access hinted 
device first, if it succeeds, it does not try anything else. With second 
btrfs partition grub needs to find second device at boot time so it now 
probes everything and hits those vendor media devices.

At least this explains what you see as well as ...

> Last time this
> happened, all I did was remove the 2nd device and the problem went
> away.

... this.

If you go in grub shell in this state (without errors), do you see those 
ghost devices?

> I'm ready to try that again (remove the 2nd device) and see if
> the problem goes away, but has enough information been collected about
> the present state?
> 
> 

If you are reasonably sure that all errors are related to those phantom 
devices - I would say yes, the reason for these phantom devices to exist 
is already clear.

  reply	other threads:[~2019-11-30 17:02 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-26  4:05 GRUB bug with Btrfs multiple devices Chris Murphy
2019-11-26 21:11 ` Goffredo Baroncelli
2019-11-26 23:53   ` Chris Murphy
2019-11-27  1:35     ` Chris Murphy
2019-11-27  6:07       ` Goffredo Baroncelli
2019-11-28  0:42         ` Chris Murphy
2019-11-28 17:58           ` Goffredo Baroncelli
2019-11-28 20:05             ` Chris Murphy
2019-11-28 21:57               ` Goffredo Baroncelli
2019-11-29 17:57                 ` Chris Murphy
2019-11-29 19:54                   ` Goffredo Baroncelli
2019-11-29 21:17                     ` Chris Murphy
2019-11-30  7:33                       ` Andrei Borzenkov
2019-11-30  8:12                       ` Goffredo Baroncelli
2019-11-30 16:38                         ` Chris Murphy
2019-11-27  6:09     ` Goffredo Baroncelli
2019-11-29 20:50     ` Andrei Borzenkov
2019-11-29 21:11       ` Chris Murphy
2019-11-30  7:31         ` Andrei Borzenkov
2019-11-30 16:31           ` Chris Murphy
2019-11-30 17:02             ` Andrei Borzenkov [this message]
2019-11-30 17:14               ` Chris Murphy
2019-11-30 17:34                 ` Chris Murphy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8a86c7ef-39ab-7c35-f39b-e05ab7543a11@gmail.com \
    --to=arvidjaar@gmail.com \
    --cc=kreijack@inwind.it \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=lists@colorremedies.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).