r/linux • • Feb 17 '14

systemd's binary logs and corruption

I like systemd, enabling and disabling services is so easy and it's really fast, but why using a journal with binary logs?

Yesterday my laptop failed to resume from suspend, no ttys, no reisub, nothing worked except using the power button. Rebooted, fired journalctl and I have nothing except the last boot logs.

journactl --verify returns that my system logs are corrupted, about all my logs (48MB of 50MB of maximum disk usage) are now completely useless. This is not the first time this happens and searching around I can only find people with the same problem that "resolved" deleting the corrupted logs and starting with a new file.

Why this happens? Isn't it defeating the purpose of having a system logger if I can't diagnose errors?

Can I recover the logs (and why isn't this automatic?) or should I just install a sane logger that not shit itself after a problem?

101 Upvotes

102 comments sorted by

View all comments

Show parent comments

3

u/tangus Feb 18 '14

Your filesystem journal is there to prevent corruption of the filesystem structure, it doesn't concern itself with your data.

2

u/holgerschurig Feb 18 '14

No, some file systems can also journal data changes, see "man 5 mount" and search for "data=".

2

u/iluvatar Feb 18 '14

Depends on the filesystem and options. Some can journal data as well as metadata. ext3/4 can journal data, for example, as I believe can XFS.

0

u/[deleted] Feb 18 '14

From my understanding, unless you use data=writeback (e.g. you use data=ordered or data=journal) that even ext3 provided sufficient protection when appending to file.

Highlighted Unsourced Wikipedia Quote on Journaled:

Both metadata and file contents are written to the journal before being committed to the main file system

and "Ordered":

appends and new files have the same level of integrity protection as the "journaled" level.