Debian Codegraph @

doc/source/example_use_cases/iso_to_usb_stick_file_based_deployment.rst

raw
1 .. _iso_as_file_to_usb_stick:
2
3 Deploy ISO Image as a File on a FAT32 Formatted USB Stick
4 =========================================================
5
6 .. sidebar:: Abstract
7
8 This page provides further information for handling
9 ISO images built with {kiwi} and references the following
10 articles:
11
12 * :ref:`hybrid_iso`
13
14 In {kiwi}, all generated ISO images are created to be hybrid. This means,
15 the image can be used as a CD/DVD or as a disk. The deployment of such
16 an image onto a disk like a USB stick normally destroys all existing
17 data on this device. Most USB sticks are pre-formatted with a FAT32
18 Windows filesystem, and to keep the existing data on the stick untouched,
19 a different deployment needs to be used.
20
21 The following deployment process copies the ISO image as an
22 additional file to the USB stick and makes the USB stick bootable.
23 The ability to boot from the stick is configured through a Grub2
24 feature that allows you to loopback mount an ISO file and boot the
25 kernel and initrd directly from the ISO file.
26
27 The initrd loaded in this process must also be able to loopback
28 mount the ISO file to access the root filesystem and boot the
29 live system. The dracut initrd system used by {kiwi} provides this
30 feature upstream, called "iso-scan". Therefore, all {kiwi}-generated
31 live ISO images support this deployment mode.
32
33 For copying the ISO file to the USB stick and the setup of the
34 Grub2 bootloader to make use of the "iso-scan" feature, an extra tool
35 named `live-grub-stick` exists. The following procedure shows how
36 to set up the USB stick with `live-grub-stick`:
37
38 1. Install the `live-grub-stick` package from software.opensuse.org.
39
40 2. Plug in a USB stick.
41
42 Once plugged in, check which Unix device name the FAT32 partition
43 was assigned to. The following command provides an overview of all
44 storage devices and their filesystems:
45
46 .. code:: bash
47
48 $ sudo lsblk --fs
49
50 3. Call the `live-grub-stick` command as follows:
51
52 Assuming "/dev/sdz1" was the FAT32 partition selected from the
53 output of the `lsblk` command:
54
55 .. code:: bash
56
57 $ sudo live-grub-stick {exc_image_base_name_live}.x86_64-{exc_image_version}.iso /dev/sdz1
58
59 4. Boot from your USB Stick.
60
61 Activate booting from USB in your BIOS/UEFI. As many firmwares have different
62 procedures on how to do it, look into your user manual.
63 EFI booting from an ISO image is not supported at the moment. For EFI booting,
64 use the --isohybrid option with live-grub-stick; however, note that all the data
65 on the stick will be lost.
66 Many firmwares offer a boot menu that can be activated at boot time.
67 Usually, this can be reached by pressing the :kbd:`Esc` or :kbd:`F12` keys.