[systemd-devel] --luks-offline-discard option has no effect on systemd-homed

Gibeom Gwon gb.gwon at stackframe.dev
Sat Jul 17 14:55:15 UTC 2021


Hello,

I'm trying to create a systemd-homed based user, there is a problem with
--luks-offline-discard option. According to homectl(1), if this option 
is true,
home directory loopback file is minified on logout. But in my case it's not
at all. Here is my executed command and output.

# df -h
Filesystem        Size  Used Avail Use% Mounted on
devtmpfs          3.9G     0  3.9G   0% /dev
tmpfs             3.9G  1.1M  3.9G   1% /dev/shm
tmpfs             1.6G  9.5M  1.6G   1% /run
/dev/mapper/root  234G  118G  105G  53% /
tmpfs             3.9G  220K  3.9G   1% /tmp
/dev/sda1         191M   62M  130M  33% /boot
tmpfs             787M   60K  787M   1% /run/user/60448
# homectl create test --storage=luks --luks-offline-discard=yes
🔐 Please enter new password for user test: ****
🔐 Please enter new password for user test (repeat): ****
# homectl inspect test
    User name: test
        State: inactive
  Disposition: regular
  Last Change: Sat 2021-07-17 23:18:05 KST
     Login OK: yes
  Password OK: yes
          UID: 60444
          GID: 60444 (test)
    Directory: /home/test
      Storage: luks (strong encryption)
   Image Path: /home/test.home
    Removable: no
        Shell: /bin/bash
LUKS Discard: online=no offline=yes
    LUKS UUID: dd4ffd2f0e334280945af86f6d64906d
    Part UUID: 64c13ffc40b74a8594bb10f6523d0548
      FS UUID: 2d39d33d882e450dbab52c516b8bcbb5
  File System: btrfs
  LUKS Cipher: aes
  Cipher Mode: xts-plain64
   Volume Key: 256bit
  Mount Flags: nosuid nodev exec
    Disk Size: 88.5G
   Disk Floor: 256.0M
Disk Ceiling: 104.2G
  Auth. Limit: 30 attempts per 1min
    Passwords: 1
   Local Sig.: yes
      Service: io.systemd.Home
# df -h
Filesystem        Size  Used Avail Use% Mounted on
devtmpfs          3.9G     0  3.9G   0% /dev
tmpfs             3.9G  1.1M  3.9G   1% /dev/shm
tmpfs             1.6G  9.5M  1.6G   1% /run
/dev/mapper/root  234G  206G   16G  93% /
tmpfs             3.9G  220K  3.9G   1% /tmp
/dev/sda1         191M   62M  130M  33% /boot
tmpfs             787M   60K  787M   1% /run/user/60448
# homectl activate test
🔐 Please enter password for user test: ****
# df -h
Filesystem             Size  Used Avail Use% Mounted on
devtmpfs               3.9G     0  3.9G   0% /dev
tmpfs                  3.9G  1.1M  3.9G   1% /dev/shm
tmpfs                  1.6G  9.5M  1.6G   1% /run
/dev/mapper/root       234G  206G   16G  93% /
tmpfs                  3.9G  220K  3.9G   1% /tmp
/dev/sda1              191M   62M  130M  33% /boot
tmpfs                  787M   60K  787M   1% /run/user/60448
/dev/mapper/home-test   89G  3.4M   89G   1% /home/test
# homectl deactivate test
# df -h
Filesystem        Size  Used Avail Use% Mounted on
devtmpfs          3.9G     0  3.9G   0% /dev
tmpfs             3.9G  1.1M  3.9G   1% /dev/shm
tmpfs             1.6G  9.5M  1.6G   1% /run
/dev/mapper/root  234G  206G   16G  93% /
tmpfs             3.9G  220K  3.9G   1% /tmp
/dev/sda1         191M   62M  130M  33% /boot
tmpfs             787M   60K  787M   1% /run/user/60448

As you can see the home directory doesn't shrink even when deactivated
after activated. The systemd-homed debug log says, "File system does
not support FITRIM, not trimming.".

Note that my system's root directory is encrypted with LUKS2 and LVM
is not used. I'm not sure is this a bug of systemd or limitation of the 
kernel.
Is there any way to solve this?

Thanks,
Gibeom Gwon


More information about the systemd-devel mailing list