RECOMMENDED: ADVANCED USERS ONLY
NOTE: THIS IS A FULL INSTALLATION OF UBUNTU. THIS IS NOT A LIVE USB STARTUP DISK.
My roommate and I have successfully created a USB flash drive that runs Ubuntu and will boot on any PC or Intel Mac, capable of USB booting.
1. One (1) Flash Drive with a minimum of 4GB of free space **
2. Ubuntu Live CD
3. Working disc drive
4. Intel Mac (only for compatibility with Intel Macs)
** Recommend: Do NOT use flash drives with U3 Smart capability (e.g. GeekSquad flash drives).
** Only required for making bootable on Intel Macs. Must use a Mac to install rEFIt initially.
1. Reformat entire flash drive to FAT32.
For Macs, use Disk Utility to format to FAT.
For Windows, right-click on drive and select format to FAT32.
For Ubuntu, use gparted and format to FAT32.2. Reboot with Live CD and USB flash drive in place.
3. On Live CD menu, select "Install Ubuntu."
4. Continue through installer until you reach the partitioning step, step 4 of 7.
5. Select "Guided - Use Entire Disk" and select flash drive.
WARNING: Do NOT select your internal hard drive.6. Continue until you reach step 7 or 7, Ready To Install, select "Advanced" before continuing.
7. Check "Install Boot Loader" and device set for installation is the USB flash drive.
8. Select "Okay" and then "Install."
9. Reboot and remove the CD.
FOR PC USERS (IF MAC USER, SKIP TO MAC SECTION BELOW):
10. Your drive is now capable of booting onto any PC (not Mac) capable of booting from a USB device.
11. Change BIOS to boot from USB.
12. To also make your drive capable of booting on Mac, continue to Mac section below.
FOR MAC USERS:
10. Reinsert Ubuntu Live CD.
11. Boot from CD by holding "C" on startup.
12. Select "Try Ubuntu."
13. Open a new terminal.
14. Run the command 'sudo apt-get install gparted'.
15. Within terminal, type 'gparted'.
16. Gparted GUI will open: select flash drive (in top right corner drop down menu).
17. Right click swap partition, and select 'Swap Off'.
18. Right click swap partition again, select 'Delete'.
19. Right click on extended partition, select 'Delete'.
20. There will now be two partitions, one containing Linux and the other unallocated.
21. Right click the unallocated partition, select 'format'.
22. Format partition to FAT32, and click 'Apply'.
23. Exit gparted.
24. Reboot, remove CD, and boot into Mac OS X.
25. Open Disk Utility (/Applications/Utilities/Disk Utility).
26. Format the unallocated partition (the one that was previously the swap) to 'Apple OS Extended - Journaled'.
27. Open the rEFIt disc image, and copy the folder 'efi' to the root directory of the unallocated partition.
28. Open Terminal (/Applications/Utilities/Terminal) and run the command 'cd /Volumes/MyDrive/efi/refit' where 'MyDrive' is the name of your USB flash drive.
29. Next run the command './enable.sh' in Terminal. NOTE: You must have administrator privileges to do this.
30. Quit Terminal, reboot the computer, and hold the Option key on startup. You will see Mac OS X and and rEFIt next to each other. Select rEFIt, and you will be asked which OS you want to boot into. Select Linux and enjoy.
After following these steps, you will have a flash drive that is fully capable of loading Ubuntu onto any PC (that can boot from USB) and any Intel Mac.
NOTE: This drive will NOT work on PowerPC Macs (any Mac that is not using an Intel processor).
While this would likely work with many other Linux distros, it has only been tested with Ubuntu. The PCs used in testing this were a HP and a Dell. The Mac used in testing this drive was a 1st Gen MacBook Pro. After multiple boots on all three computers, and additional installations on other flash drives, this method has shown to be very reliable. Following the above steps exactly, there have been no apparent issues on any trial.
All drives used in the trials were PNY 8GB flash drives.
Since the swap partition no longer exists, it is recommended that you set turn swappiness off. You can do this by running a terminal in Ubuntu, opening the file '/etc/sysctl.conf' and adding the line 'vm.swapiness=0'.
About The Authors:
The two of us (Robin and Kellen) are roommates at Iowa State University. Robin is an undergraduate studying Psychology and Kellen is an undergraduate studying Aerospace Engineering. Our inspiration for this project was that we wanted a way to have a stable operating system be "plug 'n' play" and be usable on (almost) any computer. In addition, it is of particular use to Kellen, who can now do all his programming for engineering classes via his pocket-size operating system. It took one very long night, but we succeeded. Beforehand, though, we did search for quite some time and was not able to find any 'how to' on going about this task.
Robin and Kellen