Zachary W. Huang

Home Projects Blog Guides Resume

You Can Resize the Active Partition

May 26, 2025

I recently came across an issue where I was having trouble with a Linux partition being too small. Long story short, I’ve been working on a project with the DE10-Nano SoC from Terasic, which integrates both a Cyclone V FPGA and an ARM Cortex-A9 CPU. This is useful since you can design circuits to do high-throughput, low-latency computations on the FPGA while also being able to interface with other components in a familiar Linux environment (running on the CPU).

counting in binary on the FPGA

I’ve been following this amazing guide to set up the software for my board, since it’s a pretty involved process (which isn’t helped by the horrible proprietary software every FPGA manufacturer provides that looks straight out of the Windows XP era). After I loaded an Arch Linux ARM image onto the board through an SD card, I started installing some packages, but came across an unexpected error: “Partition / too full: XXX blocks remaining, XXX blocks free” (I don’t remember the exact numbers). It turns out the partitions were set up in a bit of a magical way that allows the current OS to reprogram the FPGA while it’s running (which is very cool in my opinion), but the only issue was that the Linux partition was about 2 GB (the size of the Linux image), and the other 29 GB of space on the 32 Gb SD card was just unallocated.

I loaded the SD card back into my laptop to see if I could fix the issue, but for whatever reason, diskutil on MacOS wasn’t letting me do a repartition. After a bit of searching for a solution, I came across a StackOverflow answer that I almost didn’t believe at first. It turns out you can do the repartitioning from Linux itself, even though you are literally resizing the current active partition being used by the OS. In summary, you can use fdisk to “delete” the current Linux partition, create a new partition with the exact same starting block but a larger size, write this partition table to disk and reboot, and then run resize2fs to expand the filesystem to use the entire space in the newly-resized partition.

It worked, and now I can install Neovim on my Arch Linux FPGA SoC :)

github logo linkedin logo

Zachary W. Huang © 2021-2025