Skip to content

Commit a968240

Browse files
Yury-MonZonalchark
authored andcommitted
Disable CoW on the systemd journal directory
journald's append-heavy writes fragment badly under btrfs copy-on-write. Pre-create the journal directory with NODATACOW while it is still empty so the journal files written on first boot inherit it.
1 parent 166193e commit a968240

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

debian-rk3576-img.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,17 @@ actions:
9898
UUID=$FSUUID /var/cache btrfs {{ $btrfsopts }},subvol=@var-cache 0 0
9999
EOF
100100
101+
# journald's append-heavy writes fragment badly under btrfs copy-on-write. Pre-create
102+
# the journal dir with NODATACOW (chattr +C) while it's still empty, so the journal
103+
# files written on first boot inherit it. (+C also implies no compression.)
104+
- action: run
105+
description: Disable CoW on the systemd journal directory
106+
chroot: false
107+
command: |
108+
set -eu
109+
mkdir -p "$IMAGEMNTDIR/var/log/journal"
110+
chattr +C "$IMAGEMNTDIR/var/log/journal"
111+
101112
- action: overlay
102113
description: Copy Linux kernel packages into the target
103114
source: {{ $kerneldir }}

0 commit comments

Comments
 (0)