0

As the title says I'm trying to convert a raw image file to an iso image.

I've used these as reference when doing this.

https://www.turnkeylinux.org/blog/convert-vm-iso

https://manpages.debian.org/cgi-bin/man.cgi?sektion=1&query=xorrisofs&apropos=0&manpath=sid&locale=en

brief (tldr:) (there is an extended background at the bottom, if it helps)

I created a raw image from my qcow2 VM, and mounted this as a loopback device into

virtMachineIMG.mount

When I run the following

xorrisofs -v -J -r -V -o ./MyCentos_img.iso ./virtMachineIMG.mount/

I get an error at the end that the image is too large and cannot be written.

Does anyone have any ideas of how I can get around this?

My raw image file is 8gig in size. I'm not sure exactly how much of this is used, or how to safely 'shrink' the disk to just the size of the data within.

Am I missing a step in my preparation ? should I be creating another disk with qemu that I then burn my raw image onto ?

I should note that my raw image (original qcow2 file) used LVM, does this make a difference?

All help is greatfully accepted, and hugely appreciated.

David.

ps. if you need more details of the verbose output just ask, I can always re-run xorrisofs - it takes about 2 hours to run, is this normal ?

___________ Background : ____________

I've setup up a test system on a local pc in a virtual machine Host : Debian Guest : Centos using : Qemu / KVM inside Virtual Machine Manager.

due to the nature of the test system I needed to 'install from source' and setup all the required parts (Postgres, Tomcat... etc, etc, etc ...).

This went really well, and my colleagues are pleased with what I have done. However so as they aren't required to come to my office I proposed to see if I could make this into a ISO that they could then easily run from anywhere.

Reasoning :

  • They could boot into this system from any pc.
  • It could be more easily moved to another server (as required).
  • Didn't want to trouble my colleagues with needing to install anything, just plug the USB drive with the ISO into your pc, and boot from it directly.
  • Also much easier for giving any presentations of the platform.
  • can use it to create a VM inside one of our servers for extended testing (I'm making the assumption that an ISO is going to be easier for this, rather than a raw or qcow2)

Obviously if there where rpms or debs of the main part platform (didn't need to install from source), then I would have simply created a CentOS ISO with links to the required rpms to start an install.

Also I want my colleagues to access some 'sample data' within the platform, and this way I can be sure we are all working from the same base.

1 Answer 1

0

Thank you for flying xorriso.

Without knowing the exact error message i have to guess somewhat. Such a refusal can happen if the resulting ISO image will not fit on your local disk. A run time of 2 hours points towards a directory loop inside ./virtMachineIMG.mount. If this is the case, then programs like "du" and "find" should show strangely repeated output, too.

In any case your xorriso run lacks boot equipment suitable for ISO filesystems. Since you seem to want to boot a real machine from USB it will need a MBR and possibly a GUID Partition Table. Further the ISO filesystem has to contain all files which are needed to run the operating system on the real machine, and the boot loader which starts by MBR or GPT has to know how to boot your operating system. (The overall ISO is classically known as "Live CD".)

If your virtual system already boots via bootloader GRUB2 then you are not too far away from that. Program "grub-mkrescue" takes care of the boot loader software and composing the expert xorriso options. See https://www.gnu.org/software/grub/manual/html_node/Making-a-GRUB-bootable-CD_002dROM.html

The remaining expert task will be to derive a "grub.cfg" file for "grub-mkrescue" from the "grub.cfg" file in the VM disk image.

An alternative to GRUB2 is ISOLINUX with isohybrid. See http://www.syslinux.org/wiki/index.php?title=Isohybrid Many Linux distros use ISOLINUX for BIOS firmware and GRUB2 for EFI firmware in the same ISO image.


xorrisofs -v -J -r -V -o ./MyCentos_img.iso ./virtMachineIMG.mount/

This command line is wrong, because option -V expects a string as Volume Id (aka disk label). It will consume option -o, leaving "./MyCentos_img.iso" as input path (like is intended for "./virtMachineIMG.mount").

If "./MyCentos_img.iso" does not exist yet, the run should fail with

xorriso : FAILURE : Cannot determine attributes of source file './MyCentos_img.iso' : No such file or directory

Else you get a lot of binary data put out to your terminal (because stdout is the default if no option -o is recognized).

1
  • Ah so I need to check my command line. I hoped that I had correctly added in the required details for grub etc. But with your extra info I should be able to determine if it has worked. A directory loop in my image sounds possible (I do use hard links for certain stuff that is source controlled), and maybe it is an artifact of using LVM in the virtual machine. For now you have given me plenty of stuff to investigate. I'll get back to you shortly. Thanks
    – DaveM
    May 24, 2016 at 17:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .