Where is grow_partition.sh in BBAI-64 ? Any alternative ?

As title says, usally to grow a partition in BB-black i run
$> sudo /opt/scripts/tools/grow_partition.sh

Unfortunately there is no more /opt/scripts in the BBAI64,

What is the proper procedure to grow a newly burned microSD in BBAI64 ?

bye
Nicola

Hi @nmingotti just reboot… :wink:

Background (for all Bullseye images…) the package “generic-sys-mods” pre-installed on every Bullseye image does:

On first bootup, the systemd service file: grow_partition.service runs, it calls “/usr/bin/bb-growpart” to grow the partition and set the next resize_filesystem.service file to expand…

Sadly yes it requires a reboot to get everything done…

/usr/bin/bb-growpart

#!/bin/sh

if [ -f /etc/default/generic-sys-mods ] ; then
	. /etc/default/generic-sys-mods
fi

if [ ! "x${ROOT_DRIVE}" = "x" ] ; then
	if [ ! "x${ROOT_PARTITION}" = "x" ] ; then
		echo "/usr/bin/growpart ${ROOT_DRIVE} ${ROOT_PARTITION}"
		/usr/bin/growpart ${ROOT_DRIVE} ${ROOT_PARTITION}
	fi
fi

/usr/bin/bb-resizefs

#!/bin/sh

if [ -f /etc/default/generic-sys-mods ] ; then
	. /etc/default/generic-sys-mods
fi

unset is_btrfs
is_btrfs=$(cat /proc/cmdline | grep btrfs || true)

if [ "x${is_btrfs}" = "x" ] ; then
	if [ ! "x${ROOT_DRIVE}" = "x" ] ; then
		if [ ! "x${ROOT_PARTITION}" = "x" ] ; then
			echo "resize2fs ${ROOT_DRIVE}p${ROOT_PARTITION}"
			resize2fs ${ROOT_DRIVE}p${ROOT_PARTITION}
		fi
	fi
else
	echo "btrfs filesystem resize max /"
	btrfs filesystem resize max /
fi

Regards,

1 Like

Yap, confirmed. I just peeked into ‘df’ and the all microSD space is being used !
It did all alone.

I have other little questions like this one, but better i separate in proper titles so other user in the future may find the solution faster.

Thank you !

I also tagged this as an FAQ for the next person. :wink:

Yeah, this is one of the various cleanups i did for Bullseye, that changed 7 years of historical ways of doing things.

Regards,