Making bootable USB flash drives from ISO images 15 Jul 2019 GLF ------------------------------------------------------------------------------------------------------ Boot from DVD or USB --------------------- The GLFPE live boot ISO images may be burned to DVD-R+ to make a bootable OS, but more often the user will wish to burn to USB instead. The Debian build system produces hybrid ISO images which are capable of booting from USB as well as DVD-R when copied directly to the USB drive (dd command in Linux). As of the release of Debian 10 (July 2019), the AMD64-based ISO builds for GLFPE Linux 600 series based on Debian 10 share with the officially released Debian Live ISO images the ability to boot in Secure Boot mode, as well as Legacy and UEFI modes. At this writing, the equivalent 686 based builds DO NOT boot in Secure Boot mode, though apparently the Debian project plans to correct that if possible in future. The simplest way to make an ISO image bootable is to burn it to DVD. The GLFPE Linux ISOs are large, between 3 and 4 Gb in size, so CDROM is too small. DVD burner software is included in GLFPE Linux, and is readily available for Windows. The ISOs should boot with a full GLFPE custom Live boot menu, which includes installation options, in Legacy mode on either ADM64 or 686 PCs. In UEFI boot mode, the DVD should boot with a limited Live menu. In addition, AMD64-based DVDs built with Debian 10 should be able to boot in Secure Boot mode. It is also possible to copy a GLFPE Linux ISO image to a USB flash drive, either singly or as a group from which an OS can be selected at boot time. Various methods can work to do this, some of which are supported under Linux, others under Windows. It is usually simpler to make a single-boot USB, and that mode is necessary if one wishes to use the "Install" boot feature form USB. It is possible to set up a single USB to boot multiple OS versions (see 'multibootusb") for routine use, but that method does not allow the 'Install" feature to work. Windows ------- The user may wish to use a Windows system to make the bootable USB stick. If so, the author can recommend Universal USB Installer (free download) from PenDriveLinux. It has reliably produced bootable USBs for the author for several years. It is also likely possible (the author has not tried it) to copy the ISO image directly to the USB drive using Win32DiskImager (free download). The author HAS used the program to clone Raspberry Pi SD card images, and it works well. Linux ----- Once the user has a bootable GLFPE for Linux drive running, it can be used to burn other images to either DVD-R+ or USB. For DVD burning, GLFPE Linux includes the "Brasero" application. For USB, there are multiple methods available. The easiest SAFE (GUI) way to create a bootable USB stick from GLFPE Linux is to use the (assumed preinstalled) "Disks" utility (gnome-disk-utility package). That utility makes it fairly simple to investigate the various drives on the system, to identify, verify, and select the target (4Gb or larger) USB flash drive, and to ensure none of its partitions are mounted, a precondition for copying an OS image to the USB drive. To copy the ISO file as an image, insert a target (empty or overwriteable) USB flash drive into an available USB port. Invoke "Disks" from the Applications, Accessories menu. Select the correct USB drive from the left menu, then verify it is correct by examining the information brought up on the right. BE CAREFUL! If you "restore" to the wrong drive, you will wipe its contents and perhaps lose valuable data. Click on each partition in the delected drive's table to examine it. If a square STOP button is displayed, press it to unmount the partition (it should change to a triangular PLAY button). Once all partitions are unmounted, look for the "hamburger" menu button (three horizontal lines) and select "Restore Disk Image". Browse and select the desired ISO image file to copy. The program will provide a measure of safety by asking again before it starts, and by checking target drive size. Once started, the image restoration will take several minutes. When finished, the USB disk should be bootable. Since the finished USB disk is not currently mounted, you can simply remove it from the port without requesting an EJECT. The author has also included "MultibootUSB" as an application in the distribution. That program can place several bootable images at once onto a USB stick, and allow the user to select which OS to boot from a menu. That is particularly useful to the author, who is managing several remix flavors and CPU types. The multiple boot images allow the user to boot various update versions and cpu flavors of OS to test for application or programming issues effectively. However, this method does not produce a bootable installation method for Debian-based OS. The installer expects to find its files in a specific directory underneath the root of the drive, and multibootusb copies those files elsewhere. The installer generally requires a bootable drive with only a SINGLE OS on it. One additional recent ramification of the upgrade of Debian from version 9 to 10 is that MultibootUSB installations no longer work as expected for the newer OS version. The boot menu produced by MultibootUSB makes selection of a Debian 9 OS simple and clear cut from the main menu. Click on the line item and it brings up the boot page for that image. However, the newer Debian 10 builds show up in the main boot menu, but fail to boot correctly when selected from there (it boots to a Grub2 command line only). Fortunately, there is a workaround -- instead if selecting the 600 series GLFPE (Debian 10) from the main menu, select Grub2 Boot instead. Another menu will be presented, which allows selection of all the same choices booted under Grub2. The newer OS version can successfully boot from that menu, though a couple of additional menu items requiring user response show up in the process. It's not clean, but it works. The most elemental (command-line) way (from ANY version of Linux) to make a SINGLY bootable USB from the ISOs provided is to use the Linux command line and the "dd" command. This method merely copies the ISO data directly to the USB drive at the device level, creating the necesary partitions in the process. HOWEVER, THIS IS DANGEROUS IF YOU MAKE A MISTAKE! The dd command is an essential element of Linux, and can be used safely IF YOU ARE CAREFUL, but it doesn't have safety features, and a mistake can be unforgiving. If you accidentally enter the wrong drive ID, you can wipe out an installed OS on your main hard drive, or maybe another USB you have inserted. However, it should always create a working bootable (read only) USB drive from a valid OS image. How to copy ISO using dd command -- WARNING! BE CAREFUL! Given those caveats, the method is basically to insert a USB stick (at least 4Gb) into the port, identify its drive name (ex. /dev/sdd) and use that information in the dd command as an OUTPUT. Accidentaly using it as an INPUT will work in reverse and probably trash your image file. Open a terminal window. Enter the following command: sudo fdisk -l You will see a list of drive descriptions. If the target disk is the last one inserted, it will PROBABLY show up as the last entry, but be careful and verify that before proceeding. Assume for this example the correct disk is /dev/sde, probably with a mounted partition of /dev/sde1 (if it was already formatted). BE SURE TO USE THE CORRECT DRIVE NAME FOR YOUR SYSTEM! Unmount the partition in case it IS mounted: sudo umount /dev/sde1 Change to the directory which holds the ISO image. For example: cd /media/user/GLFPE_Linux_Live_Boot_Images/Debian_9_ISO It will help to have the ISO name handy, so: ls Will display the files in the folder. Locate the ISO image you want to burn and enter that name into the command beow (CAREFULLY): sudo dd bs=4M if=debian-live-glfpe-513-i386.hybrid.iso of=/dev/sde In the command above, "if=" sets the INPUT file, "of=" sets the OUTPUT. When the command executes, it will take a while to copy all the image file bytes directly to the device, starting at the first byte on the device, and ending when data runs out. When finished, you should have a bootable USB stick. Special considerations for permanent installation ------------------------------------------------- The GLFPE for Linux portable OS is intended to be fully usable as a live boot system, not requiring permanent commitments or installation. The user might wish to make the installation permanent to a given computer for more convenient startup, faster operation, and persistent storage of data and modifications to the system. The Debian live-build system includes an installer program (two versions, character-based and graphical interface) which is available during the live boot menu. Any of the above methods work to generate a bootable OS disk which will work in live boot mode. However, the author has found a hitch in one special case. If the user wishes to take advantage of the built-in "Install" process (in the boot menu) and put the GLFPE permanently onto a computer's hard drive, the author has found that it won't work from a MultibootUSB disk. The install has been tested recently and it still works from a DVD for certain, but many systems do not have DVD drives. The problem occurs as the Install process looks for the "CD-ROM" on which the installer is presumed to arrive. On past installations the author has used universal USB Installer under windows to create the boot USB, and never encountered the issue. Presumably, the dual level menu system, which separates the root folders of the original ISOs into subfolders of the MultibootUSB drive, confuses the installer. The author suggests if the user wishes to install from a USB stick, the stick should be prepared using either Universal USB Installer or the "dd" method. Perils of installing multiple OS types on a single hard drive ------------------------------------------------------------- If a user wants to install GLFPE or any version of Linux as the ONLY OS on a computer's drive, have at it. the installation in that case is straightforward, and the defaults usually work well. Users who would like to install Debian onto a computer's hard drive usually do not wish to throw away the working OS and data already on the computer. That preexisting OS is PROBABLY Windows. The author cannot recommend attempting dual boot with Windows using the GLFPE, especially if the OS is Windows 8 or 10. The author HAS successfully set up a dual boot with Windows XP and his own GLFPE, but the problem with Windows 10 is that it tends to be installed on recent computers under UEFI Secure Boot Mode. That mode is currently incompatible with Debian installation. It is also usually recommended that if you wish to dual boot on a Windows 10 machine, you install a 64-bit version of the alternate OS to match the Windows 10 64-bit system. The author does not know if a 32-bit system CAN work on such an installation, so he offers no advice. Such a user may be able to get an official Ubuntu release to install under dual boot, because it currently DOES handle Secure Boot. The Secure Boot standard requires that bootable media contain a digital signature to verify the source of the OS, due to various issues technical and philosophical. Debian advocates free software, and does not like to use commercially controlled products like Microsoft, who generates the required signatures. Ubuntu has less of an issue with that. Remix distributions like GLFPE are also affected, since any changes to the original OS release change the signature, and the producer of the remix would need to acquire AND REGISTER the necessary digital signature or the remix won't boot either. The user can turn OFF Secure Boot, but most users will be wary of doing so, given the supposed security advantages of rejecting the boot of a non-approved OS. Of course, if you want to try out Linux of any flavor, it is generally non-approved in the opinion of Microsoft. Anyone adventurous enough to try out alternate operating systems needs to have some perspective and AWARENESS of the pluses and minuses of security n the age of Internet anyway. The author has encountered systems which could not boot the live boot OS if UEFI Secure Boot is enabled, but COULD boot the same OS in "Legacy" mode (BIOS mode). In Legacy mode Windows 10 itself won't boot, which in effect helps with the security issue. Secure Boot affects live boot from DVD or USB also -------------------------------------------------- On another system, the author found NO "Legacy" mode available, all boots used UEFI. Because the system also refused to boot from USB while Secure Boot was turned on (by default on a new Windows 10 machine). The author chose to disable Secure Boot altogether on that computer. Windows 10 boots OK under UEFI without Secure Boot, and the Debian boot also works OK under UEFI. The user must choose whether he is more worried about Secure Boot or more eager to use the Linux system. Boot sector issues with multiple OS installation ------------------------------------------------- Even if the user wants to dual boot with Windows XP, it is important to be prepared for boot sector problems. The default installation of Windows on modern PCs tends to build in an extra hard drive partition as the FIRST hard drive, to allow a hidden "Recovery" partition. The physical recovery partition is ignored by Windows during normal operation, and the SECOND partition (or even later order) is treated as the first AVAILABLE and given the C: drive letter. The primary disk boot sector points to the Windows partition to further boot up the OS. When the new Linux OS is installed, it sets up more partitions and installs the new GRUB boot on one of those. Everything still works, and one may choose between Linux and Windows on boot. However, if that Linux partition is REMOVED later, the boot sector no longer points to Windows, and the GRUB partition is also gone. Inorder to get Windows (alone) to boot again, one must restore the boot sector to its original state, pointing to the Windows partition. The tools to do that actually exist with Debian (such as GLFPE) in the syslinux package. That package can be temporarily installed in a live boot session, and there are instructions available for using "dd" to copy a default Windows-compatible boot sector back from a file contained in that package. After recopying JUST the boot sector, Windows should again be able to boot as before.