LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   convert an ISO file into an IMG file (https://www.linuxquestions.org/questions/linux-newbie-8/convert-an-iso-file-into-an-img-file-635911/)

chris6686 04-17-2008 02:47 AM

convert an ISO file into an IMG file
 
hi, i want to burn an iso file on a memory stick.

David the H. 04-17-2008 06:20 AM

Do what now?

SlowCoder 04-17-2008 07:24 PM

Have you tried the dd command?

DeeCodeUh 04-17-2008 07:26 PM

Personally...no.

ewolf 04-17-2008 08:07 PM

I'm just making an assumption, but are you trying to make a bootable USB drive with the contents of a bootable .ISO file? It's a little more involved than converting the file format. Also, afaik, there's no difference between an .img and an .iso file, except that an .img could contain any filesystem (or no filesystem), whereas an .iso image specifically contains an ISO9660 filesystem. So if you are indeed trying to take a bootable .iso and create a bootable USB drive from it, its not an issue of converting between file formats, its an issue of getting the files off of the ISO9660 filesystem, and onto some other filesystem on your USB drive. Then, you would have to make the USB drive bootable, and configure it to boot the kernel-image in the filesystem. There are a few different options. One of them is outlined here:
http://www.damnsmalllinux.org/wiki/i...B_installation

Is that what you were looking for?

Cheers,
Elijah
http://elijahr.blogspot.com/

chris6686 04-21-2008 01:06 AM

thank u very much.
 
thanks for your help. i have try it before but i was forget some details.. thanks again.

Linux_420 12-04-2011 08:11 PM

to make an oversized bootable floppy image out of a .iso image here are some tips:

make an image with the msdos/vfat filesystem on it (in this case it would be 1.44 MB)

user@host# mkfs.msdos /tmp/file.img -C 1440

mount the image file as a loopback device:

user@host# mkdir /tmp/img/
user@host# sudo mount -t vfat -o loop /tmp/file.img /tmp/img

install a MBR (master boot record):

user@host# sudo syslinux -m /dev/loop0

install syslinux to the image file:

user@host# sudo syslinux -i /dev/loop0

copy the contents of the iso image to the image file:

user@host# mkdir /tmp/iso/
user@host# sudo mount -t iso9660 /path/to/iso/file.iso /tmp/iso/
user@host# sudo cp -vr /tmp/iso/* /tmp/img/

make sure all of the "isolinux" names have been changed to "syslinux"

you can now use syslinux to boot this .img file using memdisk .. your syslinux.cfg entry will look something similar to this:

LABEL distro
KERNEL memdisk
APPEND initrd=/path/to/img/file.img

this should get your kernel & initial ramdisk to load up but it doesn't quite get you to the finish line. i'm not even sure if this is the best way to do this but it would be nice to have a very neat usb stick full of bootable images so files don't get rearranged or deleted or whatever. also if i get this working i won't have to fck around with paths in syslinux.cfg files. for example, getting DSL (Damn Small Linux) to find that KNOPPIX filesystem can be frustrating if you implement it with a custom file tree. maybe you could append an option to mount the .img file while booting up so that your kernel can find the filesystem and other files it needs?

any help would be appreciated on finishing the last leg of this ..

MAKE SURE SYSLINUX IS UP TO DATE AND THAT YOU DON'T OVERWRITE YOUR MBR OR BOOTLOADER WHILE YOU ARE DOING THIS. GO AHEAD AND BACK THEM UP BEFORE DOING THIS!

======================================================================

EDIT: if you take the filesystem out of the iso and put it on the usb drive where it usually goes (i.e. for geexbox 2.0 put the rootfs file at the root of your usb stick & for DSL put the KNOPPIX file in a folder named KNOPPIX at the root of your usb stick) then this method will work. however, considering all that is in some of these iso files is a kernel, initrd & a filesystem it is somewhat pointless to even do it using this workaround.

======================================================================

EDIT: LOL DO NOT IMPLEMENT THIS!!! DO IT THIS WAY... YOU'LL HAVE TO MAKE CUSTOM INITIAL RAMDISKS FOR EACH DISTRO IN THE END.. & GO MAD!

INSTEAD FOLLOW THIS TUTORIAL I MADE: http://www.linuxquestions.org/questi...30#post4542230

======================================================================


Edit: it is prob. possible to point to the filesystem within the .img file using by appending something like BOOT_IMAGE=/dev/initrd/path/to/filesystem

That might conclude this thread once and for all.


All times are GMT -5. The time now is 09:26 AM.