carlosperate / rpi-os-custom-image

Raspberry Pi OS images with autologin and ssh enabled
MIT License
8 stars 4 forks source link

[FAILED] Failed to start LSB: Resize the root filesystem to fill partition. See 'systemct1 status resize2fs_once.service' for details. #5

Open carlosperate opened 8 months ago

carlosperate commented 8 months ago

With the Bullseye (legacy) 2023-10-10 image on https://github.com/carlosperate/docker-qemu-rpi-os, during boot: https://github.com/carlosperate/docker-qemu-rpi-os/commit/57a0dd0d177cd87be75894ed22b22c5335fa5f3c

[FAILED] Failed to start LSB: Resize the root filesystem to fill partition.
See 'systemct1 status resize2fs_once.service' for details.

And the error itself:

$ systemctl status resize2fs_once.service
● resize2fs_once.service - LSB: Resize the root filesystem to fill partition
     Loaded: loaded (/etc/init.d/resize2fs_once; generated)
     Active: failed (Result: exit-code) since Sat 2024-01-06 16:31:56 GMT; 1 day 18h ago
       Docs: man:systemd-sysv-generator(8)
        CPU: 2.491s

Jan 06 16:31:08 raspberrypi systemd[1]: Starting LSB: Resize the root filesystem to fill partition...
Jan 06 16:31:56 raspberrypi resize2fs_once[297]: Starting resize2fs_once:
Jan 06 16:31:56 raspberrypi resize2fs_once[373]: resize2fs 1.46.2 (28-Feb-2021)
Jan 06 16:31:57 raspberrypi resize2fs_once[373]: open: No such file or directory while opening /dev/sda2
Jan 06 16:31:56 raspberrypi systemd[1]: resize2fs_once.service: Control process exited, code=exited, status=1/FAILURE
Jan 06 16:31:56 raspberrypi systemd[1]: resize2fs_once.service: Failed with result 'exit-code'.
Jan 06 16:31:57 raspberrypi systemd[1]: Failed to start LSB: Resize the root filesystem to fill partition.
Jan 06 16:31:57 raspberrypi systemd[1]: resize2fs_once.service: Consumed 2.491s CPU time.
carlosperate commented 8 months ago

This only happens with the pivirt "machine" type, so might be an issue with the qemu configuration.

However, this script actually runs every time the container is launched, which is not ideal, so as a workaround we can start the Pi OS image once more before shipping it, so that the script had the change to run and expand the img. This has the additional advantage that it the startup should be slightly faster.