0

After some errors on the many pis I manage with raspbian buster, I had some no space left on device issues and saw that the /boot partition has only 54M /dev/mmcblk0p1 43M 23M 21M 53% /boot. I resized it after having moved and shrinked the / partition with gparted. On resizing the /boot partition gparted threw me an error but seemed to have done something anyways... I now want to resize2fs /dev/mmcblk0p1 but it doesnt' work

sudo resize2fs /dev/mmcblk0p1                                                                                                                    
resize2fs 1.43.4 (31-Jan-2017)                                                                                                                                                                              
resize2fs: Bad magic number in super-block while trying to open /dev/mmcblk0p1                                                                                                                                 
Couldn't find valid filesystem superblock.
Philippe Gachoud
  • 267
  • 2
  • 12
  • 1
    Does this answer your question? [How to clean up my /boot partition?](https://raspberrypi.stackexchange.com/questions/114533/how-to-clean-up-my-boot-partition) – Milliways Aug 14 '20 at 00:14
  • @Milliways no, 54MB is too small even cleaned thx – Philippe Gachoud Aug 14 '20 at 00:16
  • The Answer "you could use the procedure I use to create a [Backup image of SD Card](https://raspberrypi.stackexchange.com/a/103991/8697)" does work, because it creates a fresh image with the correct partitions (even correcting the minor error in Foundation images). – Milliways Aug 14 '20 at 00:44

3 Answers3

2

resize2fs will resize ext2,ext3 and ext4 filesystems. Your boot partition is not any of those. It is a vfat. Therefore fatresize is the command to use.

Call me paranoid, but your remark:

gparted threw me an error but seemed to have done something anyways

gave me the idea that something is not going as you planned.

Shrinking the root partition takes room at the end. The /boot is at the beginning. So probably, the /boot and the root partition are still contiguous and therefore, the partition for /boot is probably not enlarged (which might be the error message) and therefore, fatresize will probably do nothing. But that is just based on what I have in my Pis.

Ljm Dullaart
  • 2,301
  • 7
  • 13
  • thx, see my complete answer, at the end donno if its about `gparted` version I have but had to delete/recreate/restore-data for the `/boot` partition – Philippe Gachoud Aug 13 '20 at 23:40
1

You have presumably "updated" from a previous release - which is NOT supported.

Buster needs a larger boot partition.

You CAN NOT do this on the Pi although it can be done on a Linux computer.

You should do a fresh install.

If you search this Forum you will find similar questions.

Milliways
  • 54,718
  • 26
  • 92
  • 182
  • Of course, but if you have hours configuring an image it worths doing an update and grow the boot partition.... I cannot afford doing a new image every time a new release gets out.... but thx, I saw it too! – Philippe Gachoud Aug 13 '20 at 23:35
  • 1
    @PhilippeGachoud New OS are only released every 2 years or so (Raspbian is on its 4th release since 2012) and it takes longer to "fix" than a fresh install, but if you want to do this see https://raspberrypi.stackexchange.com/a/114556/8697 – Milliways Aug 14 '20 at 00:03
1

Actually, the solution was to resize the boot partition after resizing the slash partition smaller and move it right. Resizing the boot partition needs a

  1. mount partition on /tmp/some_dir
  2. copy data to it cp -rp /mnt/mounted_boot_partition/* /tmp/some_dir/
  3. delete the partition with gparted or any other tool
  4. create a bigger partition with boot flag (am not sure its mandatory)
  5. restore data cp -rp /tmp/some_dir/* /mnt/mounted_boot_partition/
  6. umount sync && /mnt/mounted_boot_partition/
  7. try it!
Philippe Gachoud
  • 267
  • 2
  • 12
  • Please mark the answer as the accepted one with a click on the tick on its left side. That prevents your Question from being shown as a unsolved Post to the community and saves them/us a lot of work. – Ingo Aug 18 '20 at 21:43