Skip to content

[systemd-homed] fails to resize #22124

@gdonval

Description

@gdonval

systemd version the issue has been seen with

v250

Used distribution

Archlinux

Linux kernel version used (uname -a)

Linux 5.16.0-arch1-1 #1 SMP PREEMPT Mon, 10 Jan 2022 20:11:47 +0000 x86_64 GNU/Linux

CPU architecture issue was seen on

x86-64

Expected behaviour you didn't see

Systemd-homed home area resized to specified size

Unexpected behaviour you saw

Home area stayed the same

Steps to reproduce the problem

  1. Format and mount /home using XFS.
  2. Create new user:
    # homectl --storage=luks create foo
  3. Log in with user foo and then log out (<= this is important, it changes the sparse size of foo.home!)
  4. Look at the actual and pre-allocated sparse size of the home area:
    # ls -hals /home/foo.home
    891G -rw------- 1 root root 25G Jan 14 15:42 /home/foo.home
  5. Try resizing:
    # homectl resize foo 200G

Looking at journalctl, systemd-homework tells me Couldn't change image size.

Activating debug mode shows that systemd-homework thinks there is no space left on the device.

Workaround

(hoping this will make sense and help find the bug)

  1. Reinitialise sparse size to actual size (mv old tmp/cp tmp new/rm tmp):
    # mv /home/foo.home /home/foo.home.tmp && cp /home/foo.home.tmp /home/foo.home && rm /home/foo.home.tmp
  2. Without login in, resize right away:
    # homectl resize foo 200G
  3. Log in and out
  4. # ls -hals /home/foo.home
    201G -rw------- 1 root root 200G Jan 14 15:56 /home/foo.home

Note how now sparse allocation now matches the actual allocation (it does not take the full disk).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug 🐛Programming errors, that need preferential fixingduplicatehomedhomed, homectl, pam_homed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions