Skip to content

Auto Resize makes a system unusable when there is free space after additional partitions

If you create partitions behind the root partition they must fill the entire disk. If they don't (and leave free space behind), the system becomes unusable: it tries to resize the root partition at every boot but then hangs after unmounting the root partition because it can't.

I propose to modify the affected line in rpi-resizerootfs as follows to fix this:

28c28
< free_space="$(parted -m -s "$rootdev" print free | tail -n1 | grep free)"
---
> free_space="$(parted -m -s "$rootdev" print free | grep '\:ext4\:' -A1 | head -n2 | tail -n1 | grep free)"

This way the script considers only the free space after the first ext4 partition (which should always be the root partition).

Regards Marcel

Edited by Marcel Gsteiger