Can't create bootable USB flash drive

Bug #1623261 reported by Dan Jared
14
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cubic
Fix Released
High
Cubic PPA

Bug Description

Can't create bootable USB flash drive from custom .iso.

After write image to flash drive, I can't boot PC from this USB drive.
I write image to drive via Disk utility (standard Ubuntu utilities) and dd.

Difference

#################Original iso#################
fdisk -lu ubuntu-16.04.1-desktop-amd64.iso
Disk ubuntu-16.04.1-desktop-amd64.iso: 1,4 GiB, 1513308160 bytes, 2955680 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x40a863e7

Device Boot Start End Sectors Size Id Type
ubuntu-16.04.1-desktop-amd64.iso1 * 0 2955679 2955680 1,4G 0 Empty
ubuntu-16.04.1-desktop-amd64.iso2 2927216 2931951 4736 2,3M ef EFI (FAT

#################Custom iso#################
fdisk -lu ubuntu-16.04.1-2016.09.08.1-desktop-amd64.isoDisk ubuntu-16.04.1-2016.09.08.1-desktop-amd64.iso: 1,2 GiB, 1299550208 bytes, 2538184 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

Revision history for this message
Babah (babahcv) wrote :

Hello.
I find how to resolve this issue.

Need to install syslinux-utils and run in terminal $ sudo isohybrid /path/to/custom_iso.iso
 or add to utilities.py new string:

hybrid = 'isohybrid "%s" .' % (
        model.custom_iso_image_volume_id, model.custom_iso_image_filepath)
    execute_asynchronous(thread, hybrid, model.custom_live_iso_directory)

But this solution don't work for UEFI mode, i can't create second partition (EFI) in .ISO file:

ubuntu-16.04.1-desktop-amd64.iso1 * 0 2955679 2955680 1,4G 0 Empty
ubuntu-16.04.1-desktop-amd64.iso2 2927216 2931951 4736 2,3M ef EFI (FAT

Maybe this information can help you for update CUBIC Repackage Functions

Revision history for this message
Babah (babahcv) wrote :

Sorry, this one

hybrid = 'isohybrid "%s" .' % (
        model.custom_iso_image_filepath)
    execute_asynchronous(thread, hybrid, model.custom_live_iso_directory)

Revision history for this message
Kevin Mills (sagiri) wrote :

I'm experiencing the same issue. The suggested isohybrid solution seems to work (barring UEFI, of course), but I'm not sure I understand the proposed utilities.py patch. There isn't a top-level object called thread, so if you try to add it to the bottom (like the directions seem to be saying), it'll just give an error. I'm guessing you're supposed to add it to some function, but I couldn't find an obvious place.

But, in any case, it's especially weird because I was able to successfully use Cubic on Xenial (the same computer, although I've reinstalled Ubuntu since) just a few weeks ago without this issue, and it looks like nothing has been changed in Cubic.

Revision history for this message
Babah (babahcv) wrote :

Hello.
This source need to add after:

command = 'mkisofs -r -V "%s" -cache-inodes -J -l -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -o "%s" .' % (
        model.custom_iso_image_volume_id, model.custom_iso_image_filepath)
    execute_asynchronous(thread, command, model.custom_live_iso_directory)

Cubic PPA (cubic-wizard)
Changed in cubic:
assignee: nobody → Cubic PPA (cubic-wizard)
Revision history for this message
Jeremy Schneider (ardentperf) wrote :

I can confirm that running isohybrid (from syslinux-utils package) on the ISO with no flags after cubic is finished will generated an image that can boot from USB. However, as noted above, the image is only bootable in legacy/MBR mode. I have a Dell Inspiron laptop which doesn't seem to support legacy booting from USB anymore - so I think I would need UEFI support to boot on that laptop. The stock ubuntu 16.04 does boot from USB on this laptop; just the cubic-generated ISOs don't.

This page has some good info about isohybrid and UEFI support:
http://www.syslinux.org/wiki/index.php?title=Isohybrid#UEFI

I tried to run isohybrid on the cubic image with the --uefi flag and I get this error:
isohybrid: /media/.../ubuntu-16.04.1-2016.12.15-desktop-amd64.iso: unable to find efi image

From the syslinux wiki page above, I believe the reason is that for uefi support we also need to pass a special flag to the mkisofs/genisoimage command. Just needs to be tested out!

Revision history for this message
Ryan M (rienspace) wrote :

I am able to create a UEFI iso, and in turn dd to a usb drive to install on a system using the following command.

xorriso -as mkisofs -isohybrid-mbr /usr/lib/ISOLINUX/isohdpfx.bin -c isolinux/boot.cat -b isolinux/isolinux.bin -no-emul-boot -boot-load-size 4 -boot-info-table -eltorito-alt-boot -e boot/grub/efi.img -no-emul-boot -isohybrid-gpt-basdat -o /path/to/UEFI.iso /path/to/cubic/workspace/custom-live-iso/

Running this on ubuntu 16.04, note you need the following software
    xorriso
    mkisofs
    isolinux

Also note that you need to uncheck the 'clear work space' check when finished with cubic, otherwise the custom-live-iso directory may get cleared

Revision history for this message
Jeremy Schneider (ardentperf) wrote :

Nice! xorriso command from @rienspace worked for me!

I tweaked the command slightly to more closely mirror the existing cubic code, and make it a smaller change while still getting the desired UEFI support.

We would need to add dependencies for xorriso and isolinux - and I just checked the control file on trunk and it seems we're missing the dependency for genisoimage (provides mkisofs) which should have been included already since the cubic code already needs mkisofs to work properly.

I've attached patches to update utilities.py and the control file from the current trunk. Hope this helps!

Revision history for this message
Cubic PPA (cubic-wizard) wrote :

Dan Jared and Kevin Mills, Ryan M, thanks for testing.
Babah and Jeremy Schneider, thanks for the approach and patch file.

Here are instructions if anyone needs to apply this patch...

# Download the patch from https://bugs.launchpad.net/cubic/+bug/1623261/+attachment/4797059/+files/cubic_bug1623261_2016-12-27.zip

$ cd <download location>
$ unzip -p cubic_bug1623261_2016-12-27.zip cubic-utilities.patch > cubic-utilities.patch
$ sudo patch /usr/share/cubic/utilities.py cubic-utilities.patch

Also, regarding genisoimage, only listed packages as dependencies if they are additional to those included in the official release.
    Ubuntu 14.04.5 LTS (Trusty Tahr) has genisoimage version 9:1.1.11-2ubuntu3
      (see http://releases.ubuntu.com/trusty/ubuntu-14.04.4-desktop-amd64.manifest)
    Ubuntu 16.04.1 LTS (Xenial Xerus) has genisoimage version 9:1.1.11-3ubuntu1
      (see http://releases.ubuntu.com/16.04/ubuntu-16.04-desktop-amd64.manifest)
    Ubuntu 16.10 (Yakkety Yak) has genisoimage version 9:1.1.11-3ubuntu1
      (see http://releases.ubuntu.com/16.10/ubuntu-16.10-desktop-amd64.manifest)

I am going to mark this bug as triaged, using the patch above.
I will try to include a fix in a future release.

Changed in cubic:
status: New → Triaged
importance: Undecided → High
Cubic PPA (cubic-wizard)
Changed in cubic:
status: Triaged → In Progress
Revision history for this message
Cubic PPA (cubic-wizard) wrote :

Fix releases; version 2016.12-16~201701160301~release~ubuntu17.04.1.

Changed in cubic:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related questions

Remote bug watches

Bug watches keep track of this bug in other bug trackers.