How to convert a iso9660 ISO to a USB ISO
I have an ISO of customized GCompris based on Ubuntu. It is intended to be burned on a CD (iso 9660 FS Type). When I try to burn it to a USB, the pendrive "becomes" a CD and it won't boot...
The guy who made this ISO as a school project a while back, says he can't remember how he made it in the first place, but it has something to do with extracting the squashfs and re-create it using chroot.
Can any of you point me to a step by step guide on how to do it - from the top?
Solution 1:
Here is an answer using the same utilities from ipse lute's answer, but with a full procedure and more detail, as requested by the OP.
CAUTION: this procedure uses the dd
command; please ensure that you know how to use it properly.
PURPOSE
This document explains how to "hybridize" an ISO 9660 filesystem (.iso file), such that it can be booted from optical media and disk storage devices such as USB flash drives. This process is achieved using tools developed by the Syslinux Project: http://www.syslinux.org/wiki/index.php?title=The_Syslinux_Project
SOURCES
- http://www.syslinux.org/wiki/index.php?title=The_Syslinux_Project
- http://www.syslinux.org/wiki/index.php?title=ISOLINUX
- http://www.syslinux.org/wiki/index.php?title=Isohybrid
PROCEDURE
Initial setup: Install the required software
sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc) main universe"
sudo apt-get install syslinux isolinux syslinux-utils syslinux-efi
-
Determine if your ISO is non-hybridized, run:
fdisk -l <your.iso>
You will see output like (exact contents may differ):
Disk your.iso: 709.3 MiB, 743718912 bytes, 1452576 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
If you already have a hybridized ISO, you will see output like the following (Ubuntu Trusty Desktop used as an example; all Ubuntu ISOs are hybridized; formatting from stdout has been mangled here):
Disk ubuntu-14.04.4-desktop-amd64.iso: 1020 MiB, 1069547520 bytes, 2088960 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: 0x1a447608 Device Boot Start End Sectors Size Id Type ubuntu-14.04.4-desktop-amd64.iso1 * 0 2088959 2088960 1020M 0 Empty ubuntu-14.04.4-desktop-amd64.iso2 26268 30811 4544 2.2M ef EFI (FAT-12/16/32)
-
If your ISO is already hybridized, skip to step 4. If you have a non-hybridized ISO, install the appropriate packages as follows: In a Debian Linux distro, run as root (e.g with
sudo
):apt-get install syslinux isolinux syslinux-utils syslinux-efi
-
Hybridization: If you would like to retain your original, un-hybridized ISO, first make a new copy, which we will call
your.hybrid.iso
. On the new copy, Run:isohybrid <your.hybrid.iso>
Note: this will overwrite the contents of the existing ISO. If you don't need the original, simply operate on it.
-
Make a bootable disk from the ISO (e.g. USB flash drive)
-
Determine the device file assigned to the USB drive. Open a terminal and run
tail -f /var/log/syslog
This will allow you to be ABSOLUTELY SURE which device file the kernel assigns to the device when it is inserted. You should see a line like:
Aug 5 11:04:34 yourbox kernel: [2407408.163088] sd 23:0:0:0: [sdX] Attached SCSI removable disk
This indicates that the USB drive was assigned
/dev/sdX
, whereX
is usually a lowercase alphabetic character.- Insert the USB drive, and note the device file
/dev/sdX
by watching the output ofsyslog
.
- Insert the USB drive, and note the device file
Unmount all partitions of the flash drive, if any were automatically mounted.
-
Dump the file to the USB drive. Use WITH EXTREME CAUTION
dd
to dump the ISO to the driveMake absolutely sure you replace X with the letter associated with your drive's device file in the following command, and that you make NO typos (e.g. stray whitespace) in the arguments!! If you mess up, you could destroy your whole system.
-
Run, as root:
dd if=<your.hybridized.iso> of=/dev/sdX bs=4M && sync
-
Remove the USB drive, insert it into the machine to be booted, and boot from the USB drive in BIOS mode. By default,
isohybrid
will create a BIOS mode bootable drive, but there is an option to create a UEFI bootable drive. Seeman isohybrid
for more information.Enjoy installing your new OS!
Solution 2:
Install a program called 'syslinux' by sudo apt-get install syslinux
. Then create/obtain an ISO9660 file (e.g. filename.iso). In a terminal window type: isohybrid filename.iso
. Now the iso file is hybrid, you can use it as CD and USB image file. The hybridization process will change the checksum of the file. Make sure to check it against the new checksum.
You can find more details here: http://www.syslinux.org/wiki/index.php?title=Isohybrid.