I'm looking to prevent the auto resize at first boot (i think??) to be able to create partitions that will be more useful for us than one large partition with everything in.
The auto-resizing methodology in Raspberry Pi OS has changed multiple times over the years.
Assuming the BOOT partition is mounted on BOOTPATH and the ROOT partition is mounted on ROOTPATH, the following snippet will disable auto-resizing on all versions of Raspberry Pi OS:
Code:
sed -i '/^[[:space:]]*#/!s| init=/usr/lib/raspi-config/init_resize\.sh||' "${BOOTPATH}/cmdline.txt"if [ -f "${ROOTPATH}/usr/lib/raspberrypi-sys-mods/firstboot" ]; then cp "${ROOTPATH}/usr/lib/raspberrypi-sys-mods/firstboot" "${ROOTPATH}/usr/lib/raspberrypi-sys-mods/first-boot" sed -i 's|firstboot|first-boot|g' "${ROOTPATH}/usr/lib/raspberrypi-sys-mods/first-boot" sed -i 's|^\(\s*whiptail --infobox \"Resizing root filesystem.*\)$| return 0\n\n\1|' "${ROOTPATH}/usr/lib/raspberrypi-sys-mods/first-boot" &> /dev/null sed -i '/^[[:space:]]*#/!s| init=/usr/lib/raspberrypi-sys-mods/firstboot| init=/usr/lib/raspberrypi-sys-mods/first-boot|' "${BOOTPATH}/cmdline.txt"fi
Statistics: Posted by RonR — Sun Feb 04, 2024 1:01 am