Modding an ISO for easy installation on an USB pen drive

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
User avatar
Neolander
Member
Member
Posts: 228
Joined: Tue Mar 23, 2010 3:01 pm
Location: Uppsala, Sweden
Contact:

Modding an ISO for easy installation on an USB pen drive

Post by Neolander »

Hello everyone !

Lately, I've discovered that you can make a liveUSB out of certain CD images simply by DDing the image onto a USB pen drive. As an example, it works with most of Fedora's ISOs.

http://fedoraproject.org/wiki/FedoraLiv ... Linux_only

I'm amazed by the beautiful simplicity and geekiness of this, and since I've recently switched to CD images for my OS, I certainly would like to get this trick working with my own ISOs too. However, the page linked above seems to imply that this only works with some Fedora images, which I assume have been tweaked specifically for this purpose. So my question is, how should I tweak my ISO images so that this trick works ?
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: Modding an ISO for easy installation on an USB pen drive

Post by Combuster »

I can't be bothered to download a Fedora image to inspect it, but an ISO 9660 filesystem starts off with several reserved sectors which are intended for booting mechanisms, and several non-x86 architectures indeed use it for that purpose. It means that you can use that same space to insert a typical MBR bootsector and other bootloader stages so when you copy the image to USB it will boot the image as a harddisk, reading the MBR in the first 512 bytes of the image, while if you boot it as a CD it will start from an El-torito configuration. Both bootstraps can then start a common bootloader. You just have to make sure it can read the ISO filesystem independent of the device's sector size.

Of course, that's just one possible use of the reserved area.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
User avatar
Neolander
Member
Member
Posts: 228
Joined: Tue Mar 23, 2010 3:01 pm
Location: Uppsala, Sweden
Contact:

Re: Modding an ISO for easy installation on an USB pen drive

Post by Neolander »

Hmmm... Indeed, this looks significantly more complicated than I thought. Finding a bootloader which may boot on an ISO 9660 file system out of USB does not sound like a fun task, and the other methods use weird tricks like putting the system on a disk image file which is itself put on the CD.

Will just stick with regular ISOs right now, I think. Thanks.
Post Reply