Expanding the filesystem (for larger storage devices) - Phil1988/FreeDi GitHub Wiki
The full image was created for the smallest 8GB storage space EMMC.
If you flashed it to a larger storage device (eg. 32GB EMMC or USB stick) you cant use the whole space out of the box.
To use the whole space availibe you have to expand the file system.
This can be done in different ways:
#1 using armbian-resize-filesystem (recommended)
Enable the automatic resizing of the filesystem on boot:
sudo systemctl enable armbian-resize-filesystem
And restart the system to apply changes:
sudo reboot
Please allow some time for the system to boot and to resize the file system. This process needs some time and will be done while the system is running (I have not measured it but I estimate something around 15-20min after booting).
#2 using fdisk
Using fdisk to Resize the Partition First, use fdisk to delete the existing partition and recreate it to use the full size of the disk without formatting:fdisk /dev/mmcblk1 # Use fdisk to resize the partition
After resizing the partition, use resize2fs to resize the filesystem:
resize2fs /dev/mmcblk1p2 # Resize the filesystem
#3 using parted
You can use parted as an alternative to fdisk for resizing the partition:
Resize the second partition on the device /dev/mmcblk1 to use 100% of the available space:
parted /dev/mmcblk1 resizepart 2 100%
Then resizing the filesystem on the second partition /dev/mmcblk1p2 to use the newly expanded partition space:
resize2fs /dev/mmcblk1p2
#4 using growpart
Download the growpart utility:
wget https://raw.githubusercontent.com/canonical/cloud-utils/main/bin/growpart -P /usr/local/bin/
Make the growpart script executable:
chmod +x /usr/local/bin/growpart
Resize the partition to use the full available space:
growpart /dev/mmcblk1 2
Resize the filesystem to match the partition:
resize2fs /dev/mmcblk1p2