[systemd-devel] [PATCH 2/2] Add +C attrib to the journal files directories

Goffredo Baroncelli kreijack at libero.it
Sun Apr 12 11:30:28 PDT 2015


From: Goffredo Baroncelli <kreijack at inwind.it>

Add +C attrib to the journal files directories. The journal file format
behaves bad on a BTRFS filesystem: the performances decrease during the
time.
To avoid this issue, this tmpfile.d snippet sets the NOCOW attribute to the
journal files directories, so newly created journal files inherit the NCOOW
attribute.

Be aware that the NOCOW attribute disables the BTRFS checksums, prevent BTRFS
to rebuild a corrupted file in a RAIDx filesystem. However the perfomances
increase.
In a single disk filesystem (or a filesystem without redundancy) it is safe
to use the NOCOW flags.
---
 tmpfiles.d/journal-nocow.conf | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
 create mode 100644 tmpfiles.d/journal-nocow.conf

diff --git a/tmpfiles.d/journal-nocow.conf b/tmpfiles.d/journal-nocow.conf
new file mode 100644
index 0000000..4935555
--- /dev/null
+++ b/tmpfiles.d/journal-nocow.conf
@@ -0,0 +1,22 @@
+#  This file is part of systemd.
+#
+#  systemd is free software; you can redistribute it and/or modify it
+#  under the terms of the GNU Lesser General Public License as published by
+#  the Free Software Foundation; either version 2.1 of the License, or
+#  (at your option) any later version.
+
+# See tmpfiles.d(5) for details
+
+# Set the NOCOW attribute for directories of journal files; this flag is
+# inheredited by their new files and sub-directories; valid only for a BTRFS
+# filesystem
+# WARNING: enabling the NOCOW attribute improves the perfomance, but also
+#    disables the BTRFS checksums. In a RAID BTRFS filesystem, the checksums
+#    are needed to rebuild a corrupted file; without checksums a rebuild is
+#    not possible.
+# In a single-disk filesystem (or a filesystem without redundancy) enabling
+# the NOCOW attribute for the journal files is safe, because these have their
+# own checksums and a rebuilding wouldn't be possible in any case
+
+h /var/log/journal/%m - - - - +C
+h /var/log/journal/remote - - - - +C
-- 
2.1.4



More information about the systemd-devel mailing list