[linux-lvm] Snapshot behavior on classic LVM vs ThinLVM
list at xenhideout.nl
Sat Apr 15 08:27:46 UTC 2017
Xen schreef op 14-04-2017 19:36:
> I'm sorry, I was trying to discover how to use journalctl to check for
> the message and it is just incredibly painful.
So this is how you find out the messages of a certain program by
So user friendly ;-).
Then you need to mimick the behaviour of logtail and write your own
program for it.
You can save the cursor in journalctl so as to do that.
journalctl SYSLOG_IDENTIFIER=lvm --show-cursor
and then use it with --cursor or --after-cursor, but I have no clue what
the difference is.
I created a script to be run as a cron job that will email root in a
pretty nice message.
I only made it for regular snapshot messages currently though, I have
not yet seen fit to test the messages that
But this is the format you can expect:
Snapshot linux/root-snap has been unmounted from /srv/root.
Apr 14 21:11:01 perfection lvm: Unmounting invalid snapshot
linux-root--snap from /srv/root.
Apr 14 19:25:31 perfection lvm: Snapshot linux-root--snap is now
Apr 14 19:25:41 perfection lvm: Snapshot linux-root--snap is now
Apr 14 21:10:51 perfection lvm: Snapshot linux-root--snap is now
Apr 14 21:11:01 perfection lvm: Snapshot linux-root--snap is now
I haven't yet fully tested everything but it saves the cursor in
/run/lvm/lastlog ;-), and will not produce output when there is nothing
new. It will not produce any output when run as a cron job and it will
produce status messages when run interactively.
It has options like:
-c : clear the cursor
-u : update the cursor and nothing else
-d : dry-run
There is not yet an option to send the email to stdout but if you botch
up the script or emailing fails it will put the email to stderr so cron
will pick it up.
I guess the next option is to not send an email or to send it to stdout
instead (also picked up by cron normally).
In any case I assume current LVM already has ways of running scripts,
but that depends on dmeventd....
So you could have different actions in the script as well and have it
run other scripts.
Currently the action is simply to email...
Once I have tested thin fillup I will put that in too :p.
More information about the linux-lvm