There were many examples of how to change the size of the root partition on first boot (prior to the introduction of bookworm). And they were all, pretty much, accurate.
I believe this has changed with the latest Raspios distributions (correct me if I'm wrong). My way of setting the size of the root partition still works - that is, I create the USB or MMC disk on Ubuntu, I set the size of partition 2 (to usually 64G); create a small, disposable, partition 3 just after partition 2; and viola, the root can't expand to take the whole disk when the firstboot is done. Later, once the system is booted on the Pi, I can delete P3, and set up whatever partition(s) I want.
But I was curious and tried to find where the resizing was done. I "think" it's done by systemd-repart.service (ExecStart=/bin/systemd-repart --dry-run=no), but I'm too lazy to dive into those weeds (and I'll resist ranting about systemd being an undocumented black box...)... Can anyone confirm this? Or send me in the right direction?
TIA,
tom
I believe this has changed with the latest Raspios distributions (correct me if I'm wrong). My way of setting the size of the root partition still works - that is, I create the USB or MMC disk on Ubuntu, I set the size of partition 2 (to usually 64G); create a small, disposable, partition 3 just after partition 2; and viola, the root can't expand to take the whole disk when the firstboot is done. Later, once the system is booted on the Pi, I can delete P3, and set up whatever partition(s) I want.
But I was curious and tried to find where the resizing was done. I "think" it's done by systemd-repart.service (ExecStart=/bin/systemd-repart --dry-run=no), but I'm too lazy to dive into those weeds (and I'll resist ranting about systemd being an undocumented black box...)... Can anyone confirm this? Or send me in the right direction?
TIA,
tom
Statistics: Posted by tommylovell — Fri May 02, 2025 7:44 pm