wjmnelis
Posts: 36
Joined: Thu Oct 26, 2017 5:03 pm

How to increase the size of the boot partition

Fri Jul 24, 2020 9:55 am

When applying the recent updates of Raspberry Pi OS to a RPi 3, which is running now for about 3 years, there is a message stating that the boot partition is too small (it is about 43 [MiB]) and that therefore some files are not installed. As far as I know, the implication is that the image on the SD-card cannot be used on a RPi 4. In order to have an image which would also work on a RPi 4, I could start all over again: burn the latest image on an SD-card, upgrade and re-install all software en restore all data-files from a back-up. This is quite a lot of work and it is hard not to forget something.

A test using gparted showed the problem which has been reported multiple times: gparted can shrink and move the root partition (ext4), but it cannot increase the size of the boot partition (fat32).

I am wondering if the following way of working will result in an SD-card which will work in both an RPi 3 and an RPi 4:
  • Update and upgrade Raspberry Pi OS on the old SD-card
  • Create a full back-up of old SD-card, using rsync (thus file copy)
  • Burn the latest version of Raspberry Pi OS on a new SD-card
  • Update and upgrade Raspberry Pi OS on new SD-card
  • On a Linux laptop, use rsync to copy files from the back-up to the new SD-card without deleting files on the new SD-card

User avatar
RamaSpaceShip
Posts: 63
Joined: Sun Apr 26, 2020 12:19 pm

Re: How to increase the size of the boot partition

Fri Jul 24, 2020 10:56 am

Your recipe can work, but I see it as risky to copy back your files over an existing install.
This can break your system.

After update and upgrade Raspberry Pi OS on the old SD-card, I would do the following process: on a Linux machine:
  • Create a full back-up of old SD-card, using rsync (thus file copy) separating the boot partition from the system partition
  • Burn the latest version of Raspberry Pi OS on a new SD-card
  • Remove all the files (including the hidden ones) on new SD-card, boot and system partitions
  • Use rsync to copy files from the back-up to the new SD-card, boot and system partitions
  • Set the correct PARTUUID and UUID in the boot partition cmdline.txt and etc/fstab in the system partition

Aydan
Posts: 729
Joined: Fri Apr 13, 2012 11:48 am
Location: Germany, near Lake Constance

Re: How to increase the size of the boot partition

Fri Jul 24, 2020 11:16 am

wjmnelis wrote:
Fri Jul 24, 2020 9:55 am
A test using gparted showed the problem which has been reported multiple times: gparted can shrink and move the root partition (ext4), but it cannot increase the size of the boot partition (fat32).
This can be circumvented by copying the /boot files off the boot partition and after resizing (or deleting/readding) the boot partition , copy the files back. Just make sure the boot partition is FAT32, not exFAT.

Step by step:
- put SD card into other linux computer
- resize/move root partition
- copy files off boot partition
- resize/reformat boot partition
- copy files back to boot
- put sd card back into Pi

I did that for a few of my pis migrating from jessie to stretch.

Regards

hippy
Posts: 7911
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: How to increase the size of the boot partition

Fri Jul 24, 2020 11:27 am

wjmnelis wrote:
Fri Jul 24, 2020 9:55 am
A test using gparted showed the problem which has been reported multiple times: gparted can shrink and move the root partition (ext4), but it cannot increase the size of the boot partition (fat32).
No idea if it would work or be possible, but can you remove the FAT32 boot partition or reformat it as something else, shrink the ext4 root, then add a FAT32 boot partition at the end ?

wjmnelis
Posts: 36
Joined: Thu Oct 26, 2017 5:03 pm

Re: How to increase the size of the boot partition

Fri Jul 24, 2020 5:39 pm

@RamaSpaceShip: Is it risky to copy files if both source and destination are upgraded to the same level? The differences outside /home are configuration settings only.

If all files are removed from the new SD-card, the resulting SD-card still does not contain the RPi4 specific files (in the boot partition). I expect that an rsync from a back-up to the newly created SD-card will only copy configuration files, such as config.txt.

Good point about the (PART)UUID.

@Aydan: The proposed method also results in a boot partition which still lacks the RPi4 specifics.

@hippy: As fas as I know (and this is for me a guess), the boot partition must be first partition on the SD-card.

Aydan
Posts: 729
Joined: Fri Apr 13, 2012 11:48 am
Location: Germany, near Lake Constance

Re: How to increase the size of the boot partition

Fri Jul 24, 2020 5:43 pm

wjmnelis wrote:
Fri Jul 24, 2020 5:39 pm
@Aydan: The proposed method also results in a boot partition which still lacks the RPi4 specifics.
True, but you can update this card to the current level which is Pi4 compatible, because the boot partition is big enough.

As I said before, I did this when upgrading from Jessie to Stretch.
Updating major Debian/Raspbian releases is not recommended, although I have done it multiple times without problems.

User avatar
rpdom
Posts: 17275
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: How to increase the size of the boot partition

Fri Jul 24, 2020 5:48 pm

One technique (assuming the card is not in use at the time).

* backup the files from the boot partition using tar

* Using gparted:
Format the boot partition as ext4
Resize the root partition and move the start to make room for the increased boot partition
Resize the boot partition
Format the boot partition as FAT32

* restore the files to the boot partition from the tar file

Done.

The PARTUUIDs will not change, so no files need to be edited.
Unreadable squiggle

GlowInTheDark
Posts: 744
Joined: Sat Nov 09, 2019 12:14 pm

Re: How to increase the size of the boot partition

Fri Jul 24, 2020 5:53 pm

@Aydan: The proposed method also results in a boot partition which still lacks the RPi4 specifics.
The trick is to do it (the re-sizing) FIRST, before doing the upgrade. Then it will just work.

Which is to say, it may already be too late for the OP.

Anyway, for the OP, this is what I'd do.

1) Install a new, fresh OS on a new, fresh card.

2) Boot up the old card on the Pi. Install the new card via USB card reader as /dev/sdX

3) On that card, do: mke2fs -t ext4 /dev/sdX

4) cp -avx to copy from / to sdX

5) Shutdown and then try to boot the new card.

Yes, you'll have to work out the exact syntax of the cp command. Too many variables for me to specify it.

This may or may not work - there are no guarantees - but it doesn't cost anything to try it.
GitD's list of things that are not ready for prime time:
1) IPv6
2) 64 bit OSes
3) USB 3
4) Bluetooth

RonR
Posts: 1227
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Re: How to increase the size of the boot partition

Fri Jul 24, 2020 6:19 pm

wjmnelis wrote:
Fri Jul 24, 2020 9:55 am
When applying the recent updates of Raspberry Pi OS to a RPi 3, which is running now for about 3 years, there is a message stating that the boot partition is too small (it is about 43 [MiB]) and that therefore some files are not installed.

expand-boot

fruitoftheloom
Posts: 23549
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: How to increase the size of the boot partition

Fri Jul 24, 2020 6:24 pm

wjmnelis wrote:
Fri Jul 24, 2020 9:55 am
When applying the recent updates of Raspberry Pi OS to a RPi 3, which is running now for about 3 years, there is a message stating that the boot partition is too small (it is about 43 [MiB]) and that therefore some files are not installed. As far as I know, the implication is that the image on the SD-card cannot be used on a RPi 4. In order to have an image which would also work on a RPi 4, I could start all over again: burn the latest image on an SD-card, upgrade and re-install all software en restore all data-files from a back-up. This is quite a lot of work and it is hard not to forget something.

A test using gparted showed the problem which has been reported multiple times: gparted can shrink and move the root partition (ext4), but it cannot increase the size of the boot partition (fat32).

I am wondering if the following way of working will result in an SD-card which will work in both an RPi 3 and an RPi 4:
  • Update and upgrade Raspberry Pi OS on the old SD-card
  • Create a full back-up of old SD-card, using rsync (thus file copy)
  • Burn the latest version of Raspberry Pi OS on a new SD-card
  • Update and upgrade Raspberry Pi OS on new SD-card
  • On a Linux laptop, use rsync to copy files from the back-up to the new SD-card without deleting files on the new SD-card

Please be aware Raspbian Buster now renamed to RaspiOS is compatible with the 4B and was released a year ago.

Therefore if you are not running Buster, you will need to start afresh, yes you could upgrade to Buster but is not recommended..
Rather than negativity think outside the box !
RPi 4B 4GB (SSD Boot) RaspiOS64 ARM64
Asus ChromeBox 3 Celeron is my other computer...

Return to “Advanced users”