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

2022-02-01 Thread Neal Gompa
On Tue, Feb 1, 2022 at 2:02 PM Colin Guthrie  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
> >>  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.



--
真実はいつも一つ!/ Always, there's only one truth!


Re: [systemd-devel] Udevd and dev file creation

2022-02-01 Thread Lennart Poettering
On Di, 01.02.22 16:04, Nishant Nayan (nayan.nishant2...@gmail.com) wrote:

> One thought
> Is it advisable to turn off systemd-udevd if I am sure that I won't be
> adding /removing any devices to my server.

Note that there are various synthetic/virtual devices that are created
on app request, i.e. lvm, loopback, network devices and such. We live
in a dynamic and virtual world, where devices come and go all the
time.

Moreover there are various devices that send out uevents for
change notification of various forms. If you turn off udev apps won't
get those either. i.e. udev is about more than just plug + unplug.

If you stop udev apps waiting for their devices to show up won't be
able to ever get the ready notifications for that and thus will stop
working.

Lennart

--
Lennart Poettering, Berlin


Re: [systemd-devel] Udevd and dev file creation

2022-02-01 Thread Nishant Nayan
Just wanted to know what will happen.


Nishant

On Tue, 1 Feb 2022, 16:14 Greg KH,  wrote:

> On Tue, Feb 01, 2022 at 04:04:01PM +0530, Nishant Nayan wrote:
> > One thought
> > Is it advisable to turn off systemd-udevd if I am sure that I won't be
> > adding /removing any devices to my server.
>
> Why would you want to do that?
>
> > Or udev also does some work while rebooting?
>
> When booting, yes.
>


Re: [systemd-devel] Udevd and dev file creation

2022-02-01 Thread Greg KH
On Tue, Feb 01, 2022 at 04:04:01PM +0530, Nishant Nayan wrote:
> One thought
> Is it advisable to turn off systemd-udevd if I am sure that I won't be
> adding /removing any devices to my server.

Why would you want to do that?

> Or udev also does some work while rebooting?

When booting, yes.


Re: [systemd-devel] Udevd and dev file creation

2022-02-01 Thread Nishant Nayan
One thought
Is it advisable to turn off systemd-udevd if I am sure that I won't be
adding /removing any devices to my server.
Or udev also does some work while rebooting?

Regards
Nishant Nayan

On Tue, 1 Feb 2022, 14:13 Greg KH,  wrote:

> On Tue, Feb 01, 2022 at 10:08:04AM +0530, Nishant Nayan wrote:
> > Thanks, I will check that out.
> > Is there any site where I can gain in depth code level knowledge of
> > systemd-udevd?
>
> The code is all there for you to read and understand directly.  What
> specific questions did you have that you did not understand after
> reading it?
>
> thanks,
>
> greg k-h
>


Re: [systemd-devel] Udevd and dev file creation

2022-02-01 Thread Greg KH
On Tue, Feb 01, 2022 at 10:08:04AM +0530, Nishant Nayan wrote:
> Thanks, I will check that out.
> Is there any site where I can gain in depth code level knowledge of
> systemd-udevd?

The code is all there for you to read and understand directly.  What
specific questions did you have that you did not understand after
reading it?

thanks,

greg k-h