One of the Christmas presents I haven’t really mentioned on here was a 4GB USB stick. Seeing as I already had a 2GB one that’s about half-full with the majority of the data on it being Knoppix, I decided it was time to go extreme with portable computing and see if I could load a full-featured Linux distribution onto a USB stick in a rewritable, fully production-worthy package.
I chose Fedora because it’s my favorite desktop distribution, because Ubuntu doesn’t migrate between computers too easily, and because in this case it just works. Installation went quite well, though I had to boot Nighthawk natively because anaconda had problems under VMware.
Keeping enough free space to work comfortably is mildly difficult. Being an Enano developer I naturally need MySQL, Apache, and PHP on there, so that’s at least 100MB. A base installation of Fedora with the usual and expected trimmings is about 3GB. So, accounting for jEdit, Blender, and some other non-standard apps, I ended up with only 300 megs free. I decided OpenOffice.org wasn’t important, so I let it go and reclaimed 300MB. Eventually I ended up with a comfortable 600MB or so, and by now I’ve got it up to 650MB.
One of the coolest tricks you can do with Linux is transparent encryption of a filesystem. Because I have IM accounts, SSH keys, etc. in my home directory I decided it would be a good idea to encrypt it. (No, going without my SSH key just isn’t an option.) I know cryptoloop is deprecated but I decided anyway to make a simple init script that loads the aes and cryptoloop modules, prompts for the passphrase, sets up the loop device, and mounts it using the usual losetup/cryptoloop approach. The cool thing about this is that losetup does properly prompt for the passphrase in RHGB, so entering at startup is nothing short of painless. I also figured out that you can reboot the system after 3 incorrect password attempts, though I suppose a half-experienced hacker could remove that constraint.
So what are the advantages of such a setup? Basically I can code Enano and log into my network anywhere. Anywhere. Even if I don’t have my laptop, any half-modern computer can boot from my USB stick and give me Compiz, Firefox, jEdit, and (soon) VPN-over-SSH access.
For those of you who want to replicate this, it really couldn’t be easier with anaconda. Just plug your USB drive in, boot the system from your Fedora DVD, and install, making absolutely sure that GRUB goes on to your flash disk instead of to your hard disk’s MBR (that can be a pain to fix!). Happy Fedora-hacking!