I think you're getting the memory spaces confused.
First off, there are two processors on the Yun board:
- ATmega32U4 - an 8 bit processor that runs the Arduino sketch and manages the shield I/O pins
- AR3391 - a 32 bit ARM core system on a chip that runs Linux and manages the networking and SD card
The '32U4 has 32 kB of internal flash where the sketch is loaded, and 2.5 kB of internal RAM for variables.
The AR3391 has 16 MB of flash, and 64 MB of RAM. A portion of that on-board flash is set up to emulate a disk drive, and is used to boot Linux. This processor also has a socket for an optional SD card for additional storage.
The memory regions of the two processors are completely independent, and one processor's memory cannot be used in any way by the other processor.
Before running the disk expander sketch, the AR3391 boots Linux from the on-board flash memory's emulated disk drive. Any software that is installed, or data files that are created, are actually stored in the limited on-board flash memory space. If an SD card is inserted, that memory is available as an additional data storage volume.
After running the disk expander sketch, the AR3391 still starts booting Linux from the on-board flash memory's emulated disk drive, but partway through the process it maps a disk volume from the SD card as the system root volume, and continues booting from there. Once fully booted, any software that is installed, or data files that are created, are actually stored on the SD card, not in the on-board flash memory space, even if stored to the system file areas.
Now, to successfully run the disk expander sketch the sketch must be loaded into the '32U4 processor's internal flash, the AR3391 processor must be booted up from on-board flash, and that on-board flash must have enough free space to install the required card formatting and volume copying utilities.
The insufficient disk space message is referring to the emulated file system in the AR3391's on-board flash. Before you tried running the disk expander sketch, I'm guessing that you have installed some software on the Linux drive (or created some large files) and got messages about low disk space. That's probably what prompted you to run the disk expander sketch. If that's the case, you will need to uninstall some of the software packages, delete some of the large files you created, or reset the board to factory defaults (which will undo everything you've done so far.)
Once you free up some space on the on-board Linux file system (which is in on-board flash memory) you should be able to run the expander sketch.