6 Unfortunately, no single existing piece of software satisfies the
7 above specification. It seems like everyone writes their own USB
8 installer; after the following round-up has been made, this is no
9 surprise at all: since such tools are designed to be dead easy for the
10 non-technical end-user, every author selects the few features that are
11 the most important ones for their intended audience, and generally
12 writes a very ad-hoc piece of software. Therefore, every Live system
13 project whose needs are slightly different from the others needs to
14 write its own USB installer, possibly reinventing more or less wheels
17 We need to see if we can turn one of those tools into something that
18 satisfies our specification; sadly, proceeding this way *without
19 forking the existing tool* would probably need more initial
20 development time than writing a new installer from scratch; we are not
21 even sure any upstream author of such a software (good enough to be a
22 possible viable basis) would want to make it more generic and maintain
23 it this way; on the other hand, if we avoid forking or writing from
24 scratch, we also avoid maintaining a Tails-specific tool on the long
30 Wikipedia has a [[!wikipedia List of tools to create Live USB systems]]
33 * `live-installer` udeb and its `live-installer-launcher` desktop
34 companion allows to run the Debian Installer from the bootloader;
35 paraphrasing the manual: the "Live" Debian Installer flavour will
36 proceed in an identical fashion to the normal installation but at
37 the actual package installation stage, instead of using
38 `debootstrap` to fetch and install packages, the "live" filesystem
39 image is copied to the target. After this stage, the Debian
40 Installer continues as normal, installing and configuring items such
41 as bootloaders and local users, etc. This must be tested.
43 > Not usable without a lot of work: there is way too many
44 > questions asked, the graphical interface overlaps the
45 > panels (hence unreachable buttons), it tries to create
46 > a new user account, etc. Forget it, even if it was nice
47 > to have partman handy to configure partitions and
50 * `live-boot`'s `todisk=DEVICE` boot parameter could be used to copy
51 the entire read-only media to the specified device; the process
55 2. use some documentation or GUI to partition the USB stick and take
56 note of its device name
57 3. reboot; at syslinux prompt add the `todisk=DEVICE` parameter
58 using the previously noted device name; then let the system boot
59 once from the USB stick, and use some documentation or GUI to
60 install a bootloader on the USB stick. This step might be
61 automated in live-boot.
62 4. reboot and eject the CD: the system should now boot from USB.
64 This only works for the "clone existing system" usecase, though.
66 * Ubuntu's [usb-creator](https://launchpad.net/usb-creator)
67 - supposed to replicate exactly the CD to USB
68 - how does it handle partitions?
70 * [UNetbootin](http://unetbootin.sourceforge.net/)
71 - works on Windows and GNU/Linux
72 - has a plugin architecture that only allows rebranding and
73 pre-selection of the available distributions list
74 - included in squeeze and sid, easily backported to Lenny
75 - works like a charm to install an ISO image to USB, but the
76 syslinux menu has the unetbootin logo instead of Debian's one;
77 the installed syslinux defaults to the first menu entry (in
78 Tails case, Arabic); are the other bits of syslinux menu (Debian
79 Live help and so on) here?
81 - non-destructive install: does not format the chosen partition
82 - no support for partitioning nor persistent storage
83 - works from a running Live CD; specify /dev/cdrom as ISO diskimage
84 - how would upgrading work?
86 * [Ubuntu LiveUSB](http://klik.atekon.de/liveusb/)
87 - (a bit too) simplistic
88 - dedicated to "create a bootable Live USB medium from a running
90 - depending on sources, it partitions USB stick with one single
91 800MB partition or one partition using the whole device; in any
92 case, it unconditionally overwrites the device's content
93 - able to upgrade without re-partitioning the device?
94 - [launchpad](https://launchpad.net/liveusb)
96 * aptosid's `aptosid-on-a-stick` needs an input ISO (check again), and
97 lacks partitioning capabilities, but it still deserves being looked
98 at more thoroughly; see the
99 [manual](http://manual.aptosid.com/en/hd-install-opts-en.htm#usb-hd).
101 * Fedora's `livecd-iso-to-disk`:
102 - [manual](http://fedoraproject.org/wiki/FedoraLiveCD/USBHowTo)
103 - [Gitweb](http://git.fedorahosted.org/git/?p=livecd)
104 - cleanly and defensively written in Bash
105 - supports creating a file-backed filesystem for `$HOME`,
106 LUKS-encrypted by default, in the same partition where the Live
110 * Fedora's [liveusb-creator](https://fedorahosted.org/liveusb-creator/):
111 - works on Windows and GNU/Linux
112 - "non-destructive install", which means?
113 - supports FAT and EXT filesystems
114 - persistent storage creation: file-backed filesystem, no
115 partitioning capabilities
116 - actively developed (as of early 2011)
118 - input: ISO file or real CD
119 - output: extracts ISO's content to the partition
120 - does not use `livecd-iso-to-disk`
121 - needs to be slightly adapted/extended to support non-Fedora Live
122 systems, e.g. some directory names must be made configurable
123 - sidux ships a modified version:
124 - [.deb](http://sidux.office-vienna.at/sidux/debian/pool/main/l/liveusb-creator/),
125 - [source](http://w3you.com/liveusb-creator/liveusb-creator.htm)
127 * [RIP’s mkusb](http://rip.7bf.de/current/mkusb.sh) and its
128 [README](http://rip.7bf.de/current/mkusb.txt)
130 * SUSE Studio Image Writer([[!wikipedia SUSE Studio ImageWriter]],
131 [KIWI homepage](http://kiwi.berlios.de/), [source
132 code](http://git.berlios.de/cgi-bin/gitweb.cgi?p=kiwi;a=tree;f=tools/burner))
133 - supports Windows and GNU/Linux
134 - persistent storage creation - that is?
138 * [FUSBi](http://aligunduz.org/FUSBi/)
139 - modified from UNetbootin; what are its enhancements?
140 - supports Windows and GNU/Linux
141 - no release in 2009 nor 2010
143 * Incognito's `root_overlay/usr/sbin/create-usb` seems quite nice, as
144 it allows using an existing fat32 partition.
145 - no partition capabilities
147 * Liberte Linux' `burn-usb` (old — 2010.0) creates a FAT32 partition for data and
148 an ext2 partition where it copies the system to. It installs Grub on
151 * [Mandriva Seed](http://git.mandriva.com/?p=projects/mandriva-seed.git;a=summary)
152 - supports Windows and GNU/Linux
153 - fork of Fedora's liveusb-creator; what are its enhancements?
156 Writer](http://git.moblin.org/cgit.cgi/moblin-image-creator/plain/image-writer)
158 - simple dd wrapper with proper sanity checks
160 * [usb-imagewriter](https://launchpad.net/usb-imagewriter)
161 - seems like a clone of the good old rawwrite with no more feature
164 * <http://wubi-installer.org/>: Windows installer for Ubuntu.
166 * [makebootfat](http://advancemame.sourceforge.net/boot-readme.html):
167 command line utility able to create bootable USB disks
168 using the FAT filesystem and syslinux
169 - available in Debian
170 - able to autodetect/format/populate the USB disk in a
171 single step without any user interaction
172 - able to create disk images which are compatible with all the
173 three standards USB-FDD, USB-HDD and USB-ZIP at the same time
174 - if it supported partitioning as well, and supported Windows, it
175 could be used to do most of the low-level work
182 ### Grub2's loopback support
184 Debian Live now supports Grub2 and `fromiso=`. The grub.cfg that is
185 generated inside the binary image could be copied, adapted and used to
186 (loopback) boot an ISO dropped on a USB stick.
188 Here is how to test this.
190 0. Build a Debian Live iso or iso-hybrid image with a working
191 `live-boot` installed in it, i.e. at least 2.0.12 (warning: Tails
192 0.6 series ship a buggy version).
193 1. Create a ext2 filesystem on a USB stick partition.
194 2. Copy a Tails ISO file **at the root** of the USB stick partition.
195 3. Run `ln -s . boot` at the root of the (mounted) USB stick partition.
196 4. Install Grub2 on the USB stick MBR, using the USB stick partition
197 as `--root-directory`.
198 5. Create a `grub.cfg` file in there and try a menu entry like this:
200 menuentry 'test' --class debian --class gnu-linux --class gnu --class os {
205 set root='(hd0,msdos1)'
206 search --no-floppy --fs-uuid --set=root b51975cd-c5ef-4b32-996a-2c8206516917
207 loopback loop /binary.iso
208 linux (loop)/live/vmlinuz boot=live fromiso=/dev/sda1/binary.iso config
209 initrd (loop)/live/initrd.img
214 * `insmod ext2` is because the partition that hosts Grub2 and the ISO
216 * `(hd0,msdos1)` and the search UUID match this partition as well,
217 from Grub2 point-of-view
218 * `/dev/sda1` is a path to this partition block device from inside the
220 * `/binary.iso` is the path to the ISO file, relative to the root of
222 * `/live/vmlinuz1` and `/live/initrd1.img` are respectively the path
223 to the kernel and ramdisk relative to the root of the ISO filesystem
224 * `boot=live` enables `live-boot` and thus `fromiso=`
225 * `config` enables `live-config`
227 This might fails at kernel load time with following error:
229 error: invalid magic number
231 In that case you probably need a newer Grub2 (see [[!debbug 543924]]
236 1. On some versions of Tails, this breaks the [[emergency
237 shutdown|contribute/design/memory_erasure]] on media removal.
238 2. This is by no means a supported installation method. E.g. the
239 kernel parameters shall be manually updated when replacing the ISO
244 In the above example, the Grub2 configuration file must contain
245 information about the partition where the ISO file is stored.
247 Doing this is feasible at install time, and ensures the ISO will be
248 loaded from the right partition, rather than from a rogue one on the
249 host system's hard-disk.
251 Other Live systems that don't face the same threat model as Tails tend
252 to prefer using automagic ISO loopback support so that Grub2 itself
253 finds a partition where a properly named ISO is stored, e.g. using
254 [GRML's patches against
255 live-boot](http://git.grml.org/?p=live-boot-grml.git;a=tree;f=debian/patches)
256 that add the `findiso=` boot parameter (by the way, does it respect
257 `live-media=removable` ?); here is how they boot things up:
259 - GRML (`grml-rescueboot` flavor) [now supports booting using Grub2
260 loopback](http://michael-prokop.at/blog/2011/01/07/booting-iso-images-from-within-grub2/)
262 http://blog.cyphermox.net/2010/10/booting-to-iso-images-from-usb-key.html
264 [loopback.cfg](http://www.supergrubdisk.org/wiki/Loopback.cfg) might
266 upstream](http://lists.gnu.org/archive/html/grub-devel/2010-09/msg00080.html).
268 ### Grub2 combined with syslinux' memdisk
270 This is used by some in combination with Grub2, in place of its
271 loopback support. The [memdisk
272 page](http://syslinux.zytor.com/wiki/index.php/MEMDISK) on the
273 syslinux wiki tells the whole low-level story and more.
277 - GRML (`grub-imageboot` flavor) [now supports booting using
278 Grub2+memdisk](http://michael-prokop.at/blog/2011/01/07/booting-iso-images-from-within-grub2/);
279 according to this blog post, support for doing this is in live-boot
280 2.0.14-1. The memdiskfind/phram/mtdblock approach this blog post
281 talks of would ease cloning an existing Tails system, since it is
282 supposed to provide a `/dev/mtdblock0` device, which should be the
283 .ISO image. See the [details on the memdisk wiki
284 page](http://syslinux.zytor.com/wiki/index.php/MEMDISK#-_memdiskfind_in_combination_with_phram_and_mtdblock).
286 post](http://blog.snow-crash.org/2010/11/cool-things-with-grub2-and-syslinux---booting-floppy-and-iso-images.html)
287 with a snippet for `grub.d` to automate booting ISO images from
288 Grub2, using syslinux' memdisk
290 ## extlinux and memdisk
292 According to Philip Hands, who proposed this solution on [[!debbug
293 534887]], it is possible to use extlinux merely to chainload the
294 image's own bootloader.
299 Various scripts, such as [Benjamin FOURTICQ's
300 one](http://www.mail-archive.com/debian-live@lists.debian.org/msg01832.html),
301 aim at adding a persistent home-rw partition to a Debian Live disk
302 image, generally using losetup and parted. They don't suit Tails
303 specification as they depend on knowing in advance the size of the
304 persistent volume the user wants to setup and obviously cannot setup
305 encryption on it in place of the user.