USB Ubuntu Install from Linux

USB Ubuntu Install from Linux; Install Ubuntu to a flash drive from a Live Linux CD This tutorial enables you to install, boot and run Ubuntu Linux from USB. When booting in persistent mode, it uses a second "casper-rw" partition. The Persistence feature allows you to save some of your changes back to the drive, and then optionally restore them upon each system boot.

The tutorial is similar to the USB Ubuntu installation tutorial for Windows users with the exception that it was written with a Linux user in mind. If you're already working from the desktop environment and do not have access to or prefer not to use a Windows computer, this tutorial is for you.

Ubuntu running from USB

USB Ubuntu Edgy Install

Distribution Home Page: Project Page

Minimum Flash Drive Capacity: 1GB

Persistent Feature: Yes

USB Ubuntu Boot Requirements

  • Ubuntu.ISO (Process performed from Live CD)
  • CD Burner/Recorder
  • USB flash drive

USB Ubuntu Install to a Flash Drive from Live CD

  1. Download the ISO and burn it to a CD.
  2. Reboot your computer booting from the Live CD.
  3. Insert a USB flash drive.
  4. Open a terminal window ctrl+alt+t and type sudo su
  5. Type fdisk -l to list available drives/partitions. Note which device is your flash drive (example: /dev/sda) Throughout this tutorial, replace x with your flash drive letter. For example, if your device is sdb, replace x with b.
  6. Type umount /dev/sdx1
  7. Type fdisk /dev/sdx
    • type p to show the existing partition and d to delete it
    • type p again to show any remaining partitions (if partitions exist, repeat the previous step)
    • type n to make a new partition
    • type p for primary partition
    • type 1 to make this the first partition
    • hit enter to use the default 1st cylinder
    • type +700M to set the partition size
    • type a to make this partition active
    • type 1 to select partition 1
    • type t to change the partition filesystem
    • type 6 to select the fat16 file system
    • type n to make another new partition
    • type p for primary partition
    • type 2 to make this the second partition
    • hit enter to use the default cylinder
    • hit enter again to use the default last cylinder
    • type w to write the new partition table
  8. Type umount /dev/sdx1 to ensure the 1st partition is unmounted
  9. Type mkfs.vfat -F 16 -n usb /dev/sdx1 to format the first partition
  10. Type umount /dev/sdx2 to ensure the 2nd partition is unmounted
  11. Type mkfs.ext2 -b 4096 -L casper-rw /dev/sdx2 to format the second partition
  12. Remove and Re-insert your flash drive
  13. Back at the terminal, type sudo apt-get install syslinux mtools
  14. Type syslinux -sf /dev/sdx1
  15. Download this custom usyslinux.tar file using the archive manager and extract the syslinux.cfg file to your "USB" stick
  16. Type cd /cdrom
  17. Type cp -rf casper disctree dists install pics pool preseed .disk isolinux/* md5sum.txt README.diskdefines ubuntu.ico casper/vmlinuz casper/initrd.gz install/mt86plus /media/usb/
  18. Reboot your computer and set your system BIOS to boot from USB-HDD or USB-ZIP. Also set the boot priority if necessary.

If everything has gone as it should, you should now be able to boot Ubuntu from the USB stick. The system should automatically save your changes, and then restore them during boot.

Note: If you're having trouble getting Ubuntu to boot, your memory stick may have a corrupted mbr. To repair the mbr of your USB device, at the terminal type sudo apt-get install lilo then type lilo -M /dev/sdx (replacing x with the letter of your flash device).