I recently created a bootable usb thumb drive for installing Kubuntu on different computers at work. I also planned to to use this device as a live system for the rare instances where I need another Linux system in my office to test things. Creating the bootable drive was a piece of cake with the usb-creator-gtk package.

Today I wanted to test out some cool stuff like dns2tcp, ptunnel, stunnel and ppp. I pulled out my thumb drive, smacked it into an available machine and booted off the cool little guy. I quickly found that I needed to install more packages and as I did, I ran out of space in the 128 MB that I had allocated for “extra space” on the 4GB drive.

Yeah it was obviously a dumb move to only allocate 128 MB for my /home and customizations. The fun thing about Linux is where there is a stupid mistake there is a chance to learn something new and do something fun, if you like that sort of thing.

As it turns out usb-creator-gtk creates a file in the root of the drive called casper-rw. This file is an ext3 filesystem image and is what contains most of the writable data in your live environment. All I needed to do to get some more space (provided that drive wasn’t physically full) was to enlarge this file and then resize the ext3 filesystem inside the file to be able to use all of the newly available space in the file.

Oblig Warning: Only do this if you understand what these commands do and agree that they are the best course of action for your situation. Use at your own risk.

The following steps where taken from a computer which was running Kubuntu Karmic. You must not be running in the live environment on the usb device when doing this procedure.

  1. span class=”st0″>’e2fsck -f casper-rw’