bits release in progress

ISO9660 to (bootable) USB

Tags shell


Today, while checking my drives with smartctl, i got a cute warning:

==> WARNING: There are known problems with these drives,
see the following web pages for details:

Seagate provide an Eltorito (bootable) ISO9660 (only).

"Unfortunately" i don't have an optical drive on my computer, so things got complicated from here.

At first i though booting the ISO from my hard-drive; i added to my /etc/lilo.conf:

image = /usr/share/syslinux/memdisk
   label = bootable iso
   initrd = /path/to/file.iso

But it froze during the loading process...

Then i though putting the content of the ISO to a FreeDOS bootdisk, but the ISO didn't contain the utility to flash the hard-drive firmware (obviously it is in the bootloader).

Ok, what if i just cat file.iso > /dev/usbdisk? Nope, it won't boot...


First, find where the bootloader is in the ISO using cdrtools (only revelant information shown):

# isoinfo -d -i file.iso
Logical block size is: 2048
Eltorito validation header:
    Eltorito defaultboot header:
     Bootid 88 (bootable)
     Boot media 2 (1.44MB Floppy)
     Load segment 0
     Sys type 0
     Nsect 1
     Bootoff 15 21

Then, extract the bootloader from the ISO and put it on the USB stick (720 is 1.44MB / 2048):

dd if=file.iso bs=2048 skip=21 count=720 of=/dev/usbdisk

It worked, for this time.