Current images ship with "init=/usr/lib/raspi-config/init_resize.sh" in /boot/firmware/cmdline.txt. This forces the resize to begin immediately on first boot, and it is probably complete by the time you are choosing username and password.
You could remove the init=resize parameter from cmdline.txt before the first boot. Alternatively, creating a third partition on the drive will prevent any expansion until you are ready to do it manually.
init=/usr/lib/raspi-config/init_resize.sh hasn't been used in cmdline.txt for a long time (pre-Bullseye).
Bullseye and Bookworm use init=/usr/lib/raspberrypi-sys-mods/firstboot in cmdline.txt.
Bullseye did the resizing in /usr/lib/raspberrypi-sys-mods/firstboot.
Bookworm does the resizing in /usr/share/initramfs-tools/scripts/local-premount/firstboot which is used in initrd.img-* (initramfs).
Creating a third partition (causing parted to fail) will still prevent auto-expansion at boot. Renaming /usr/lib/raspberrypi-sys-mods/firstboot to something else with a corresponding change in cmdline.txt in the image file will also prevent auto-expansion at boot (/usr/share/initramfs-tools/scripts/local-premount/firstboot does nothing if the word "firstboot" is absent from cmdline.txt). Alternatively, modifying /usr/lib/raspberrypi-sys-mods/firstboot in the image file and then updating initrd.img-* (update-initramfs) will also prevent auto-expansion at boot.
Statistics: Posted by RonR — Sat Dec 30, 2023 12:02 am