You are not logged in.
I recently did an LVM snapshot of my root partition before upgrading and then restored it afterwards to familiarize myself with the process.
I repeated the process, but the second time I must have shut down my system too quickly, i.e. in the middle of the merge.
Next boot failed because "invalid magic number - load kernel first". I got lucky and running the upgrade by chrooting from another system "fixed" this for me.
However, that got me thinking - how would you monitor an LVM merge appropriately to prevent such a mishap.
First would obviously be to merge the snapshot when the corresponding LV is not activated, to have it merge in the foreground. Running merge while the LV is active just tells me it's going to be done on next boot, but then it seems to run in the background by default.
However, the more convenient method of this kind for me would be to have system startup delayed until the merge is completed, so that I don't need some external system to do snapshot merging.
Is that somehow possible with LVM(2)?
The alternatives I see revolve around either setting LVM log level to 4 to make it log progress on a running merge and somehow parsing the logs,
or running a one-off service that does dmsetup status polling (i.e. this: https://access.redhat.com/solutions/4265151 ) and posts it with libnotify or something (that's where I'd like to have this end up eventually).
The second approach actually appears pretty easily doable to me, but is there some straightforward way to pipe a filtered journalctl --follow output into some event-handling, with scripting alone?
Offline