1 (edited by cmdr 2009-07-21 21:46:31)

Topic: [SOLVED !] Suggestions for ISO-Hybrid Format

Hello,
this is neither a feature request nor a bug report, so I place my thoughts here.

Problems with ISO-Hybrid Image on USB Stick

The new "GParted Live" ISO-Hybrid image makes it very easy to create a bootable USB-Stick.
I appreciate that ! But you give away much space on actual big USB sticks. Since the ISO-Hybrid format has a "msdos"-like partition table at sector 0, I tried to create a second primary partition.
"GParted", however, showed nothing but unallocated space. "fdisk" and "parted" do not show the real status. This fact had also influence on my "MC_HxEd", which uses "fdisk". I had to correct the script code to keep it working. Since I use Hitachi's "cfadisk.sys" driver with Windows, which enables to partition USB sticks and fully use them, Windows drive management had NO(!) problems to create a 2nd primary partition, and "Explorer" showed it. The first partition, however, remains unvisible because of its (0x83=Linux) filesystem - an expected behaviour. To get less fault messages with "fdisk" and adapt ISO-hybrided USB-Sticks closer to Windows, I suggest the following issues to be corrected :

1. CHS-Values in partition table of first (ISO) partition:

New End value for ISO-Hybrid
Heads Sectors Cylinders
0xFE    0x3F     0x0C

Explanation :
Windows uses Heads=0xFE, Sectors/Track=0x3F for a new 2nd primary partition, regardless
whether the first partition (ISO-Hybrid) uses other values. "fdisk" stops complaining about
different logical/physical endings with these new values, but still shows irregular
partitioning and criticises cylinder alignment. "parted" recognizes an "msdos" partition table,
but doesn't show 1st partition and complains about recursive partitioning. "GParted" shows
"unallocated space", because "disk label" is unknown. If USB stick boots with "toram" or "todisk" option or is attached to an otherwise running "GParted Live", it's possible to mount successfully both the iso-image and further partitions. Without "toram", whole stick (all partitions) is blocked for mounting.

Maybe it's possible to introduce "isohybrid" disk label to "GParted", not for creation of
course, but for detection, to get partitioning visible and to enable creation of further
partitions on big USB sticks ?

2. ISO-Hybrid size
End sector should consequently be 0x032FCC (= size 0x032FCD = 208845 sectors => 102 MiB )

Explanation :
This value aligns partition startpoint of 2nd partition to a cylinder boundary for the above
new CHS geometry. "fdisk" is very content with this value ... and there is some free space left for next "GParted" ISO version.

Original sector 0 with two primary partitions: sda_old.png

Original Fdisk output:

Disk /dev/sda: 512 MB, 512999424 bytes
255 heads, 63 sectors/track, 62 cylinders, total 1001952 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0xbbb58206

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           0      200703      100352   83  Linux
Partition 1 has different physical/logical endings:
     phys=(97, 63, 32) logical=(12, 125, 49)
Partition 1 does not end on cylinder boundary.
/dev/sda2          200704      996029      397663    6  FAT16

Disk /dev/sda1: 102 MB, 102760448 bytes
255 heads, 63 sectors/track, 12 cylinders, total 200704 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0xbbb58206

     Device Boot      Start         End      Blocks   Id  System
/dev/sda1p1   *           0      200703      100352   83  Linux
Partition 1 has different physical/logical endings:
     phys=(97, 63, 32) logical=(12, 125, 49)
Partition 1 does not end on cylinder boundary.
/dev/sda1p2          200704      996029      397663    6  FAT16

Original Parted output:

Error: Invalid partition table - recursive partition on /dev/sda.
Ignore/Cancel? i

Model: LEXAR GEYSER JUMPDRIVE (scsi)
Disk /dev/sda: 513MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start  End    Size   Type     File system  Flags
 2      103MB  510MB  407MB  primary  fat16             

Sector 0 with changes : sdb_new.png

Fdisk after changes :

Disk /dev/sdb: 512 MB, 512999424 bytes
255 heads, 63 sectors/track, 62 cylinders, total 1001952 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0xbbb58206

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *           0      208844      104422+  83  Linux
/dev/sdb2          208845      996029      393592+   6  FAT16

Disk /dev/sdb1: 106 MB, 106928640 bytes
255 heads, 63 sectors/track, 13 cylinders, total 208845 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0xbbb58206

     Device Boot      Start         End      Blocks   Id  System
/dev/sdb1p1   *           0      208844      104422+  83  Linux
/dev/sdb1p2          208845      996029      393592+   6  FAT16

New "MC_HxEd" is ready for download here. See also this post

Regards
cmdr

2

Re: [SOLVED !] Suggestions for ISO-Hybrid Format

cmdr wrote:

Maybe it's possible to introduce "isohybrid" disk label to "GParted", not for creation of
course, but for detection, to get partitioning visible and to enable creation of further
partitions on big USB sticks ?

Is the "isohybrid" disk label defined somewhere as a standard?

At the moment, the GParted application relies entirely on libparted to determine and work with disk labels (also known as partition tables).

If there is a problem recognizing a valid disk label and partition layout, then it would be beneficial to more people if the problem is corrected within parted.  That way parted, and all applications that rely on libparted would benefit from the correction.

Does that make sense, or did I misunderstand the meaning of this request?

3 (edited by cmdr 2009-07-21 23:31:27)

Re: [SOLVED !] Suggestions for ISO-Hybrid Format

Eureka! I found a straight-forward solution !

http://www.mediafire.com/imgbnc.php/ea77298af61c31bc443e0647ecd577e45g.jpg

The key to success was to examine, how "syslinux" creates an "isohybrid" image. It's a "post-processing" perl-script, which converts an ordinary ISO file to this special format.  I found this script - "isohybrid" - in the latest "syslinux-3.82.zip" ( folder "utils"). I had a close look at it, played around with it, made some minor code changes ... and it worked exactly the way, I wanted !

How come ?

You remember, that "parted" complained about "recursive partitioning" (= start sector in partition table points back to itself / sector 0 ). "Isolinux" boot code in MBR (sector 0), which preceeds partition table, doesn't care about partition table at all, so I decided to change the start sector value of 1st primary partition manually from "0" to "1" with the intention to satisfy "parted" ("fdisk" possibly too) ... and it worked !!! Of course, I also had to adapt my 2nd partition values.
Then I looked at "isohybrid" script and found, that it already is able to do all necessary calculations for me. It's a commandline tool, but you can store default values in its code, which I did. I further corrected one issue (which I regard as a bug), tested it ... and see the result above.

"parted" is content ...

Model: LEXAR GEYSER JUMPDRIVE (scsi)
Disk /dev/sdb: 513MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start  End    Size   Type     File system  Flags
 1      512B   107MB  107MB  primary               boot 
 2      107MB  510MB  403MB  primary  fat16             

... and "fdisk", too.

Disk /dev/sdb: 512 MB, 512999424 bytes
255 heads, 63 sectors/track, 62 cylinders, total 1001952 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0xbbb58206

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *           1      208844      104422   83  Linux
/dev/sdb2          208845      996029      393592+   6  FAT16

Ouups ! I almost forgot something. Here you get my special "isohybrid_gparted"
( syntax : < path >/isohybrid_gparted  < path >/gparted-live-0.4.5-3.iso )

Regards
cmdr

4

Re: [SOLVED !] Suggestions for ISO-Hybrid Format

Glad to hear that you found a good solution cool

5

Re: [SOLVED !] Suggestions for ISO-Hybrid Format

Thanks for pointing me out to what I was looking for, but I think it could be resolve by playing with the isohybrid options?

arch@nihe-lp ~/Desktop/iso $ 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

arch@nihe-lp ~/Desktop/iso $ isohybrid -type 0x83 -offset 1 -h 255 -s 63 filename.iso

Regards,


Nicolas.

6

Re: [SOLVED !] Suggestions for ISO-Hybrid Format

And for your FAT partition to be readable by windows, it has to be on the first partition, so you should first write to the second entry number with isohybrid ( -entry 2) and then create a FAT partition on sda1 with gparted.

Regards,


Nicolas.