[v6,0/1] expand-on-first-boot: Switch from resize2fs to systemd-growfs

Message ID 20221025134720.22571-1-henning.schild@siemens.com
Headers show
Series expand-on-first-boot: Switch from resize2fs to systemd-growfs | expand

Message

Henning Schild Oct. 25, 2022, 1:47 p.m. UTC
Diff to v5:
- keep fallback path for debian stretch simply using old code and rdeps

Original Authors log:

Diff to v1:
- Rewording on patch message ("root partition" --> "last partition",
  added note to systemd-dependency and its impact)
- Added systemd-version dependency
- Removed runtime if case that allowed for non-systemd systems

Diff to v2:
- Version bump to v1.2
- Removed e2fsprogs as dependency

Diff to v3:
- Omit the explicit call to systemd-growfs if a fstab option has been
  found
- Be able to deal with both mounted and unmounted mountpoints

Diff to v4:
- Mount the last partition unconditionally to a tmp dir and let
  systemd-growfs operate there.

Tobias Schmidl (1):
  expand-on-first-boot: Switch from resize2fs to systemd-growfs

 ...oot_1.1.bb => expand-on-first-boot_1.2.bb} |  3 +-
 .../files/expand-last-partition.sh            | 31 ++++++++++++++++---
 2 files changed, 28 insertions(+), 6 deletions(-)
 rename meta/recipes-support/expand-on-first-boot/{expand-on-first-boot_1.1.bb => expand-on-first-boot_1.2.bb} (88%)

Comments

Henning Schild Oct. 25, 2022, 1:49 p.m. UTC | #1
I am taking this over from Tobias. The last remaining point was keeping
the support for stretch, which i implemented here.

Henning

Am Tue, 25 Oct 2022 15:47:19 +0200
schrieb Henning Schild <henning.schild@siemens.com>:

> Diff to v5:
> - keep fallback path for debian stretch simply using old code and
> rdeps
> 
> Original Authors log:
> 
> Diff to v1:
> - Rewording on patch message ("root partition" --> "last partition",
>   added note to systemd-dependency and its impact)
> - Added systemd-version dependency
> - Removed runtime if case that allowed for non-systemd systems
> 
> Diff to v2:
> - Version bump to v1.2
> - Removed e2fsprogs as dependency
> 
> Diff to v3:
> - Omit the explicit call to systemd-growfs if a fstab option has been
>   found
> - Be able to deal with both mounted and unmounted mountpoints
> 
> Diff to v4:
> - Mount the last partition unconditionally to a tmp dir and let
>   systemd-growfs operate there.
> 
> Tobias Schmidl (1):
>   expand-on-first-boot: Switch from resize2fs to systemd-growfs
> 
>  ...oot_1.1.bb => expand-on-first-boot_1.2.bb} |  3 +-
>  .../files/expand-last-partition.sh            | 31
> ++++++++++++++++--- 2 files changed, 28 insertions(+), 6 deletions(-)
>  rename
> meta/recipes-support/expand-on-first-boot/{expand-on-first-boot_1.1.bb
> => expand-on-first-boot_1.2.bb} (88%)
>
Florian Bezdeka Oct. 25, 2022, 1:55 p.m. UTC | #2
On Tue, 2022-10-25 at 15:49 +0200, Henning Schild wrote:
> I am taking this over from Tobias. The last remaining point was keeping
> the support for stretch, which i implemented here.

There were complains on the list that we have a possible race-window
here. A /data partition was unmounted after the resize took place.

That is likely not directly related to this patch, as this is "not in
yet" but I assume we still would have the same race.

See [1].

[1] https://groups.google.com/g/isar-users/c/o-iZbN7hPRw

> 
> Henning
> 
> Am Tue, 25 Oct 2022 15:47:19 +0200
> schrieb Henning Schild <henning.schild@siemens.com>:
> 
> > Diff to v5:
> > - keep fallback path for debian stretch simply using old code and
> > rdeps
> > 
> > Original Authors log:
> > 
> > Diff to v1:
> > - Rewording on patch message ("root partition" --> "last partition",
> >   added note to systemd-dependency and its impact)
> > - Added systemd-version dependency
> > - Removed runtime if case that allowed for non-systemd systems
> > 
> > Diff to v2:
> > - Version bump to v1.2
> > - Removed e2fsprogs as dependency
> > 
> > Diff to v3:
> > - Omit the explicit call to systemd-growfs if a fstab option has been
> >   found
> > - Be able to deal with both mounted and unmounted mountpoints
> > 
> > Diff to v4:
> > - Mount the last partition unconditionally to a tmp dir and let
> >   systemd-growfs operate there.
> > 
> > Tobias Schmidl (1):
> >   expand-on-first-boot: Switch from resize2fs to systemd-growfs
> > 
> >  ...oot_1.1.bb => expand-on-first-boot_1.2.bb} |  3 +-
> >  .../files/expand-last-partition.sh            | 31
> > ++++++++++++++++--- 2 files changed, 28 insertions(+), 6 deletions(-)
> >  rename
> > meta/recipes-support/expand-on-first-boot/{expand-on-first-boot_1.1.bb
> > => expand-on-first-boot_1.2.bb} (88%)
> > 
>
Henning Schild Oct. 25, 2022, 2:31 p.m. UTC | #3
Am Tue, 25 Oct 2022 15:55:00 +0200
schrieb "Bezdeka, Florian (T CED SES-DE)" <florian.bezdeka@siemens.com>:

> On Tue, 2022-10-25 at 15:49 +0200, Henning Schild wrote:
> > I am taking this over from Tobias. The last remaining point was
> > keeping the support for stretch, which i implemented here.  
> 
> There were complains on the list that we have a possible race-window
> here. A /data partition was unmounted after the resize took place.
> 
> That is likely not directly related to this patch, as this is "not in
> yet" but I assume we still would have the same race.
> 
> See [1].

I would hope that the race will be gone when doing things with systemd,
but i do not know. In the stretch case it might be still in, but i
really do not care ... we should drop stretch from Isar or maintain it
on the best effort basis suggested here. Make sure it still works ...
but not much more.

I have read that thread and pointed out there that systemd resize will
be coming, and that people can try it already to see if it solves their
problem. Will take Raphael in Cc.

Raphael please have a look at the following patch, it might just solve
your resize race.

https://patchwork.isar-build.org/project/isar/patch/20221025134720.22571-2-henning.schild@siemens.com/

Henning

> 
> [1] https://groups.google.com/g/isar-users/c/o-iZbN7hPRw
> 
> > 
> > Henning
> > 
> > Am Tue, 25 Oct 2022 15:47:19 +0200
> > schrieb Henning Schild <henning.schild@siemens.com>:
> >   
> > > Diff to v5:
> > > - keep fallback path for debian stretch simply using old code and
> > > rdeps
> > > 
> > > Original Authors log:
> > > 
> > > Diff to v1:
> > > - Rewording on patch message ("root partition" --> "last
> > > partition", added note to systemd-dependency and its impact)
> > > - Added systemd-version dependency
> > > - Removed runtime if case that allowed for non-systemd systems
> > > 
> > > Diff to v2:
> > > - Version bump to v1.2
> > > - Removed e2fsprogs as dependency
> > > 
> > > Diff to v3:
> > > - Omit the explicit call to systemd-growfs if a fstab option has
> > > been found
> > > - Be able to deal with both mounted and unmounted mountpoints
> > > 
> > > Diff to v4:
> > > - Mount the last partition unconditionally to a tmp dir and let
> > >   systemd-growfs operate there.
> > > 
> > > Tobias Schmidl (1):
> > >   expand-on-first-boot: Switch from resize2fs to systemd-growfs
> > > 
> > >  ...oot_1.1.bb => expand-on-first-boot_1.2.bb} |  3 +-
> > >  .../files/expand-last-partition.sh            | 31
> > > ++++++++++++++++--- 2 files changed, 28 insertions(+), 6
> > > deletions(-) rename
> > > meta/recipes-support/expand-on-first-boot/{expand-on-first-boot_1.1.bb
> > > => expand-on-first-boot_1.2.bb} (88%)  
> > >   
> >   
>
Raphael Lisicki Oct. 28, 2022, 2:34 p.m. UTC | #4
On 25.10.22 16:31, Henning Schild wrote:
> 
> I have read that thread and pointed out there that systemd resize will
> be coming, and that people can try it already to see if it solves their
> problem. Will take Raphael in Cc.
> 
> Raphael please have a look at the following patch, it might just solve
> your resize race.
> 

I did not manage to test this yet, but I found quite some documentation
by systemd on the very same issue [1] and its shortcomings. I would be
moderately confident that systemd resize and systemd-udev will not clash.

The mentioned udevadm lock command is not available with debian bullseye.



[1] https://systemd.io/BLOCK_DEVICE_LOCKING/


best regards
raphael