[systemd-devel] No space left errors on shutdown with systemd-homed /home dir

Colin Guthrie gmane at colin.guthr.ie
Tue May 31 12:44:28 UTC 2022


Hi,

Neal Gompa wrote on 01/02/2022 19:55:
> On Tue, Feb 1, 2022 at 2:02 PM Colin Guthrie <colin at booksterhq.com> wrote:
>>
>> Goffredo Baroncelli wrote on 30/01/2022 09:27:
>>> On 29/01/2022 19.01, Chris Murphy wrote:
>>>> On Sat, Jan 29, 2022 at 2:53 AM Goffredo Baroncelli
>>>> <kreijack at libero.it> wrote:
>>>>>
>>>>> I think that for the systemd uses cases (singled device FS), a simpler
>>>>> approach would be:
>>>>>
>>>>>        fstatfs(fd, &sfs)
>>>>>        needed = sfs.f_blocks - sfs.f_bavail;
>>>>>        needed *= sfs.f_bsize
>>>>>
>>>>>        needed = roundup_64(needed, 3*(1024*1024*1024))
>>>>>
>>>>> Comparing the original systemd-homed code, I made the following changes
>>>>> - 1) f_bfree is replaced by f_bavail (which seem to be more
>>>>> consistent to the disk usage; to me it seems to consider also the
>>>>> metadata chunk allocation)
>>>>> - 2) the needing value is rounded up of 3GB in order to consider a
>>>>> further 1 data chunk and 2 metadata chunk (DUP))
>>>>>
>>>>> Comments ?
>>>>
>>>> I'm still wondering if such a significant shrink is even indicated, in
>>>> lieu of trim. Isn't it sufficient to just trim on logout, thus
>>>> returning unused blocks to the underlying filesystem?
>>>
>>> I agree with you. In Fedora 35, and the default is ext4+luks+trim
>>> which provides the same results. However I remember that in the past the
>>> default
>>> was btrfs+luks+shrunk. I think that something is changed i.
>>>
>>> However, I want to provide do the systemd folks a suggestion ho change
>>> the code.
>>> Even a warning like: "it doesn't work that because this, please drop it"
>>> would be sufficient.
>>
>>
>> Out of curiosity (see other thread on the systemd list about this), what
>> it the current recommendation (by systemd/btrfs folks rather then Fedora
>> defaults) for homed machine partitioning?
>>
> 
> I'd probably recommend Btrfs with the /home subvolume set with
> nodatacow if you're going to use loops of LUKS backed Btrfs homedir
> images. The individual Btrfs loops will have their own COW anyway.
> 
> Otherwise, the Fedora defaults for Btrfs should be sufficient.

Thought I'd wait for Fedora 36 to be released with everything I need to 
test this setup.

Fell at the first hurdle of transferring my data in!

I transferred a subset of my data (240Gb) onto an external disk and used:

   homectl with colin -- rsync ...


The transfer worked but the colin.home file grew to 394Gb. Only about 
184Gb used (I presume due to compression).

Ultimately, this was then unmounted and while it said it could shrink 
the filesystem with a "Ready to..." message this either didn't happen or 
the backing file wasn't shrunk to match it. I did receive a message later

I'm not sure now where it's at with recovery but as nothing is strictly 
needed to make this work, I think I'll leave my playing with homed there 
for now and try again at some later date.

I love the whole idea but it's still a bit to bleeding edge and quirky 
for my daily driver just yet!


I've attached various logs in case they are useful (will post separately 
if the list removes this!)


Cheers

Col


-- 

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
   Tribalogic Limited http://www.tribalogic.net/
Open Source:
   Mageia Contributor http://www.mageia.org/
   PulseAudio Hacker http://www.pulseaudio.org/
   Trac Hacker http://trac.edgewall.org/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 1.homectl-with-file-transfer.log
Type: text/x-log
Size: 4398 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20220531/f6da23c3/attachment-0006.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 2.homectl-with-test-after-reboot.log
Type: text/x-log
Size: 2932 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20220531/f6da23c3/attachment-0007.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 3.homectl-with-test-debug.log
Type: text/x-log
Size: 10256 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20220531/f6da23c3/attachment-0008.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 4.homectl-inspect.log
Type: text/x-log
Size: 1120 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20220531/f6da23c3/attachment-0009.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 5.btrfs-filesystem-usage.log
Type: text/x-log
Size: 684 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20220531/f6da23c3/attachment-0010.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 6.dot-home-file-stats.log
Type: text/x-log
Size: 825 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20220531/f6da23c3/attachment-0011.bin>


More information about the systemd-devel mailing list