> I've had this happen maybe a dozen times over the years and I wonder if
> anyone knows what I'm doing to cause it.

Seeing the hordes rushing to drown you in suggestions, I'll take
my chance.  Based on what you say, I suspect I won't tell you anything
you don't already know, tho.  🙁

> I reboot and grub fails to find anything. ls shows memdisk and the main disk
> but nothing else. insmod lvm etc makes no difference at all.
>
> But once you run pvresize on the PV, grub is happy again and finds
> everything it needs to boot.

- I suspect you might get better info from Grub insiders.
  Maybe it's worth opening a bug report, even if you don't have much
  concrete data to provide, in the hope to get them to tell you how you
  might collect useful data next time it happens.

- Maybe something corrupts some copy of the LVM info, which is the one
  Grub uses, whereas `pvresize` is able to read some other copy and
  silently refresh/fix the corrupted copy?

- My crystal ball is terribly hazy, but it suggests maybe some problem
  in the disk makes it occasionally "fail to start up", or rather
  startup in such a way that when Grub tries to get the LVM info it gets
  some kind of error, even though it would succeed if it were done
  a fraction of a second later.
  That would be fundamentally unrelated to LVM, so I'd expect it to show
  up in other ways as well, but maybe in your context there's nothing else
  to affect.  Running `pvresize` would simply have the effect of
  slightly changing the disk's erroneous behavior.
  [ E.g. maybe the problem is when the disk is shutdown in a particular
    way, it takes more time to boot (e.g. because it has to work harder
    to recover its "logical-to-physical block mapping", assuming it's
    an SSD).  ]

The last two ideas are *very* hypothetical.


=== Stefan

Reply via email to