[systemd-devel] homed: Issues with LUKS storage on btrfs

Sebastian Wiesner sebastian at swsnr.de
Tue Dec 28 00:04:47 UTC 2021


Hello,

I've experimented with homectl today, and noticed two issues when
creating LUKS-lookback-backed home areas on top of a btrfs filesystem:

1) homectl resize doesn't work reliably on btrfs: It looks as if on
btrfs resizing a home area requires more free space on the underlying
btrfs filesystem than I expected.  I assumed that resizing from X to Y
only requires Y-X extra free space on the underlying device, but on
btrfs it seems to require Y free space, i.e. it looks as if homectl
attempts to allocate the entire home area anew.

I've found https://github.com/systemd/systemd/issues/19398 which looks
like the problem, but went nowhere.

2) homectl creates loopback files which have COW-enabled.  As far as I
understand btrfs it's not recommended to enable COW for large files
which frequently get updated in-place which as far as I see it would
include the backing loopback files for LUKS home areas.

Shouldn't homectl explicitly disable COW for new home areas if the
underlying file system is btrfs?

I can work around 2) by setting -C on /home/ but I haven't figured out
a solution for 1)  

Is LUKS on btrfs supported by homectl?  Or should I rather use e.g.
ext4 as underlying file system for /home/?

Cheers,
Basti


More information about the systemd-devel mailing list