Page 1 of 5 123 ... LastLast
Results 1 to 10 of 50

Thread: Howto make USB boot drives

  1. #1
    Join Date
    Nov 2011
    Location
    /dev/root
    Beans
    7,153

    Howto make USB boot drives

    Quick start manual and mkusb

    The fastest way to start making USB boot drives is to download the quick start manual and the shell-script mkusb and check the md5sums.

    See this link http://phillw.net/isos/linux-tools/mkusb/
    - Download mkusb http://phillw.net/isos/linux-tools/mkusb/mkusb
    - View or download the quick start manual http://phillw.net/isos/linux-tools/m...art-manual.pdf
    - Check the md5sums http://phillw.net/isos/linux-tools/mkusb/md5sum.txt.asc


    If you want to try something new, the release candidate with menus mkusb8-rc is uploaded to
    http://phillw.net/isos/linux-tools/mkusb/
    and there are more details at
    https://help.ubuntu.com/community/mkusb


    Doing the same thing many times


    For the first time I have 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: usb-creator-gtk is buggy was Lubuntu 13.04 and 13.10, and is being debugged. It is improved and can create persistent USB drives in 13.10 but it crashes when trying to erase a disk. There is project to rewrite it for 14.04 LTS. If you still have problems with usb-creator-gtk, as a temporary workaround, you can try using usb-creator-kde or unetbootin or one of the other tools instead. See details at post #4

    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 ubuntu-13.04-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.

    The new version 5 is available now, but several instructions at this page are still describing version 3. From version 4 the shell-script is more automatic. You need not copy and paste the command line. This example shows how to select the target device with (+/-) or the number of the list item. Go ahead with (g) or quit with (q). (Toggle 'USB-only' with (u) if you want to write to a drive that is not a USB drive.)

    Code:
    $ sudo mkusb saucy-desktop-i386.iso
    The iso file SHOULD BE loop mounted on a temporary file READ-ONLY:
    mount: warning: /tmp/tmp.Jbu6YwpDsR seems to be mounted read-only.
    Lubuntu 13.10 "Saucy Salamander" - Beta i386 _found_ in iso-file
    Lubuntu 13.10 "Saucy Salamander" - Beta i386 _not_ in USB device
    Do you want to make a new one? (y/n)
    y
    ***  WARNING: the device will be completely overwritten      ***
         Use the info in the xterm window (less /tmp/help-mkusb.txt)
    ***  quit with (q)                                           ***
    ***  Unmount the device if mounted  ****************************
     
    Model: ATA SAMSUNG HD322HJ (scsi)    Disk /dev/sda: 320GB    
    Model: ATA OCZ-AGILITY3 (scsi)    Disk /dev/sdb: 60.0GB    
    Model: ATA WDC WD10EARS-00Y (scsi)    Disk /dev/sdc: 1000GB    
    Model: SanDisk Cruzer Blade (scsi)    Disk /dev/sdd: 4005MB    
    Model: SanDisk Extreme (scsi)    Disk /dev/sde: 32.0GB    
    Model: JetFlash Transcend 16GB (scsi)    Disk /dev/sdf: 15.8GB    
    Live drive: /dev/sdb
    USB drive:  /dev/sdd: 4004 MB, 4004511744 bytes
    USB drive:  /dev/sde: 32.0 GB, 32017047552 bytes
    USB drive:  /dev/sdf: 15.8 GB, 15812526080 bytes
     
    ---> 1: install to SanDisk Cruzer Blade (scsi) Disk /dev/sdd: 4005MB
         2: install to SanDisk Extreme (scsi) Disk /dev/sde: 32.0GB
         3: install to JetFlash Transcend 16GB (scsi) Disk /dev/sdf: 15.8GB
    Select another device with (+/-) or the number of the list item.
    Go ahead with (g) or quit with (q). Toggle USB-only with (u).
    2
         1: install to SanDisk Cruzer Blade (scsi) Disk /dev/sdd: 4005MB
    ---> 2: install to SanDisk Extreme (scsi) Disk /dev/sde: 32.0GB
         3: install to JetFlash Transcend 16GB (scsi) Disk /dev/sdf: 15.8GB
    Select another device with (+/-) or the number of the list item.
    Go ahead with (g) or quit with (q). Toggle USB-only with (u).
    g
    2: source: saucy-desktop-i386.iso
       target: SanDisk Extreme (scsi) Disk /dev/sde: 32.0GB 
    Do you really want to wipe and install to this device? (y/n)
    'Do you really want to wipe and install to this device? (y/n)' is the last warning. If you answer y (and press the Enter key), the source file will be cloned to the target device.

    The shell-script version 4, 5 ... work well not only in graphical desktops with terminal windows, but also in text screens (for example in a server). It can manage img.xz files (compressed with xz with ~20% better compression than gzip).

    A typical dialogue looks like this the first time you run the script (and the label of the iso file does not match that on the USB drive). Either the general usage text

    Code:
    $ ./mkusb
    Usage:
    ---- Make a USB install device from 'file.iso' ---------------
    sudo ./mkusb file.iso
    ---- Make a USB install device from 'file.img.gz' ------------
    sudo ./mkusb file.img.gz
    ---- Make a USB install device from 'file.img.xz' ------------
    sudo ./mkusb file.img.xz
    ---- Install from 'file.img.xz', show all mass storage devices
    sudo ./mkusb file.img.xz all
    ---- Install from 'file.img.xz', show all ..., no help text
    sudo ./mkusb file.img.xz anh
    ---- Wipe the USB device (may take long time) ----------------
    sudo ./mkusb wipe-whole-device
    ---- Wipe the first megabyte (MibiByte), show only USB devices
    sudo ./mkusb wipe-1
    ---- Wipe the first megabyte, show all mass storage devices --
    sudo ./mkusb wipe-1 all
    ---- Version -------------------------------------------------
    ./mkusb -v
    $
    or the specific usage text to help you cut and paste to get 'sudo and the path' easily, and then run the whole script to get the advice how to run the dd command line.

    Code:
    $ mkusb saucy-desktop-i386.iso
    Usage:
    sudo /home/sudodus/bin/mkusb saucy-desktop-i386.iso
    $ sudo /home/sudodus/bin/mkusb saucy-desktop-i386.iso
    The iso file SHOULD BE loop mounted on a temporary file READ-ONLY:
    mount: warning: /tmp/tmp.oycaw8Etgn seems to be mounted read-only.
    Lubuntu 13.10 "Saucy Salamander" - Alpha i386  found in iso-file
    Lubuntu 13.10 "Saucy Salamander" - Alpha i386  not in USB device
    Do you want to make a new one? (y/n)
    y
    ***  WARNING: the device will be completely overwritten  ***
         Use the info in the xterm window (less /tmp/help-mkusb.txt)
    ***  Unmount the device if mounted  ************************
     
    Modell: ATA OCZ-AGILITY3 (scsi)    Disk /dev/sda: 60,0GB    
    Modell: SanDisk Extreme (scsi)    Disk /dev/sdb: 32,0GB    
    Modell: SanDisk Cruzer Blade (scsi)    Disk /dev/sdc: 4005MB    
    USB Disk /dev/sdb: 32.0 GB, 32017047552 bytes
    USB Disk /dev/sdc: 4004 MB, 4004511744 byte
     
    {This kind of output belongs to old versions (including version 3)
    
         Edit if necessary [one of] the following lines
         and paste it as a command!
         Only USB devices are listed, if found.
         Otherwise, a template is offered with
         ... of=/dev/sdX  to be edited.
     
    sudo pv saucy-desktop-i386.iso| sudo dd bs=4096 of=/dev/sdb
    sudo pv saucy-desktop-i386.iso| sudo dd bs=4096 of=/dev/sdc
    $ 
    }
    {and you can mark, paste (and maybe edit) the lines in blue including the final sudo pv ... line in the terminal window and run it.}

    The next time the dialogue is much simpler, because the shell-script finds the DISKNAME in the file README.diskdefines in the USB device.

    Code:
    $ sudo /home/sudodus/bin/mkusb saucy-desktop-i386.iso
    The iso file SHOULD BE loop mounted on a temporary file READ-ONLY:
    mount: warning: /tmp/tmp.iLel8rVRX7 seems to be mounted read-only.
    Lubuntu 13.10 "Saucy Salamander" - Alpha i386  found in iso-file
    Lubuntu 13.10 "Saucy Salamander" - Alpha i386  found in /dev/sdb
    Install to /dev/sdb? (y/n)
    y
    pv saucy-desktop-i386.iso| dd of=/dev/sdb bs=4096 ...
     689MB 0:00:05 [ 117MB/s] [=================================================>] 100%            
    176384+0 poster in
    176384+0 poster ut
    722468864 byte (722 MB) kopierade, 6,39944 s, 113 MB/s
    syncing the drive ...
    The Lubuntu 13.10 "Saucy Salamander" - Alpha i386 USB device is re-cloned  :-)
    $
    Notice that pv shows Mibibytes and dd shows Megabytes. This speed, 113MB/s is achieved with a Sandisk Extreme 32 GB pendrive in a USB3 port. It will be slower in a USB2 port, 39MB/s

    Code:
    $ sudo /home/sudodus/bin/mkusb saucy-desktop-i386.iso
    The iso file SHOULD BE loop mounted on a temporary file READ-ONLY:
    mount: warning: /tmp/tmp.vDxdqO1QCO seems to be mounted read-only.
    Lubuntu 13.10 "Saucy Salamander" - Alpha i386  found in iso-file
    Lubuntu 13.10 "Saucy Salamander" - Alpha i386  found in /dev/sdb
    Install to /dev/sdb? (y/n)
    y
    pv saucy-desktop-i386.iso| dd of=/dev/sdb bs=4096 ...
     689MB 0:00:17 [40,1MB/s] [=================================================>] 100%            
    176384+0 poster in
    176384+0 poster ut
    722468864 byte (722 MB) kopierade, 18,7369 s, 38,6 MB/s
    syncing the drive ...
    The Lubuntu 13.10 "Saucy Salamander" - Alpha i386 USB device is re-cloned  :-)
    $
    A standard Sandisk Cruzer Blade 4 GB pendrive is much slower, only 4.5MB/s, but it has also been reliable for me. The Cruzer Blade works well to boot a live session and or install an Ubuntu flavour operating system.

    Code:
    $ sudo /home/sudodus/bin/mkusb saucy-desktop-i386.iso
    The iso file SHOULD BE loop mounted on a temporary file READ-ONLY:
    mount: warning: /tmp/tmp.aXikEW1wo8 seems to be mounted read-only.
    Lubuntu 13.04 "Raring Ringtail" - Release i386  found in iso-file
    Lubuntu 13.04 "Raring Ringtail" - Release i386  found in /dev/sdc
    Install to /dev/sdc? (y/n)
    y
    pv raring-desktop-i386.iso| dd of=/dev/sdc bs=4096 ...
     687MB 0:02:30 [4,57MB/s] [=================================================>] 100%            
    175872+0 poster in
    175872+0 poster ut
    720371712 byte (720 MB) kopierade, 163,103 s, 4,4 MB/s
    syncing the drive ...
    The Lubuntu 13.04 "Raring Ringtail" - Release i386 USB device is re-cloned  :-)
    $
    Here is the shell-script for anyone to use or improve.

    Download the attached file mkusb-ball.tar.gz, or download mkusb from the following link
    http://phillw.net/isos/one-button-installer/scripts/

    There are also previous versions for users that like simple scripts. Extract the script from the compressed file with one of these commands (or file-roller).

    Code:
    tar -xvOf mkusb-ball.tar.gz mkusb-old-plus-minor-fix > mkusb
    tar -xvOf mkusb-ball.tar.gz mkusb3 > mkusb
    ...
    tar -xvOf mkusb-ball.tar.gz mkusb6 > mkusb
    ...
    tar -xvOf mkusb-ball.tar.gz mkusb74 > mkusb
    I use the file name mkusb, put it into my ~/bin directory and make it executable.

    Code:
    chmod ugo+x mkusb
    ls -l mkusb
    -rwxr-xr-x 1 sudodus sudodus 13998 mar 14 16:04 mkusb
    The current size and md5sum are listed in the next code box. Check that the file is correct before you start using it!

    Code:
    wc -c mkusb;md5sum mkusb  # from mkusb74
    13998 mkusb
    d02976734e6be3e173910b9e6ac636c2  mkusb
    
    wc -c mkusb;md5sum mkusb  # from mkusb6
    11677 mkusb
    8c0f0a3cc52a0267036a4a7c78f4a8f6  mkusb
    
    wc -c mkusb;md5sum mkusb  # from mkusb5
    11692 mkusb
    ab435d9606f30ee0ec0f1a46b849dbc1  mkusb
    
    wc -c mkusb;md5sum mkusb  # from mkusb4
    11373 mkusb
    6ce8db8c1981e905800dfbb1f500176a  mkusb
    
    wc -c mkusb;md5sum mkusb  # from mkusb3
    6119 mkusb
    ef16e65a7996cc0b5142fca81d9f9c83  mkusb
    
    wc -c mkusb-old-plus-minor-fix; md5sum mkusb-old-plus-minor-fix
    4916 mkusb-old-plus-minor-fix
    5fb04df7cdccaf915fac6978c6f6b6f4  mkusb-old-plus-minor-fix
    Use the new version, or stay with an earlier version for example version 3 with more direct interaction in the terminal window.

    Release candidate mkusb8-rc2 with menus

    I have uploaded a second release candidate of the mkusb tool to install iso files and compressed image files to mass storage devices (typically but not only USB drives). It is only a bash script, and has been running in crude text mode, but people want eye candy, so I've made menus with dialog (big brother of whiptail), and also improved the identification of devices slightly (replaced calling parted -ls with a home-made bash function). It is still text mode, so runs in text screens and terminal windows.

    See the attached pictures, which illustrate the crucial part of mkusb, how to help selecting the correct device and avoid overwriting other devices.

    Edit: The file mkusb8-rc2 is uploaded to

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

    and there are more details at

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

    Check it with the corresponding signed md5sum file.

    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 ./mkusb wipe-1
    Wipe the first megabyte (MibiByte) ... :
    Do you want to wipe the USB device? (y/n)
    y
    ***  WARNING: the device will be completely overwritten  ***
         Use the info in the xterm window (less help-mkusb.txt)
    ***  Unmount the device if mounted  ************************
    ...
    
    256+0 poster in
    256+0 poster ut
    1048576 byte (1,0 MB) kopierade, 0,0182356 s, 57,5 MB/s
    1,06MB 0:00:00 [53,2MB/s] [ <=>                                                               ]
    $
    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.

    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. I tested and could make working USB boot drives from

    - ubuntu flavours 12.04+ (Kubuntu, Lubuntu, Ubuntu, Xubuntu, ... , desktop, alternate and server work, but not mini.iso)
    - mini.iso version 13.04+ Plus means 'and newer versions'. See this link.
    - linux mint 13+
    - clonezilla
    - debian stable
    - webconverger

    while some other iso files did not work (although they make good CD boot disks). I could convert such an iso file to a hybrid iso (another person's 12.04 LTS re-spin using my own 12.04 LTS system) 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. Nota bene, avoid proprietary drivers, if you want portability!

    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.

    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, UEFI 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. There is space in 'grub-n-iso-n-swap' for a second iso file. You can also start from this link to Pendrivelinux and modify the USB drive to suit what you need: size, number of iso files ...

    The link to 'grub-n-iso' refers to Lubuntu-fake-PAE, because it is a method to boot the new pae kernel also with Celeron M and Pentium M CPUs without the PAE flag, but with PAE capability. However, the 'grub-n-iso' and 'grub-n-iso-swap' USB boot drives use the standard Lubuntu desktop iso file without any fake-PAE installed, and it can boot almost all computers, that can run 32-bit systems, but it cannot be used for UEFI systems. If you want to boot in UEFI mode and install your Ubuntu flavour alongside Windows, you should use the for example the ubuntu-13.04-desktop-amd64.iso directly.

    You can use the shell-script also for this task, to clone a compressed image from a file file.img.gz to a USB drive.

    Code:
    $ sudo ./mkusb Lubuntu-13.10-desktop-grub-n-iso.img.gz
    ...
    243967+1 poster in
    243967+1 poster ut
    999292416 byte (999 MB) kopierade, 33,9696 s, 29,4 MB/s
    One Button Installer

    The One Button Installer is very simple, it uses only standard text mode programs and shell-scrips. It is easy to use and needs very little RAM.

    You can have the script file in the current directory and call it with sudo ./mkusb which is typical for the One Button Installer. Like 'grub-n-iso' this installer is also cloned or flashed from a compressed image. The file dd_blank-obi_4GB_xx.img.gz contains a file system with a basic text operating system and the One Button Installer scripts. There is a wiki page at https://help.ubuntu.com/community/OBI, and files to download are available at http://phillw.net/isos/one-button-installer/ There is also a tutorial thread here, One Button Installer, 'OBI'.

    A system to install is stored in a tarball, a compressed tar file, file.tar.gz. Tarballs can be added and removed in a similar way as the iso files of the 'grub-n-iso' installer.

    Code:
    tester@alt-lub-encrypt:~/Hämtningar$ sudo ./mkusb dd_blank-obi_4GB.img.gz 
    Do you want to clone dd_blank-obi_4GB.img.gz to the USB device? (y/n)
    y
    ***  WARNING: the device will be completely overwritten  ***
         Use the info in the xterm window (less /tmp/help-mkusb.txt)
    ***  Unmount the device if mounted  ************************
     
    Modell: ATA OCZ-AGILITY3 (scsi)    Disk /dev/sda: 60,0GB    
        Fel: /dev/sdb: okänt disketikett         <--- temporary parted error because the first megabyte was wiped   
    Modell: SanDisk Cruzer Blade (scsi)    Disk /dev/sdc: 4005MB    
    USB Disk /dev/sdb: 32.0 GB, 32017047552 bytes
    USB Disk /dev/sdc: 4004 MB, 4004511744 byte
    ...
    
    3,72GB 0:00:33 [ 113MB/s] [=================================================>] 100%            
    976384+0 poster in
    976384+0 poster ut
    3999268864 byte (4,0 GB) kopierade, 34,4289 s, 116 MB/s
    tester@alt-lub-encrypt:~/Hämtningar$
    A tool that helps boot some computers from [other] USB boot drives - Chainloader

    The chainloader is useful for middle-aged computers, for example computers without a CD/DVD drive, where it can be hard to boot from a USB drive, or when you want to run from a fast USB 3 drive that is unwilling to boot. See this link to the tutorial Howto help USB boot drives

    References to tutorials and tips how to make USB boot drives

    Ubuntu Wiki - FromUSBStick
    Pendrivelinux about Multisystem
    https://launchpad.net/gdiskdump
    Attached Images Attached Images
    Attached Files Attached Files
    Last edited by sudodus; 3 Days Ago at 05:33 AM. Reason: changed are described in the following posts

  2. #2
    Join Date
    Nov 2011
    Location
    /dev/root
    Beans
    7,153

    Re: Howto make USB boot drives

    I added details how to wipe the CD file system, if you want to use the USB drive with a normal file system again.

  3. #3
    Join Date
    Nov 2011
    Location
    /dev/root
    Beans
    7,153

    Re: Howto make USB boot drives

    The shell-script is updated 2013-06-09 (June 9) and much improved compared to the original version. It is now convenient to use also for one-off creations of USB boot devices. There are also some hints about the usage. See the opening post (the first post).

  4. #4
    Join Date
    Nov 2011
    Location
    /dev/root
    Beans
    7,153

    Re: Howto make USB boot drives

    Temporary edit:

    The startup disk creator version usb-creator-gtk is buggy in Lubuntu 13.04, and it is being debugged right now. Please install two
    additional packages, that help it work, either directly or via a PPA!

    Code:
    sudo apt-get install usb-creator-gtk python-gudev gir1.2-gudev-1.0

    or
    Code:
    sudo add-apt-repository ppa:jmarsden/lubuntu
    sudo apt-get update
    sudo apt-get install usb-creator-gtk
    It is improved in current updated/upgraded development installations of Lubuntu 13.10 (saucy-proposed December 18 2013)) and can create persistent USB drives, but it crashes when trying to erase a disk. There is project to rewrite it for 14.04 LTS. If you still have problems with usb-creator-gtk, as a temporary workaround, you can try using usb-creator-kde or one of the other tools instead.
    See this bug report (and comments #15 and #16) and this bug report about the current debugging.

    -o-

    A dd image of ubuntu-13.04-desktop-amd64.iso creates a USB pendrive that works in both UEFI and CSM (BIOS) modes.

    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.

    -o-

    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 with a 32-bit system (except very old non-PAE systems, UEFI 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. You can also start from this link to Pendrivelinux and modify the USB drive to suit what you need.
    Last edited by sudodus; December 18th, 2013 at 12:05 PM.

  5. #5
    Join Date
    Nov 2011
    Location
    /dev/root
    Beans
    7,153

    Re: Howto make USB boot drives

    The shell-script is updated 2013-06-15 (June 15) and improved compared to the previous version. 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.

    A typical dialogue looks like this the first time you run the script (and the label of the iso file does not match that on the USB drive). Either the general usage text

    Code:
    $ mkusb
    Usage:
    ---- Make a USB install device from 'file.iso' -------
    sudo /home/olle/bin/mkusb file.iso
    ---- Make a USB install device from 'file.img.gz' ----
    sudo /home/olle/bin/mkusb file.img.gz
    ---- Make a USB install device from 'file.img.xz' ----
    sudo /home/olle/bin/mkusb file.img.xz
    ---- Wipe the USB device (may take long time) --------
    sudo /home/olle/bin/mkusb wipe-all
    ---- Wipe the first megabyte (MibiByte) --------------
    sudo /home/olle/bin/mkusb wipe-1
    ---- Version -----------------------------------------
    /home/olle/bin/mkusb -v
    $
    or the specific usage text to help you cut and paste to get 'sudo and the path' easily, and then run the whole script to get the advice how to run the dd command line.

    Code:
    $ mkusb saucy-desktop-i386.iso
    Usage:
    sudo /home/sudodus/bin/mkusb saucy-desktop-i386.iso
    $
    Edit: There are more details in the first post (the tutorial) while these following posts are 'only' comments about updates.
    Last edited by sudodus; September 30th, 2013 at 10:59 AM.

  6. #6
    Join Date
    Nov 2011
    Location
    /dev/root
    Beans
    7,153

    Re: Howto make USB boot drives

    You can make a working USB install drive with the dd cloning method with mini.iso version 13.04. I learned this from innn at the Ubuntu Forums. See this link.

  7. #7
    Join Date
    Nov 2011
    Location
    /dev/root
    Beans
    7,153

    Re: Howto make USB boot drives

    Bugfix: To avoid problems, when a bad partition table is found on some of the drives

    parted -l
    was changed to parted -ls

    when used in the shell-script. See man parted

    -o-

    A compressed copy of the shell-script file is attached to the first post.

    The size and md5sum of the script file are listed. This makes it possible to check that the file was copied or downloaded correctly.
    Last edited by sudodus; June 24th, 2013 at 02:38 AM.

  8. #8
    Join Date
    Nov 2011
    Location
    /dev/root
    Beans
    7,153

    Re: Howto make USB boot drives

    There is also

    gdiskdump


    which is a GUI for diskdump (dd), a clone and imaging tool for mass storage devices (hard disk drives, SSD, USB pendrives ...).


    This is an open source Graphical User Interface for the Unix Command dd. You can easily select the Input- and Outputstream, so you can clone or image your Harddrive or Partition.


    Wikipedia: "dd is a common Unix program whose primary purpose is the low-level copying and conversion of raw data."
    The version 0.8 .deb Package is working on Ubuntu 9.10+ (x86 and amd64) and other Debian like Distros.

    [The link to gdiskdump was added at the end of post #1]

  9. #9
    Join Date
    Nov 2011
    Location
    /dev/root
    Beans
    7,153

    Re: Howto make USB boot drives

    The shell-script is updated 2013-09-05 (Sept 5) and much improved compared to the previous version. See the opening post (the first post).

    1. The script is updated to manage the changes of the iso file in version 13.10, so that the next daily build will automatically select the correct USB device.

    2. The data transfer can be monitored with pv. If not installed, the user gets a tip to install pv, but the old style is there for users who do not want the extra verbosity with pv (if pv is not installed).

    3. There is also the previous version with a minor but important fix to partly manage the new iso format of 13.10 (the version from June 23 plus a minor fix). While I'm happy with the new version and recommend it, you are given the opportunity to have this old version (with the fix), if you prefer the simpler way it works and looks. It can also be used, if you have tweaked your own version of mkusb (patch the update into your version)

    Code:
    diff mkusb2 mkusb-old-plus-minor-fix
    72c72,73
    <  target="$(blkid | grep "$label" |sed s/.:.*// |grep "/dev/sd")"
    ---
    >  #target="$(blkid | grep "$label" |sed s/.:.*// |grep "/dev/sd")"
    >  target="$(blkid | grep "$label" |cut -b -8 |grep "/dev/sd")"
    4. The code windows in the opening post are also updated for typical input and output when using mkusb.

    5. There is a brief introduction to the One Button Installer

    There is a wiki page at https://help.ubuntu.com/community/OBI, and files to download are available at http://phillw.net/isos/one-button-installer/. There is also a tutorial thread here, One Button Installer, 'OBI'.
    Last edited by sudodus; December 31st, 2013 at 09:10 AM.

  10. #10
    Join Date
    Nov 2011
    Location
    /dev/root
    Beans
    7,153

    Re: Howto make USB boot drives

    The new version 4 is available now, but several instructions in post #1 are still describing version 3. Version 4 is more automatic. You need not copy and paste the command line. This example shows how to select the target device with (+/-) or the number of the list item. Go ahead with (g) or quit with (q). (Toggle 'USB-only' with (u) if you want to write to a drive that is not a USB drive.)
    Code:
    sudo mkusb saucy-desktop-i386.iso
    The iso file SHOULD BE loop mounted on a temporary file READ-ONLY:
    mount: warning: /tmp/tmp.Jbu6YwpDsR seems to be mounted read-only.
    Lubuntu 13.10 "Saucy Salamander" - Beta i386 _found_ in iso-file
    Lubuntu 13.10 "Saucy Salamander" - Beta i386 _not_ in USB device
    Do you want to make a new one? (y/n)
    y
    ***  WARNING: the device will be completely overwritten      ***
         Use the info in the xterm window (less /tmp/help-mkusb.txt)
    ***  quit with (q)                                           ***
    ***  Unmount the device if mounted  ****************************
     
    Model: ATA SAMSUNG HD322HJ (scsi)    Disk /dev/sda: 320GB    
    Model: ATA OCZ-AGILITY3 (scsi)    Disk /dev/sdb: 60.0GB    
    Model: ATA WDC WD10EARS-00Y (scsi)    Disk /dev/sdc: 1000GB    
    Model: SanDisk Cruzer Blade (scsi)    Disk /dev/sdd: 4005MB    
    Model: SanDisk Extreme (scsi)    Disk /dev/sde: 32.0GB    
    Model: JetFlash Transcend 16GB (scsi)    Disk /dev/sdf: 15.8GB    
    Live drive: /dev/sdb
    USB drive:  /dev/sdd: 4004 MB, 4004511744 bytes
    USB drive:  /dev/sde: 32.0 GB, 32017047552 bytes
    USB drive:  /dev/sdf: 15.8 GB, 15812526080 bytes
     
    ---> 1: install to SanDisk Cruzer Blade (scsi) Disk /dev/sdd: 4005MB
         2: install to SanDisk Extreme (scsi) Disk /dev/sde: 32.0GB
         3: install to JetFlash Transcend 16GB (scsi) Disk /dev/sdf: 15.8GB
    Select another device with (+/-) or the number of the list item.
    Go ahead with (g) or quit with (q). Toggle USB-only with (u).
    2
         1: install to SanDisk Cruzer Blade (scsi) Disk /dev/sdd: 4005MB
    ---> 2: install to SanDisk Extreme (scsi) Disk /dev/sde: 32.0GB
         3: install to JetFlash Transcend 16GB (scsi) Disk /dev/sdf: 15.8GB
    Select another device with (+/-) or the number of the list item.
    Go ahead with (g) or quit with (q). Toggle USB-only with (u).
    g
    2: source: saucy-desktop-i386.iso
       target: SanDisk Extreme (scsi) Disk /dev/sde: 32.0GB 
    Do you really want to wipe and install to this device? (y/n)
    'Do you really want to wipe and install to this device? (y/n)' is the last warning. If you answer y (and press the Enter key), the source file will be cloned to the target device.

    This interface is borrowed from the One Button Installer, version 0.6 and 0.7.

    Version 4 works well not only in graphical desktops with terminal windows, but also in text screens (for example in a server). It can manage img.xz files (compressed with xz with ~20% better compression than gzip).
    Last edited by sudodus; November 11th, 2013 at 09:50 AM.

Page 1 of 5 123 ... LastLast

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
  •