Author Topic: ISO to USB using Hybrid ISOs  (Read 4275 times)

Offline Was_Just19

  • Hero Member
  • *****
  • Posts: 6852
  • MLU
ISO to USB using Hybrid ISOs
« on: January 08, 2011, 09:08:08 AM »
I have been playing about with isohybrid, which is a means of converting suitable ISOs to a format that can be written directly to USB using either the  'dd'  command or the  'cat'  command.

This definitely has its uses, but is not very amenable to easy change of the setup etc.
I am told persistence is possible .....  and have succeeded in getting it working .....  but it is not easy or convenient, especially if you wish to change the OS on the USB stick very often.

Most of what I met with is detailed in this thread, including a link to a small script which facilitates the convertion and writing of the selected ISO to the USB device.

http://mypclinuxos.com/forum/index.php?topic=2844

Presently I am trying to find some detailed information about the isohybrid available options and how exactly they affect the use of the device afterwards.
It would be my intention to add features to the script if they are of general use.

For the moment it is a quick and simple means of testing a 'foreign' distro on a USB stick. It does also work with PCLOS ISOs.

So if anyone has links to detailed information about the isohybrid options, please post, as without that info it is really shooting in the dark.

The 'help' option for isohybrid returns the following:-

Code: [Select]
[user@localhost ~]$ isohybrid --help
Usage: /usr/bin/isohybrid [options] filename.iso
Options:
  -h          Number of default geometry heads
  -s          Number of default geometry sectors
  -entry      Specify partition entry number (1-4)
  -offset     Specify partition offset (default 0)
  -type       Specify partition type (default 0x17)
  -id         Specify MBR ID (default random)
  -forcehd0   Always assume we are loaded as disk ID 0
  -ctrlhd0    Assume disk ID 0 if the Ctrl key is pressed
  -partok     Allow booting from within a partition

....  not very helpful IMO.

regards.

Offline Neal ManBear

  • Administrator
  • Super Villain
  • *****
  • Posts: 15847
  • LXDE! Coffee, Bacon and Cheesecake!
Re: ISO to USB using Hybrid ISOs
« Reply #1 on: January 08, 2011, 03:19:27 PM »
I am interested, too. :)


Offline Old-Polack

  • Administrator
  • Super Villain
  • *****
  • Posts: 11580
  • ----IOFLU----
Re: ISO to USB using Hybrid ISOs
« Reply #2 on: January 08, 2011, 03:54:26 PM »
I am interested, too. :)



Same here, especially the last one, -partok, which gives an interesting description, but for which I can't find any serious details.
Old-Polack

Of what use be there for joy, if not for the sharing thereof?



Lest we forget...

Offline Was_Just19

  • Hero Member
  • *****
  • Posts: 6852
  • MLU
Re: ISO to USB using Hybrid ISOs
« Reply #3 on: January 08, 2011, 04:55:11 PM »
I am interested, too. :)



Same here, especially the last one, -partok, which gives an interesting description, but for which I can't find any serious details.

Well I am glad it was not my blindness that caused me not to find the details .....  or indeed searching for the wrong terms which is likely I guess.

I believe that -partok  might be a default setting, although it does not say so.
The fact that the ISO is written into a partition implies that this is what is being referred to.
It seems that the particular partition can be chosen using -entry  and I guess that the -offset option is to determine the start point of whatever partition is specified. In what measurement that offset should be specified is not know to me.

Of course without proper information all that is guesswork.

Maybe with another couple of pairs of eyes looking something can be found.

regards.

Offline Old-Polack

  • Administrator
  • Super Villain
  • *****
  • Posts: 11580
  • ----IOFLU----
Re: ISO to USB using Hybrid ISOs
« Reply #4 on: January 08, 2011, 05:48:19 PM »
I am interested, too. :)



Same here, especially the last one, -partok, which gives an interesting description, but for which I can't find any serious details.

Well I am glad it was not my blindness that caused me not to find the details .....  or indeed searching for the wrong terms which is likely I guess.

I believe that -partok  might be a default setting, although it does not say so.
The fact that the ISO is written into a partition implies that this is what is being referred to.
It seems that the particular partition can be chosen using -entry  and I guess that the -offset option is to determine the start point of whatever partition is specified. In what measurement that offset should be specified is not know to me.

Of course without proper information all that is guesswork.

Maybe with another couple of pairs of eyes looking something can be found.

regards.

Exactly my point, there being no followup or examples as to just how/when these entries are properly used, or how to implement them in practical use. I've used dd to copy the hybrid iso to a partition, other than the first, but get a "not a proper block device" error message when trying to boot the image. The boot code is at the very beginning of the image, as seen through Octeta, even when the -offset 1 option is used. Where the offset actually occurs is unclear, if it's working at all.

Even though one must first extract the kernel and initrd.gz images, at least the bootfromiso=/path/to/*.iso parameter in a grub stanza allows the rest of the OS to boot from the image, wherever it's located on the designated partition. This makes use of isolinux's ability to loop mount the image from within the extracted initrd.gz image. One would think something similar would be expected from the hybrid image, without the need to extract those images.
« Last Edit: January 08, 2011, 06:57:51 PM by old-polack »
Old-Polack

Of what use be there for joy, if not for the sharing thereof?



Lest we forget...

Offline Was_Just19

  • Hero Member
  • *****
  • Posts: 6852
  • MLU
Re: ISO to USB using Hybrid ISOs
« Reply #5 on: January 08, 2011, 06:20:28 PM »
....
 One would think something similar would be expected from the hybrid image, without the need to extract those images.

It is beginning to look like a 'face-saving' stunt .......  as in 'oh yes you can now write the ISO to USB, all is great', but it has no real-life use, or very little.
It certainly does not appear to have any of the functions/facilities that are available by other means, so could not be considered in any way competitive with them.

Presently I can see it as a 'quick fix' to run an ISO on USB, but nothing else.

Maybe with better info it might be more amenable to general use .....  as in a USB drive to carry about, with persistence and easily changeable from one ISO to another.

Is it even possible to write an ISO to a stick without deleting all partitions and their contents?
16GB & 32GB USB sticks are common.
Am I going to destroy what I have set up on such a stick just to write a Hybrid ISO to it?
I am not, and I think that is its main problem.
That coupled with trying to set up persistence .....  where you have to (it seems) edit the boot options within the ISO first specifying your changes location which I guess could only be done by the use of LABEL, then convert it to hybrid and then write it to a stick, then set up a new partition for persistence with the correct LABEL, hoping that nothing else will have a similar LABEL wherever it might get booted.

Nothing about it is easy or simple, it appears.
Which is rather disappointing.   :(

regards.

smcs_steve

  • Guest
Re: ISO to USB using Hybrid ISOs
« Reply #6 on: January 08, 2011, 06:29:45 PM »
Exactly my point, there being no followup or examples as to just how/when these entries are properly used, or how to implement them in practical use. I've used dd to copy the hybrid iso to a partition, other than the first, but get a "not a proper block device" error message when trying to boot the image. The boot code is at the very beginning of the image, a seen through Octeta, even when the -offset 1 option is used. Where the offset actually occurs is unclear, if it's working at all.
This  works!..
I'm not on my work tower today so won't post full details.  
Looking at the multiboot stick I made using isohybrid, my first partition - label LiveOS  ;)  (Fat32 to satisfy Windows >:() has the normal boot folder/menu.lst etc as per PCLOS USB tradition + legacy GRUB installed (hd?,0) -- other partitions I prepared as 100MB larger than target iso & dd 'd as follows (as root)> eg:
isohybrid -partok pclinuxos-gnome-2010.12.iso
dd if=pclinuxos-gnome-2010.12.iso of=/dev/sdX2

etc for the other PCLOS distros..
N.B.: Do not place extracted livecd.sqfs/isolinux folder in first partition sdX,1  else it will hijack other boot choices!  Renaming livecd.sqfs/isolinux may avoid this?  But I haven't tried it yet..
Shut down other partitioning apps like Gparted or else data transfer may be very slow..

menu.lst stanza examples>

title   pclinuxos-gnome-2010.12
root (hd0,1)
savedefault
makeactive
chainloader +1

title   pclos something else
root (hd0,2)
savedefault
makeactive
chainloader +1


etc...
all this an obvious implementation of isohybrid stuff posted by kerapp25.  
What interests me is to resolve the append/pass kernel variable in legacy GRUB ...
or
isohybrid -partok pclinuxos-gnome-2010.12.iso
dd if=pclinuxos-gnome-2010.12.iso of=/path/to/my.iso
(edit> fail!)
and launch my.iso on a multiboot grub2 stick?
But that may have to wait till tomorrow when I'm back on station - family responsibilities now, got to go!

 Sorry Just19, you posted while I was away from keyboard.
>Steve
« Last Edit: January 09, 2011, 03:57:48 AM by _steve »

smcs_steve

  • Guest
Re: ISO to USB using Hybrid ISOs
« Reply #7 on: January 08, 2011, 06:52:07 PM »
Am I going to destroy what I have set up on such a stick just to write a Hybrid ISO to it?
I am not, and I think that is its main problem.
No need..  see above post!
That coupled with trying to set up persistence .....  where you have to (it seems) edit the boot options within the ISO first specifying your changes location which I guess could only be done by the use of LABEL, then convert it to hybrid and then write it to a stick, then set up a new partition for persistence with the correct LABEL, hoping that nothing else will have a similar LABEL wherever it might get booted.
I hope to avoid these extremes -- I have some promising ideas -- we'll see how they pan out! ;D
>Steve

Offline Old-Polack

  • Administrator
  • Super Villain
  • *****
  • Posts: 11580
  • ----IOFLU----
Re: ISO to USB using Hybrid ISOs
« Reply #8 on: January 08, 2011, 07:05:21 PM »
_steve:

Not clear as to your intent in your last post. Are you saying this worked, or did not work, for the image on sdx2?
Old-Polack

Of what use be there for joy, if not for the sharing thereof?



Lest we forget...

smcs_steve

  • Guest
Re: ISO to USB using Hybrid ISOs
« Reply #9 on: January 08, 2011, 07:11:40 PM »
_steve:

Not clear as to your intent in your last post. Are you saying this worked, or did not work, for the image on sdx2?

Yes it does work.. sdX2..   Gnome boots fine!
I select boot menu choice> pclinuxos-gnome-2010.12
The laptop gives a beep and then the LiveCD Startup Option menu for pclinuxos-gnome-2010.12 appears. etc..

My other comments relate to persistence. I still need to tidy up some details with regards to persistence.
No promises... We'll see..
>Steve
« Last Edit: January 08, 2011, 07:28:28 PM by _steve »

Offline Was_Just19

  • Hero Member
  • *****
  • Posts: 6852
  • MLU
Re: ISO to USB using Hybrid ISOs
« Reply #10 on: January 08, 2011, 07:31:08 PM »
OK, I built the Hybrid ISO with the -partok option.
Wrote it to an available partition on a USB stick.
I have PCLOS installed on other partitions, so I edited the Grub menu.lst of the control Grub to boot the Hybrid install.

Unfortunately it would not boot for me .......  seems I put it on a Logical partition, so that may be the cause of it not booting.

The good news is that it did not interfere with the rest of the partitions or the device structure.

I will have another look tomorrow to see what I can make of it.

regards.

Offline Was_Just19

  • Hero Member
  • *****
  • Posts: 6852
  • MLU
Re: ISO to USB using Hybrid ISOs
« Reply #11 on: January 08, 2011, 07:50:43 PM »
_steve,

Quote
N.B.: Do not place extracted livecd.sqfs/isolinux folder in first partition sdX,1  else it will hijack other boot choices!  Renaming livecd.sqfs/isolinux may avoid this?  But I haven't tried it yet..

Any idea what might be going on there?

Offline Old-Polack

  • Administrator
  • Super Villain
  • *****
  • Posts: 11580
  • ----IOFLU----
Re: ISO to USB using Hybrid ISOs
« Reply #12 on: January 08, 2011, 08:18:48 PM »
_steve:

Not clear as to your intent in your last post. Are you saying this worked, or did not work, for the image on sdx2?

Yes it does work.. sdX2..   Gnome boots fine!
I select boot menu choice> pclinuxos-gnome-2010.12
The laptop gives a beep and then the LiveCD Startup Option menu for pclinuxos-gnome-2010.12 appears. etc..

My other comments relate to persistence. I still need to tidy up some details with regards to persistence.
No promises... We'll see..
>Steve

All things being equal as to command used to create hybrid, and dd command to copy to partition, with either;

title Phoenix hybrid
root (hd0,16)
chainloader +1

title Phoenix hybrid 2
root (hd0,16)
makeactive
chainloader +1

I get;

root (hd0,16)
      Filesystem type unknown, Partition type 0x83
     
Error 12: Invalid device requested
Press any key to continue.


Just19 may be right, that this method is limited to primary partitions only. I really can't see the need for making an item to be seen as an iso9660 CD-ROM active, as that's a Windows item, not used by grub except for Windows booting and with a rootnoverify (hdx,y) root entry.

Before burning the image with dd to /dev/sda17 I was booting a regular installation of OpenBox from that partition. I can still boot the regular liveOS items from /dev/sda16 using either the poor mans method, or the bootfromiso=<whatever> grub stanzas.

Old-Polack

Of what use be there for joy, if not for the sharing thereof?



Lest we forget...

smcs_steve

  • Guest
Re: ISO to USB using Hybrid ISOs
« Reply #13 on: January 08, 2011, 10:31:49 PM »
old-polack,
Same result here for extended partition.(fail)  However this may explain the significance of (1-4) in>

[user@localhost ~]$ isohybrid --help
Usage: /usr/bin/isohybrid [options] filename.iso
Options:
  -h          Number of default geometry heads
  -s          Number of default geometry sectors
  -entry      Specify partition entry number (1-4)
  -offset     Specify partition offset (default 0)
  -type       Specify partition type (default 0x17)
  -id         Specify MBR ID (default random)
  -forcehd0   Always assume we are loaded as disk ID 0
  -ctrlhd0    Assume disk ID 0 if the Ctrl key is pressed
  -partok     Allow booting from within a partition


_steve,
Quote
N.B.: Do not place extracted livecd.sqfs/isolinux folder in first partition sdX,1  else it will hijack other boot choices!  Renaming livecd.sqfs/isolinux may avoid this?  But I haven't tried it yet..
Any idea what might be going on there?
Just19,
Maybe if the -entry switch is not specified then all 4 primary partitions are scanned for required files?? Just guessing....
 -- This is purely an academic exercise, I'm not trying to reinvent the "LiveOS USB" wheel so to speak.

Being limited to only 4 partitions is not terribly helpful though...

Before burning the image with dd to /dev/sda17 I was booting a regular installation of OpenBox from that partition. I can still boot the regular liveOS items from /dev/sda16 using either the poor mans method, or the bootfromiso=<whatever>[/color] grub stanzas.
old-polack,
I might have missed something here..  Do you mean bootfromiso  in legacy GRUB or GRUB2?
>Steve
« Last Edit: January 08, 2011, 10:37:18 PM by _steve »

Offline Old-Polack

  • Administrator
  • Super Villain
  • *****
  • Posts: 11580
  • ----IOFLU----
Re: ISO to USB using Hybrid ISOs
« Reply #14 on: January 08, 2011, 10:56:50 PM »

I might have missed something here..  Do you mean bootfromiso  in legacy GRUB or GRUB2?
>Steve

Legacy grub from PCLinuxOS.
Old-Polack

Of what use be there for joy, if not for the sharing thereof?



Lest we forget...