Results 1 to 10 of 725

Thread: Howto make USB boot drives

Threaded View

  1. #1
    Join Date
    Nov 2011
    Location
    /dev/root
    Beans
    Hidden!

    Howto make USB boot drives

    Quick start manual and mkusb

    The fastest way to start making USB boot drives is to install the mkusb PPA, install and update the mkusb package like all the other program packages. See this link
    https://launchpad.net/~mkusb/+archive/ubuntu/ppa

    If you run standard Ubuntu, you need an extra instruction to get the repository Universe. (Kubuntu, Lubuntu ... Xubuntu have the repository Universe activated automatically.)

    Text after the # character is not used by the shell interpreter, it is a comment for the human eye.

    Code:
    sudo add-apt-repository universe  # this line only for standard Ubuntu
    Code:
    sudo add-apt-repository ppa:mkusb/ppa          # stable PPA for regular usage
    # sudo add-apt-repository ppa:mkusb/unstable   # PPA for development and testing; remove the # in front of the command to use it
    sudo apt-get update
    sudo apt-get install mkusb mkusb-nox
    
    sudo apt-get install usb-pack-efi  # for persistent live drives that work in UEFI and BIOS mode with 32-bit iso files
    You can download the quick start manual and check the md5sums at this link http://phillw.net/isos/linux-tools/mkusb/



    - View or download the new quick start manual mkUSB-quick-start-manual.pdf
    - View or download the nox (text-mode) quick start manual mkUSB-quick-start-manual-nox.pdf
    - Check the md5sums http://phillw.net/isos/linux-tools/mkusb/md5sum.txt.asc

    Alternative: You find alternate links at Quick start manual and mkusb PPA (if http://phillw.net/isos/linux-tools/mkusb/ is temporarity down).

    If you want to try the current version of mkusb, get it via the PPA.

    There are more details (text and screenshot pictures) at the wiki page https://help.ubuntu.com/community/mkusb

    Warning about overwriting the target device

    mkusb will 'use the whole device', actually only the head end (size of the iso file), but the rest of the device is not available. mkusb simply clones the ISO 9660 file system with its content from the iso file. This ISO 9660 file system works from CD/DVD disks, and also from USB drives. After using a USB pendrive like this, you make a new partition table and file system, if you want to use it for another purpose.

    Help selecting the correct target device

    The crucial task of mkusb was and is to help selecting the correct device and avoid overwriting other devices.



    Doing the same thing many times

    For the first time I had been helping to test a new Ubuntu version (Lubuntu 12.04 LTS). After a while I wanted to make itsimpler and safer to transfer the code to the USB pendrive. I have been happy using unetbootin, because of its high success rate. I also tested Ubuntu's startup disk creator usb-creator-gtk, which has the advantage that you reach Ubuntu's first screen, that is skipped by unetbootin. Both tools work with my computers and can be used to create persistent live systems.


    Temporary edit: Ubuntu versions before 16.04 LTS have problems with the Startup Disk Creator and Unetbootin, but mkusb and Win32DiskImager work, they are not affected by the following bug and other bugs.

    [Current issue of Ubuntu (14.04), 15.04 and 15.10] There are problems with the Startup Disk Creator alias usb-creator and Unetbootin, if you try to create a 15.04 or 15.10 boot drive from a previous version of Ubuntu. See this link to the release notes https://wiki.ubuntu.com/UtopicUnicor...d_post-install and https://bugs.launchpad.net/bugs/1325801

    Until these problems are solved other tools work, for example mkusb in linux and Win32DiskImager in Windows described in the following links

    https://help.ubuntu.com/community/mkusb and https://wiki.ubuntu.com/Win32DiskImager/iso2usb.

    The current version of Unetbootin in the Ubuntu repositories might not work, but you can install the developer's PPA and install a version that works well.

    https://launchpad.net/~gezakovacs/+archive/ubuntu/ppa


    Code:
    sudo add-apt-repository ppa:gezakovacs/ppa
    sudo apt-get update
    sudo apt-get install unetbootin


    dd image of iso file to USB device safely

    But I also read somewhere that it should be possible to boot from a direct image of the iso file. So I tried it with dd, the disk destroyer ;-) And it works, the computer boots from a USB device (pendrive, stick, flash drive, but also disk or SSD) just like it were from a CD drive. Also like a CD, it will be mounted read-only, so it cannot carry persistence.

    Since dd is a bit risky, I made a shell-script, so that you get advice from a help text window and have to run dd manually only once, but with support from the script to avoid writing to any internal drive. The first time you must select the correct USB device, if more than one are connected. So it is safer and also much more convenient (but not 100%).

    The next daily build will automatically select the correct USB device (when it is inserted into the computer). So for the next daily builds it is safe and very convenient.

    I cloned an ubuntu-desktop-amd64.iso this way, and the USB pendrive works in both UEFI and CSM (BIOS) modes.

    Shell script

    The shell-script has been updated and improved and will be updated again when necessary. It is now convenient to use also for one-off creations of USB boot devices from iso files and compressed image files and also to wipe the drives if necessary after the cloning. The shellscript can monitor the data transfer with pv, and suggests that you install it, if not available. Notice that pv shows Mibibytes and dd shows Megabytes.

    Here is the shell-script for anyone to use or improve.

    Download mkusb from the following link

    http://phillw.net/isos/linux-tools/mkusb

    There are also previous versions for users that like simple scripts.

    Use the current md5sum.txt.asc file to check that the md5sum matches before you start using mkusb!

    Verify that this signed md5sum file is correct with the following commands

    Code:
    gpg --keyserver hkp://pgp.mit.edu --recv-keys EB0FC2C8
    gpg --verify md5sum.txt.asc
    
    The output should be something like

    Code:
    gpg --keyserver hkp://pgp.mit.edu --recv-keys EB0FC2C8
    ... 
    gpg: key EB0FC2C8: public key "Nio Sudden Wiklund (sudodus) <address@mailserver.com>" imported (or not changed the second time ...)
    ...
    gpg --verify md5sum.txt.asc
    gpg: Signature made Sat Aug  2 12:09:06 2014 CEST using RSA key ID EB0FC2C8
    gpg: Good signature from "Nio Sudden Wiklund (sudodus) <mail address>"
    gpg: WARNING: This key is not certified with a trusted signature!
    gpg:          There is no indication that the signature belongs to the owner.
    Primary key fingerprint: 0303 EA77 E34C 52F2 2958  47C6 BD43 C742 EB0F C2C8
    The warning "This key is not certified with a trusted signature! There is no indication that the signature belongs to the owner." means that there is no chain of trusted keys between your computer's keyring and the key, that was used to sign the md5sums (the key of sudodus). Check that the result matches, when you verify it: The md5sums and the signature of your output of these commands should match. Then there is reason to trust that nobody else has written the mkusb script file and its md5sum. The date of the signature will change at updates, and the text might be translated to your local language, but it should be clear that it is a

    'Good signature from "Nio Sudden Wiklund (sudodus)"'.



    mkusb-nox

    mkusb-nox is supplied via the PPA. It works in text screens, 'No X', and can do 'everything' that mkusb version 9 can do (but without eye candy). The improved recognition of operating systems in iso files and devices is ported is ported from version 9.

    https://help.ubuntu.com/community/mkusb/v7

    Code:
    sudo add-apt-repository ppa:mkusb/ppa  # and press Enter to accept it
    sudo apt-get update
    sudo apt-get install mkusb-nox
    mkusb-bas

    A very basic version of mkusb is made for old and/or very small operating systems (suitable for very old computers and as portable systems). mkusb-bas is tweaked to run in TinyCore and Wary Puppy. See this link

    https://help.ubuntu.com/community/mk....x_-_mkusb-bas

    Wipe the CD file system

    I should add, that if you want to re-use a USB drive that has been used like this, you should wipe it with dd (overwrite with zeros), otherwise grub-install doesn't want to write into the mbr area, because it recognizes the CD file system, iso9660. (You need not wipe it before cloning.)

    You can use the shell-script also for this task and wipe the whole drive, 'wipe-whole-device', but often it is enough to wipe the first megabyte of the drive, 'wipe-1'.

    Code:
    $ sudo -H mkusb wipe
    It is very important that you wipe your intended target drive and nothing else. It will be completely wiped, not even PhotoRec can do anything after that operation. But there are other (and better) tools to wipe an entire HDD or SSD for example hdparm or DBAN.

    And after that you can use gparted to make a new partition table (for example MBR) and suitable partition(s) for example FAT32 with boot and lba flags.

    mkusb 10.2 introduces a 'wipe menu' with several useful options

    • s "Standard: create MSDOS partition table with FAT32 partition"
    • b "Big drive: create GUID partition table with NTFS partition"
    • g "General: use 'gparted' to make partition table and partition(s)"
    • a "Advanced: create GUID partition table (skeleton for installing an OS)"
    • f "wipe the First megabyte (mibibyte)"
    • w "wipe the Whole device - consider other options except for special cases"


    Several iso files can be cloned to working USB pendrives

    ISO files that can be be cloned to working USB boot drives are called hybrid iso files.

    There are mkusb PPAs for {Ubuntu, Kubuntu, Lubuntu, Xubuntu ...} {12.04 LTS, 14.04 LTS, 14.10, 15.04} alias {precise, trusty, utopic, vivid}. mkusb can make working USB installers also from the Ubuntu mini.iso. See this link.

    New: You find working mini.iso files for 12.04 LTS (32-bits pae (and non-pae in a subdirectory)) at this link - precise-updates.

    Arch
    Bento
    Bodhi
    Clonezilla (mkusb-nox)
    Debian Jessie
    Fedora (uses simpler black & white menus because zenity lacks support for html) (live only)
    Knoppix (needed treatment with isohybrid)
    Linux Mint
    LXLE
    Mageia (live only)
    openSUSE (live only)
    ToriOS
    Webconverger

    while some other iso files did not work (although they make good CD boot disks). It is often possible to convert such an iso file to a hybrid iso with the following command

    Code:
    isohybrid downloaded-file.iso
    It converts the iso in-place (the file is overwritten), so make a copy before you run isohybrid if you want to keep the original file untouched. See the following link

    http://gparted-forum.surf4.info/view...d=30798#p30798

    Complete install to USB

    I also installed Lubuntu to a 16 GB USB pendrive, a complete install, like to a HDD. It was a little tricky with the swap partition, so now I know, why people advice, that you should disconnect the internal drive before doing it. This pendrive is truly portable, and probably better than a persistent live system. Please avoid proprietary drivers, if you want portability! There are several compressed image files, that were made from such installed systems, and they can be installed with mkusb.

    Booting USB drives with grub2 and iso files 'grub-n-iso'

    64-bit versions work only in 64-bit computers. 32-bit versions work in 32-bit and 64-bit computer (with BIOS, but not with UEFI, unless you use the methods described in the following paragraph).

    The 'grub-n-iso' method uses grub2 to boot from an iso file, so once you have such a USB pendrive, you can boot most Intel and AMD computers that can run a 32-bit system (except very old non-PAE systems, systems with too low RAM, and systems with non-compatible hardware). The 'grub-n-iso' method can be used to create multi-boot USB pendrives by selecting iso file to boot from in the grub menu.

    You can use the shell-script mkusb also for this task, to clone a compressed image from a file file.img.gz to a USB drive. You can download such files from http://phillw.net/isos/linux-tools/uefi-n-bios/

    mkusb can make persistent live drives

    A modified 'grub-n-iso' method is used, when mkusb creates persistent live drives. See details at mkusb/persistent

    One pendrive for all PC (Intel/AMD) computers - Ubuntu 64-bit and Lubuntu 32-bit

    The following three systems are downloaded as compressed image files and installed via mkusb

    1. One pendrive for all PC (Intel/AMD) computers - Ubuntu 64-bit and Lubuntu 32-bit

    There are methods now to make 32-bit Ubuntu family operating systems boot in UEFI mode via grub and iso files, 'grub-n-iso'. This makes it possible to make a USB pendrive with persistence, that is very portable between different computers :smile:

    2. A smaller and simpler pendrive for all PC (Intel/AMD) computers - 'grub-n-iso' - Lubuntu 32-bit

    3. Multiboot pendrive system for all PC (Intel/AMD) computers

    -o-

    The system with compressed image files makes it easy for a beginner to install, but it is rather inflexible. So I made a shell-script, that does the main part of the work with the help of a couple of files for the configuration of the booting system. See this link

    Build your own single boot or multiboot pendrive for all PC (Intel/AMD) computers



    References to tutorials and tips how to make USB boot drives

    Ubuntu help page - FromUSBStick
    Ubuntu help page - mkusb
    Ubuntu wiki page - Win32DiskImager/iso2usb
    Ubuntu wiki page - Win32DiskImager/compressed-image_2_USB-or-SD
    Ubuntu help page - UEFI-and-BIOS
    Attached Images Attached Images
    Last edited by sudodus; May 2nd, 2017 at 02:22 PM. Reason: changes are described in the following posts

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •