Partition resize was broken
January 10, 2017 —
BarryK
At first bootup of Quirky on the Raspberry Pi, QuickSetup runs. This is a GUI to quickly make basic configuration choices.
One thing it does is check if there is unused space at the end of the drive. This will occur if the drive is bigger than the image-file written to it. Quirky is supplied as a compressed image file, that expands to a nominal 8GB -- but it is actually a bit smaller, so as to fit on any "8GB" SD-card.
So even on an 8GB card there is going to be a bit of unused space at the end. Much more so if you use a 16GB or 32GB SD-card.
QuickSetup checks if there is more than a few hundred MB empty space at the end of the drive, and if so, offers to resize the Quirky partition to fill the entire drive.
OK, this works on the Pi. However, I discovered yesterday that it does not work on a PC. The reason is, I supplied Quirky Xerus 8.1.5 x86_64 as a 8GB USB Flash stick image, with a GPT (Guid Partition Table).
The partition resizing fails with a GPT, due to the use of Busybox 'fdisk'. My "easyinit" ramdisk has Busybox in it, compiled statically. I have written about Easyinit in earlier posts.
However, the full 'fdisk' utility, in the 'util-linux' package, can handle the partition resizing in a drive with GPT.
I have compiled fdisk statically in Buildroot, so have added that to Easyinit.
This fix applies to Quirky Xerus and the soon-to-be-released SlaQ X86_64 Linux distributions.
Tags: linux