Build a [multi]boot drive or persistent live drive (USB drive or SD-card) _________________________________________________________________________ A. This tarball grub-n-iso_multiboot.tar.gz contains the directory 'grub-n-iso_multiboot' and several files. $ tar -tvf grub-n-iso_multiboot.tar.gz|tr -s ' ' '\t'|cut -f 4-|sort 2015-05-22 10:36 grub-n-iso_multiboot/usb-pack_efi.zip 2015-06-11 09:17 grub-n-iso_multiboot/about 2015-06-11 15:00 grub-n-iso_multiboot/make-alias 2015-07-24 21:20 grub-n-iso_multiboot/mk-grub-n-iso 2016-03-29 12:03 grub-n-iso_multiboot/links2update 2016-03-29 12:08 grub-n-iso_multiboot/links2check 2016-11-29 14:54 grub-n-iso_multiboot/mkusb-nox 2018-04-30 03:21 grub-n-iso_multiboot/grub.cfg 2018-05-04 11:00 grub-n-iso_multiboot/head-end-with-grub.img.xz 2018-05-04 11:02 grub-n-iso_multiboot/ 2018-05-04 18:07 grub-n-iso_multiboot/mk-persistent-live_with_home-rw 1. 'usb-pack_efi.zip' contains configuration files for UEFI mode It is made and uploaded by Andre Rodovalho alias sysmatck 2. 'about' is a batch file, that writes 'About' information $ bash about #!/bin/bash # Copyright 2015 Nio Wiklund alias sudodus # # GPLv3: GNU GPL version 3 . # # This is free software: you are free to change and redistribute it. # There is NO WARRANTY, to the extent permitted by law. # # This scipt is developed from the method developed by # Andre Rodovalho alias sysmatck in the Ubuntu Forums # http://ubuntuforums.org/showthread.php?t=2276498 # and uses the file 'usb-pack_efi.zip' developed by him. # 3. 'make-alias' is a batch file, that creates the alias 'mkgni' that changes directory to 'grub-n-iso_multiboot' and prints a help text $ mkgni 4. 'mk-grub-n-iso' is a text mode shellscript, that builds a [multi]boot drive. 5. 'links2update' is a shellscript with a GUI interface to help using a multiboot USB pendrive for isotesting. 6. 'links2check' is a shellscript with a GUI interface to help using a multiboot USB pendrive for isotesting. 7. 'mkusb-nox' is a text mode shellscript that can clone from iso files and [compressed] image files to USB pendrives to create USB boot drives. (It is a simple alternative to mkusb version 12 alias mkusb-dus, which is a GUI application programmed in bash, so also a shellscript). 8. 'grub.cfg' is a template for Ubuntu family iso files. 9. 'head-end-with-grub.img.xz' is a compressed image file, that can be extracted to the head end of the target drive including the first partition. 10. 'mk-persistent-live_with_home-rw' is a text mode shellscript, that builds a persistent boot drive with a 'casper-rw' partition for system persistence and a 'home-rw' partition for home persistence. There are two modes, to - create a persistent live system - upgrade a persistent live system, . replace the iso file . wipe: create new file system in the 'casper-rw' partition . preserve: keep the content in the 'home-rw' partition. B. Download the tarball from http://phillw.net/isos/linux-tools/uefi-n-bios/grub-n-iso_multiboot.tar.gz and check the md5sum with the file http://phillw.net/isos/linux-tools/uefi-n-bios/grub-n-iso.md5.asc C. Install grub-n-iso_multiboot The tarball is probably in your directory 'Downloads'. If that is where you want to install your directory 'grub-n-iso_multiboot', fine, otherwise I suggest that you move the tarball to where you want it, maybe directly in your home directory, and change directory to there. 1. Expand the tarball tar -cvzf grub-n-iso_multiboot.tar.gz grub-n-iso_multiboot 2. Change directory to 'grub-n-iso_multiboot' and create an alias cd grub-n-iso_multiboot make-alias 3. Open a new terminal window and run $ mkgni Usage: sudo ./mk-grub-n-iso Example: sudo ./mk-grub-n-iso ubuntu.iso /dev/sdx Example: sudo ./mk-grub-n-iso multiboot /dev/sdx Try again with the correct target device according to the list below MODEL NAME FSTYPE LABEL MOUNTPOINT SIZE Transcend 32GB sda 29.4G ├─sda1 /media/myself/chainloader13.04 100M └─sda2 / 29.3G Transcend 4GB sdb 3.8G ├─sdb1 779M └─sdb2 1G CDDVDW SN-208AB sr0 1024M zram0 [SWAP] 489.4M zram1 [SWAP] 489.4M zram2 [SWAP] 489.4M zram3 [SWAP] 489.4M 'mkgni' is changing directory to 'grub-n-iso_multiboot' and running 'mk-grub-n-iso' without parameters, so that it writes help output. We see that it should be run with superuser privileges, and that there should be two parameters, the and the . See the first example in the usage output sudo ./mk-persistent-live_with_home-rw ubuntu.iso /dev/sdx sudo ./mk-grub-n-iso ubuntu.iso /dev/sdx It is also possible to use the following three tokens, -h, -v and 'multiboot' (without quotes). -h makes it write the same help output as without parameters. -v makes it write version information $ ./mk-grub-n-iso -v mk-grub-n-iso 1.0 'multiboot' makes 'mk-grub-n-iso' look for all iso files in the current directory (grub-n-iso_multiboot), *.iso, and use them as source files. See the second example in the usage output sudo ./mk-grub-n-iso multiboot /dev/sdx The target device letter x should be selected according to the tree view of the devices. In this case the system is booted from '/dev/sda', so '/dev/sdb' should be selected as the target device. WARNING! Check carefully that you specify the correct target device, otherwise you might destroy valuable data! Wait a while! There is no iso file in the directory 'grub-n-iso_multiboot' D. Get iso files 1. Download one or more iso files with Ubuntu family desktop operating systems. You can find download information via this link http://releases.ubuntu.com/ and check the md5sum. 2. If you download an iso file with another distro, you need to configure the menuentry in grub.cfg manually. The following links may help https://wiki.archlinux.org/index.php/Multiboot_USB_drive https://help.ubuntu.com/community/Grub2/ISOBoot https://help.ubuntu.com/community/Grub2/ISOBoot/Examples https://help.ubuntu.com/community/Grub2/CustomMenus 3. Make the iso files available Single iso files can be entered with the full path (in the command line). But if you want to create a multiboot pendrive, the source files (or links to the source files) must be in the directory 'grub-n-iso_multiboot'. It is also convenient the create links, even when you intend to install single iso files. Create links from the location of the downloaded iso files to 'grub-n-iso_multiboot' (or move the files if you like). You can use symbolic links as well as hard links. Avoid copying because it is a waste of disk space. Examples $ ls -1 ~/Downloads/iso kubuntu-14.04.2-desktop-amd64.iso lubuntu-14.04.2-desktop-i386.iso ubuntu-12.04-desktop-i386.iso ubuntu-14.04.2-desktop-amd64.iso ubuntu-mate-14.04.2-LTS-desktop-i386.iso xubuntu-14.04.1-desktop-i386.iso $ mkgni Example 1 - link all files ln -s ~/Downloads/iso/*.iso . Example 2 - link only standard ubuntu files ln -s ~/Downloads/iso/ubuntu-1*.iso . Example 3 - link only 32-bit files ln -s ~/Downloads/iso/*i386*.iso . Example 4 - link only 64-bit files ln -s ~/Downloads/iso/*amd64*.iso . E. Demo runs 1. Create a portable system with a small foot-print sudo ./mk-grub-n-iso ~/Downloads/iso/lubuntu-14.04.2-desktop-i386.iso /dev/sdx 2. Create a multiboot system with only standard ubuntu files You can create extra space in the fat32 partition and add more iso files later. mkgni rm *.iso ln -s ~/Downloads/iso/ubuntu-1*.iso . sudo ./mk-grub-n-iso multiboot /dev/sdx 3. Add another iso file to an existing [multi]boot pendrive. sudo ./mk-grub-n-iso ~/Downloads/iso/xubuntu-16.04.1-LTS-desktop-i386.iso /dev/sdx 4. Create a persistent live drive with standard ubuntu or an Ubuntu flavour. You should stay within the same architecture (amd64 or i386). It is possible to upgrade to a different flavour of Ubuntu (for example from Lubuntu to Xubuntu, but such operations might cause problems because of conflicts between configuration files. sudo ./mk-persistent-live_with_home-rw ubuntu-16.04.1-desktop-amd64.iso /dev/sdd sudo ./mk-persistent-live_with_home-rw lubuntu-16.04.1-desktop-i386.iso /dev/sdd 5. Upgrade that persistent live drive with standard ubuntu or an Ubuntu flavour sudo ./mk-persistent-live_with_home-rw ubuntu-18.04-desktop-amd64.iso /dev/sdd sudo ./mk-persistent-live_with_home-rw lubuntu-18.04-desktop-i386.iso /dev/sdd F. System requirements 1. Host system: An Ubuntu family operating system of version 14.04 LTS or newer. It is possible to use Ubuntu 12.04 LTS too, but it has an older version of grub, and it can only make pendrives that boot in BIOS mode. Other linux distros are not tested. 2. The installer 'mk-grub-n-iso' uses bash and built-in commands. 'gparted' is used to create and edit partitions and create file systems. There must be a graphical mode for gparted to work. sudo apt-get install gparted You may appreciate the improved feedback during the copying process with pv. sudo apt-get install pv 3. Computer 'mk-grub-n-iso' does not need much computing power or RAM. It is possible to use 32-bit as well as 64-bit PCs (with Intel or AMD processors). 4. Target system: Automatic configuring for current Ubuntu family desktop iso files. Ubuntu 12.04 LTS works well as target system. Manual configuring (creating the menuentries) using for example this link https://wiki.archlinux.org/index.php/Multiboot_USB_drive 5. Target computer The target computers, where grub-n-iso_multiboot pendrives can run, include BIOS and UEFI mode, 32-bit and 64-bit hardware, 32-bit and 64-bit operating systems. The system created by demo run 1: sudo ./mk-grub-n-iso ~/Downloads/iso/lubuntu-14.04.2-desktop-i386.iso /dev/sdx can boot most PCs. - There is a hardware limit. The computer may be too weak to boot a current version of Lubuntu, or there is some hardware, for example graphics chip, where the available drivers do not work. But then it is possible to include iso files for other linux distros. - Another limit is where the system is so locked down by a non-standard UEFI system, that nothing but Windows works.