Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 4151

Advanced users • Attempt to stop SD card from expanding during first boot (bookworm)

$
0
0
I've tried to stop the SD card from expanding during the first boot using latest bookworm image. I want to add in new custom partition myself after first boot. Before I plug in my sd card to Pi, I mounted the sd card to another Pi to edit the content of the sd card. What I tried so far
  1. Remove the part "init=/usr/lib/raspberrypi-sys-mods/firstboot" in cmdline.txt
  2. Comment out "do_resize" code in the file "/usr/share/initramfs-tools/scripts/local-premount/firstboot" with a # in front
  3. Comment out "resize2fs $ROOT_DEV &&" code in the file "/etc/init.d/resize2fs_once" with a # in front
Nothing worked above. The sd card will expand to my max sd card size after first boot. Interesting thing I see on the log of firstboot, the resize2fs_once.service keep running regardless what I changed. I've tried to look into the SD card before I boot but the service does not exists in "/lib/systemd/system" directory. It seems to generate on first time boot and delete itself afterwards because systemd reported the service is not longer exists after the first boot.

Hopefully someone will point me to the correct direction. I just need to disable the sd card expansion on first boot.

Thank you.

Statistics: Posted by rasp14 — Mon Mar 04, 2024 2:06 am



Viewing all articles
Browse latest Browse all 4151

Trending Articles