rpimartin
Posts: 1
Joined: Thu Jul 07, 2016 10:36 pm

raspbian first boot auto resize

Thu Jul 07, 2016 10:41 pm

Hey there folks,

not sure if this is the right place to ask this. I recorded a minimal (1.3GB) raspbian image on a 32GB sdcard. I realized the partition got resized during first boot automatically. Is there a way to prevent that to happen? or provide arguments (eg. <32GB) for resizing ?

Thanks,

Martin

User avatar
kusti8
Posts: 3439
Joined: Sat Dec 21, 2013 5:29 pm
Location: USA

Re: raspbian first boot auto resize

Fri Jul 08, 2016 12:01 am

There are 10 types of people: those who understand binary and those who don't.

User avatar
AikonCWD
Posts: 180
Joined: Mon Jun 09, 2014 3:50 pm
Location: Barcelona

Re: raspbian first boot auto resize

Fri Jul 08, 2016 7:44 am

If you already have your image expanded, dumps your current 32Gb microSD into *.img file and use this tool to resize it: https://github.com/Drewsif/PiShrink

It's easy to use and you will get a small image again. Also the first time you boot your new (resized) image, it will auto-expand again.
My e-mail = aikon.bcn@gmail.com

User avatar
carriba
Posts: 140
Joined: Tue Nov 18, 2014 5:55 pm
Contact: ICQ

Re: raspbian first boot auto resize

Fri Oct 07, 2016 8:43 am

Does anybody know how much time it takes to auto-resize the image on a 32GB flash disk during the 1st boot?

I flashed the latest image file of 23 Septermber on a 32GB microSD card for an RPi 2, and it after the first boot, I see some activity going on (green LED flashing for a short while and then stops again for a short while, and this repeats again and again) all the time. After 1 hour of no SSH access to the device (no LAN activity LEDs blinking on the device), I pulled the power cable.

And then when I wanted to boot again, no way. Everything in standstill (guess, flash disk corrupted :-(

Thus, I tried it again, flashed the image to the 32GB microSD card, and the same observations as described above...

I had to reflash the card a 3rd time with the image file. However, this time I removed the "init" statement in the "cmdline.txt" file and the OS came up just fine.

klricks
Posts: 7134
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA
Contact: Website

Re: raspbian first boot auto resize

Fri Oct 07, 2016 1:08 pm

You may have a fake SD card. Google for SD fake detection utility.
Did you try to expand manually on the working image. If you don't expand then the OS will get trashed the first time you attempt an update or install new software.
Unless specified otherwise my response is based on the latest and fully updated RPiOS Buster w/ Desktop OS.

User avatar
carriba
Posts: 140
Joined: Tue Nov 18, 2014 5:55 pm
Contact: ICQ

Re: raspbian first boot auto resize

Fri Oct 07, 2016 1:57 pm

The 32GB flash disk is of high quality brand and new. I now removed the "init" statement in the "cmdline.txt" file, and the boot up works fine. I then expanded the FS manually with "raspi-config".

I guess this "/usr/lib/raspi-config/init_resize.sh" in the September 2016 image files does not work :-(

Return to “Advanced users”