bugGNU GRUB - Bugs: bug #32998, grub-mkrescue ISO images bootable...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #32998: grub-mkrescue ISO images bootable as disk (like isohybrid) but not mountable within Linux

Submitter:  Josh Triplett <joshtriplett>
Submitted:  Tue 05 Apr 2011 02:55:31 AM UTC
   
 
Category:  None Severity:  Minor
Priority:  3 - Low Item Group:  Feature Request
Status:  None Privacy:  Public
Assigned to:  None Originator Name: 
Open/Closed:  Open Release:  Bazaar - trunk
Release:  Reproducibility:  Every Time
Planned Release:  2.03+

Jump to the original submission

Fri 01 Mar 2013 02:38:52 PM UTC, comment #12: 


Patch to modify grub-mkrescue which makes the protective partition a mountable
one. This exposes the first 32k of the drive image as writable to applications
which obey the boundaries of the partition table.

diff -ruN grub-2.00.orig/util/grub-mkrescue.in grub-2.00/util/grub-mkrescue.in
--- grub-2.00.orig/util/grub-mkrescue.in        2012-06-14 12:25:07.000000000 -0500
+++ grub-2.00/util/grub-mkrescue.in        2013-03-01 08:08:56.891157131 -0600
@@ -368,7 +368,7 @@
 fi

 # build iso image
-"${xorriso}" -as mkisofs -graft-points ${grub_mkisofs_arguments} --protective-msdos-label -o "${output_image}" -r "${iso9660_dir}" --sort-weight 0 / --sort-weight 1 /boot ${source}
+"${xorriso}" -as mkisofs -graft-points ${grub_mkisofs_arguments} -partition_offset 16 -o "${output_image}" -r "${iso9660_dir}" --sort-weight 0 / --sort-weight 1 /boot ${source}
 rm -rf "${iso9660_dir}"

 rm -f "${embed_img}"


Mark Ferrell <mferrell>
Fri 01 Mar 2013 02:33:20 PM UTC, comment #11: 

+verbatime+
Patch to modify grub-mkrescue which makes the protective partition a mountable
one.  This exposes the first 32k of the drive image as writable to applications
which obey the boundaries of the partition table.


diff -ruN grub-2.00.orig/util/grub-mkrescue.in grub-2.00/util/grub-mkrescue.in
--- grub-2.00.orig/util/grub-mkrescue.in 2012-06-14 12:25:07.000000000 -0500
+++ grub-2.00/util/grub-mkrescue.in 2013-03-01 08:08:56.891157131 -0600
@@ -368,7 +368,7 @@
 fi
 
 # build iso image
-"${xorriso}" -as mkisofs -graft-points ${grub_mkisofs_arguments} --protective-msdos-label -o "${output_image}" -r "${iso9660_dir}" --sort-weight 0 / --sort-weight 1 /boot ${source}
+"${xorriso}" -as mkisofs -graft-points ${grub_mkisofs_arguments} -partition_offset 16 -o "${output_image}" -r "${iso9660_dir}" --sort-weight 0 / --sort-weight 1 /boot ${source}
 rm -rf "${iso9660_dir}"
 
 rm -f "${embed_img}"
-verbatim-

Mark Ferrell <mferrell>
Fri 01 Mar 2013 02:16:29 PM UTC, comment #10: 

Mounting the entire ISO image (/dev/sda) will result in the entire device being marked as busy, and so no other partitions will be accessible so long as the ISO is mounted.

Supplying the -partition_offset option to grub-mkrescue will result in an image which is mountable from its absolute start as well as from the partition start.


grub-mkrescue --output grub.iso -partition_offset 16


Mark Ferrell <mferrell>
Sat 16 Jun 2012 11:29:32 PM UTC, comment #9: 

We're not going to use isohybrid for a whole range of reasons. Instead we collaborate with xorriso and add needed features to it. Secondary FAT generation is on the table but not (rather not only) because of this problem. This is still a bug in automount programs as they mount FAT instead of iso9660+rockridge and so any POSIX attributes are lost.

Vladimir Serbinenko <phcoder>
Group administrator
Sat 16 Jun 2012 11:20:10 PM UTC, comment #8: 

Josh, I was about preparing a patch to present to Validimir but I ran into a problem.  When running isohybrid on the resulting .iso file I get this error:

  isohybrid: grub.iso: boot loader does not have an isolinux.bin
    hybrid signature. Note that isolinux-debug.bin does not
    support hybrid booting

I will therefore need your help to adjust the current call to xorriso ..

xorriso -as mkisofs -graft-points --modification-date=2012061623141700 -b boot/grub/i386-pc/eltorito.img -no-emul-boot -boot-info-table --embedded-boot /tmp/tmp.LZOltGbM1W --protective-msdos-label -o grub.iso -r /tmp/tmp.MndvNmay8t --sort-weight 0 / --sort-weight 1 /boot

.. to produce something that isohybrid can process or does not need to process anymore.

Sebastian Pipping <hartwork>
Sat 16 Jun 2012 09:35:41 PM UTC, comment #7: 

isohybrid creates a secondary FAT filesystem for this but it's more of a workaround for automount problem.

Vladimir Serbinenko <phcoder>
Group administrator
Sat 16 Jun 2012 09:29:26 PM UTC, comment #6: 


> Sounds like the bug of automounting. You should take this to automount guys rather than complaining here.


I would have done so, if not for isohybrid managing to create a similar disk image without causing the same problem.  That possibility suggests that grub-mkrescue could do the same.

Josh Triplett <joshtriplett>
Sat 16 Jun 2012 09:17:04 PM UTC, comment #5: 

Sounds like the bug of automounting. You should take this to automount guys rather than complaining here.

Vladimir Serbinenko <phcoder>
Group administrator
Sat 16 Jun 2012 08:37:34 PM UTC, comment #4: 

Not quite.  Mounting grub.iso as a whole works the same as mounting the disk rather than the partition.  Try putting the .iso you generated on a USB disk, inserting it, and seeing if automounting works.  Because the disk has a partition table, Linux will detect the partitions, and the automatic mounting mechanisms will attempt to mount the partition rather than the whole disk; attempting to mount the partition will fail.

isohybrid manages to make disks that handle this case, but grub-mkrescue does not.

Josh Triplett <joshtriplett>
Sat 16 Jun 2012 05:10:21 PM UTC, comment #3: 

Short version: I think this bug can be closed.


I just check with GRUB 2.00~beta6.  I am able to mount the resulting .iso file directly:


# grub2-mkrescue --output=grub.iso
Enabling BIOS support ...
xorriso 1.2.2 : RockRidge filesystem manipulator, libburnia project.

Drive current: -outdev 'stdio:grub.iso'
Media current: stdio file, overwriteable
Media status : is blank
Media summary: 0 sessions, 0 data blocks, 0 data, 55.0g free
Added to ISO image: directory '/'='/tmp/tmp.2o3txZpcPK'
xorriso : UPDATE : 224 files added in 1 seconds
xorriso : UPDATE : 224 files added in 1 seconds
xorriso : NOTE : Copying to System Area: 28105 bytes from file '/tmp/tmp.B7abx1jAmr'
xorriso : UPDATE :  100.00% done
ISO image produced: 1058 sectors
Written to medium : 1058 sectors at LBA 0
Writing to 'stdio:grub.iso' completed successfully.

# mkdir grub-iso-dir

# sudo mount grub.iso grub-iso-dir

# ls -al grub-iso-dir
total 10
dr-xr-xr-x  1 root  root  2048 Jun 16 19:01 .
drwxr-xr-x 16 sping sping 4096 Jun 16 19:01 ..
dr-xr-xr-x  1 root  root  2048 Jun 16 19:01 boot
-r--r--r--  1 root  root  2048 Jun 16 19:01 boot.catalog

Sebastian Pipping <hartwork>
Tue 05 Apr 2011 03:01:49 PM UTC, comment #2: 

I realize that mounting the whole disk rather than the partition would work.  However, because the disk has a partition table on it, Linux detects the partition, and then the automatic mounting tools try to mount the partition.  That works for isohybrid disks, but not for disks created by grub-mkrescue.  How does isohybrid make this work, and could grub-mkrescue do the same thing?

Josh Triplett <joshtriplett>
Tue 05 Apr 2011 06:55:29 AM UTC, comment #1: 

You have to mount sdX, not sdX1.
phcoder@debian.x201.phnet:~/compile$ grub-mkrescue --output=grub.iso
Enabling BIOS support ...
Enabling x86_64-efi support ...
Enabling i386-coreboot support ...
GNU xorriso 0.5.5 : RockRidge filesystem manipulator, libburnia project.

Drive current: -outdev 'stdio:grub.iso'
Media current: stdio file, overwriteable
Media status : is blank
Media summary: 0 sessions, 0 data blocks, 0 data, 3902m free
Added to ISO image: directory '/'='/tmp/tmp.VlHihFJ1Od'
xorriso : UPDATE : 509 files added in 1 seconds
xorriso : UPDATE : 509 files added in 1 seconds
xorriso : NOTE : Copying to System Area: 27773 bytes from file '/tmp/tmp.ks5fm3DHoe'
ISO image produced: 3855 sectors
Written to media  : 4032 sectors at LBA 32
Writing to 'stdio:grub.iso' completed sucessfully.

phcoder@debian.x201.phnet:~/compile$ sudo mount grub.iso /mnt/mpt1/ -o loop
Scan right index finger on UPEK Eikon 2
phcoder@debian.x201.phnet:~/compile$ ls /mnt/mpt1/
boot  efi.img
phcoder@debian.x201.phnet:~/compile$ ls /mnt/mpt1/boot/
coreboot.elf  grub
phcoder@debian.x201.phnet:~/compile$ ls /mnt/mpt1/boot/grub/
i386-coreboot  i386-pc  locale  x86_64-efi

Vladimir Serbinenko <phcoder>
Group administrator
Tue 05 Apr 2011 02:55:31 AM UTC, original submission:  

grub-mkrescue creates .iso images which include a magic hard disk partition table and boot sector at the beginning, making them work either as a bootable CD or as a bootable USB disk, like isohybrid disks. However, unlike isohybrid disks, the disk images built by grub-mkrescue will not mount on a normal Linux system.  dmesg says "ISOFS: Unable to identify CD-ROM format.".

Josh Triplett <joshtriplett>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by mferrell (Posted a comment)
  • -email is unavailable- added by hartwork (Posted a comment)
  • -email is unavailable- added by phcoder (Posted a comment)
  • -email is unavailable- added by joshtriplett
  • -email is unavailable- added by joshtriplett (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-03-02 phcoder Planned ReleaseNone 2.03+
    2012-06-03 phcoder Priority5 - Normal 3 - Low
        Item GroupNone Feature Request
    2012-02-01 phcoder SeverityMajor Minor
    2011-04-05 joshtriplett Carbon-Copy- Added -email is unavailable-

    Back to the top

    Powered by Savane 3.13-cf05.
    Corresponding source code