USBInstallationImages

Revision 3 as of 2008-06-10 15:44:01

Clear message

Summary

An application will be developed to convert and write Ubuntu CD images to USB disks. In addition, our existing tools will be modified to better handle installing from a removable disk.

Release Note

It is now possible to install Ubuntu from a USB disk. Just install and run the usb-installer package, then insert a USB disk into your computer to create an installation image.

Rationale

  • CDs are slow, unreliable media.

Use Cases

  • Evan would like to install Ubuntu, but his laptop does not have a CD-ROM drive.
  • Joe would like to test and install Ubuntu, but he finds CDs to be too slow.

Design

A utility will be written that takes a CD or ISO file as input and writes its contents in a somewhat modified form to an inserted USB disk of the user's choosing. This is done instead of shipping another binary blob because a large amount of bandwidth is already required to host cdimage, and because even if more bandwidth was available, a user friendly tool to easily write disk images to devices is not readily available on most systems anyway.

The utility will first be written for Ubuntu and then written for Windows and Mac OSX, sharing code between the three applications if possible. Only the completion of the Ubuntu utility will be required for this specification to be considered complete for Ubuntu 8.10. The Windows and OSX applications will only be considered if there is sufficient time available.

+----------------------------------------------------+
|         Create an Ubuntu desktop USB disk          |
|                                                    |
| This utility will copy Ubuntu from the inserted CD |
| onto your USB disk so that you may boot from your  |
| USB disk and try or install Ubuntu.                |
|                                                    |
| Files will be copied from:                         |
| Ubuntu 8.04 Desktop CD                             |
|                                                    |
| Select an USB disk to use:                         |
| [ SanDisk Cruzer Micro |v|]                        |
|                                                    |
| How much space should be used?  Additional space   |
| will be used for persistent storage.  If no        |
| additional space is selected, persistent storage   |
| will be disabled and changes made when in Ubuntu   |
| will not be permanent.                             |
| [=======================================V--------] |
|                1.5 GB (500 MB free)                |
|                                                    |
|                              [ Quit ] [ Install ]  |
+----------------------------------------------------+

+----------------------------------------------------+
|         Create an Ubuntu desktop USB disk          |
|                                                    |
| This utility will copy Ubuntu from the inserted CD |
| onto your USB disk so that you may boot from your  |
| USB disk and try or install Ubuntu.                |
|                                                    |
| Files will be copied from:                         |
| Ubuntu 8.04 Desktop CD                             |
|                                                    |
| Select an USB disk to use:                         |
| [ SanDisk Cruzer Micro |v|]                        |
|                                                    |
| There is insufficent space on the USB disk you     |
| have selected.  Please delete some unneeded files  |
| off the disk before continuing.                    |
|                                                    |
|                              [ Quit ] [ Install ]  | <- greyed out
+----------------------------------------------------+

+----------------------------------------------------+
|         Create an Ubuntu desktop USB disk          |
|                                                    |
| This utility will copy Ubuntu from the inserted CD |
| onto your USB disk so that you may boot from your  |
| USB disk and try or install Ubuntu.                |
|                                                    |
| Files will be copied from:                         |
| Ubuntu 8.04 Desktop CD                             |
|                                                    |
| Select an USB disk to use:                         |
| [ SanDisk Cruzer Micro |v|]                        |
|                                                    |
| How much space should be used?  Additional space   |
| will be used for persistent storage.  If no        |
| additional space is selected, persistent storage   |
| will be disabled and changes made when in Ubuntu   |
| will not be permanent.                             |
| [=======================================V--------] |
|                1.5 GB (500 MB free)                |
|                                                    |
| This USB disk already has a boot sector.  If you   |
| continue with the install it will be overwritten.  |
|                                                    |
|                              [ Quit ] [ Install ]  |
+----------------------------------------------------+

+----------------------------------------------------+
| +------------------------------------------------+ |
| |=================                               | |
| +------------------------------------------------+ |
|                  Copying files...                  |
+----------------------------------------------------+
  • Like ubiquity, it will not include a cancel button once the process has started. This can later be changed, if desired, by first backing up the MBR before making any changes and recording a list of the files it copies so that canceling the process reverts any changes. If the disk was blank to start with, then we would just wipe it.
  • Perisistence will be enabled by default using the existing support for a casper-sn.ext2 loopback ext2 filesystem.
  • The slider for space to use will stop at 700 MB, indicating no persistance.

Support in the installer

Because, unlike CDs, USB disks are treated like regular disks, modifications will need to be made to partman, ubiquity, and grub in order to better support installation from these devices.

Implementation

Language and toolkit selection

We will use Python for the programming language as it's cross-platform and the developers are familiar with it. As it's not readily available on Mac or Windows, we can either bundle it, or in the case of Windows use IronPython to run it on the .NET CLR.

We will use GTK for the Ubuntu frontend. The Windows and Mac frontend toolkits will be determined later.

Installer changes

  • Partman will need to filter out a disk if the installation files reside on it.
  • As the position of a USB disk in the device list and its presence can change often, grub will need to be modified to support the use of UUIDs as a replacement for its existing device notation. Grub-installer and update-grub will also need to be modified to use UUIDs instead of the existing device notation.
  • Given the above change, ubiquity will be modified to default to installing the bootloader to the UUID of the device selected during partitioning instead of its existing default of "(hd0)".

UI Changes

While modifications will need to be made to ubiquity, no user interface or string changes should be necessary.

Test/Demo Plan

  • As KVM supports booting from USB devices, it will be used to test for bugs related to installing from such a device.

BoF agenda and discussion

Targets

  • Ubuntu desktop installable USB key
  • Netbook/Classmate installation
  • Ubuntu Mobile? (much less user interaction required/desired)
  • Ubuntu alternate installable USB key
  • Ubuntu server installable USB key

Design

  • Don't want to ship (and mirror) yet another 700M blob
  • Prefer to have a tool which accepts an Ubuntu .iso as input and writes the necessary bits to a USB stick
  • Linux-only tool in first iteration, Windows later (unless volunteers materialise)
    • Write in Python, use IronPython to ship .NET object code?

    • Windows can also boot a live CD and transform to USB stick

Advantages

  • No CD waste
  • Possibility to have 1 Gb ubuntu image (300 more Mb of space)
  • No need for optical drive
  • Faster. (USB has 480 Mb per second and CD-ROM 52X has 62 Mb per second)

Notes from previous discussion (UDS-Seville)

Live/Install from USB key

  • Much faster for ISO testing
  • Avoid "CD blanks"
  • Works on machines without optical drive
  • USB key is a mass storage device (a hard drive)
    • Rather than a floppy disk

Use cases

Results

  • Modify installer to check for:
    • /ubuntu*.iso containing either a .deb local repo

      • Already done for hd-media installer (alternate-style)
    • Live Ubuntu image containing a squashfs
  • Prefer copying entire file tree to USB image
    • Simpler
    • Guaranteed to work even with 4.3GB DVD images (VFAT limit is 4.0GB)

Needs research

  • Relationship to smart-boot-manager
  • Syslinux/isolinux
    • Syslinux wrapper writes a bootsector "blob" to the front of the CD
      • opens as vfat with mtools
      • writes out ldlinux.sys
      • copies syslinux code (ldlinux.bss) into bootsector
  • We can do the equivalent under MS Windows (rawrite) provided that we ship the two files above on the CD
    • Question: can we access the raw device without Administrator privileges?
  • http://www.weethet.nl/english/hardware_bootfromusbstick.php

    • Method involving the MS Windows formatting "[x] Create start up disk".

Targets

  • Desktop CD/DVD on USB --- (direct dd > /dev/sdb); should work but believed to be buggy at the moment

  • Desktop CD/DVD on USB with local ISO --- not interesting (except for having a small bootstrap image)
  • Desktop CD/DVD on USB with persistence
  • Netboot on USB with network fetch
  • Netboot on USB with local alternate .iso

Wants

Transformation utility that takes a .iso image and it works out what to do with it

Should work for Linux and Windows, so possibly two separate applications

  • "Write to USB key?"
  • MAKE THE DESKTOPCD ON USB WORK.
    • Makes ISO testing easier
    • The place where we have less technical users.
    • Persistence?
    • ALREADY COVERED BY WUBI!
  • Casper to look for .iso and look inside for squashfs, mount boot that
    • Hunt though top-level directories
      • Modify checkdev in casper, recurse one level.
        • Already done for wubi installer.
  • Make persistency not check for partition label
  • Copy /contents/ of .iso image to vfat.
  • Copy .iso to USB stick
  • Fish vmlinuz and initrd out of .iso
  • Run syslinux
  • Make a Unix script to do this
  • Ask somebody to reimplement for MS Windows
  • Point to this from the CD download pages.
  • Provide a mini DesktopCD dd-able image of the above.


CategorySpec