Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #195671

Re: Block sizes in ISOs. was: USB Install Fails, Complains about CD-ROM

From "Thomas Schmitt" <scdbackup@gmx.net>
Newsgroups linux.debian.user
Subject Re: Block sizes in ISOs. was: USB Install Fails, Complains about CD-ROM
Date 2018-05-13 11:30 +0200
Message-ID <vOVui-1cj-13@gated-at.bofh.it> (permalink)
References <vOUoy-Aw-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hi,

Pascal Hambourg wrote:
> I have never seen a hard disk or flash drive with a sector size of 2048
> (only 512 or 4096) so the kernel must be correct and the Apple partition
> table must be wrong.

Both are correct. The kernel reports what it perceives as hardware block
size ("physical"). The Apple Partition Map is free to use one of several
block sizes. (In case of a "mjg" isohybrid it is 2048 in order to give
room for the GPT header block at byte 512 to 1023. The first APM entry
then begins at byte 2048.)

It is the partition editor who is clueless. (One wonders how those editors
get to their hunchbacked representations from quite clear partition table
specs.)


> Can you please explain why the wrong block size does not matter ?

Block size matters in various aspects. But these aspects refer to own info
sources which do not necessarily tell the same number.
In a Debian x86 isohybrid we have the following block sizes:

- The MBR partition table assumes block size 512. To be used when converting
  Logical Block Address and block count to the byte offsets of partitions.

- The El Torito Sector Count assumes block size 512. To be used when loading
  the BIOS boot image into memory, or when accepting the EFI boot image as
  EFI System Partition.

- The El Torito Load RBA (start block of the boot image) assumes block size
  2048. To be used when loading or accepting the boot image.

- The Apple Partition Map announces block size 2048. To be used when
  converting block addresses and counts of the APM to byte offsets.

- The ISO 9660 filesystem announces a block size of 2048. To be used when
  converting block addresses and counts of the ISO metadata to byte offsets.

- Then we have the FAT filesystem in the EFI boot image. Probably it uses
  a block size of 512 bytes.

Each interpreter of those structures needs to get told the matching block
size or needs to assume it correctly without being told.


> The only storage media with a bloc size of 2048 I know about are optical
> media such as CD and DVD.

Readers of ISO 9660 should obey the block size given in the Primary Volume
Descriptor. But all i know (including mine) will only work with logical
block size 2048.

The block size used with filesystem or partition table is quite independent
of the block size which the device assumes for its Logical Block Addresses.
(I think Linux demands multiples of 512 by a power of two: 512, 1024, 2048,
4096, ...)
The kernel converts the logical block addressies of filesystem or partition
table to the logical block addresses of the storage device.

(Many storage devices expose a logical block size of 512 while really having
 larger storage chunks.)


> Could the Apple partition map in the image be used when booting from an
> optical disk on a Mac ?

Hardly. One can never be sure with firmware behavior, though.

Matthew J. Garrett ("mjg") introduced the APM into Fedora isohybrids in
order to mark a small HFS+ filesystem image file inside the ISO.
But Debian has no such HFS+ image, and thus does not serve that obscure
class of Apple machines which probably predate Apple's adoption of EFI.

In Fedora-Workstation-netinst-x86_64-23.iso one can see:

  MBR partition table:   N Status  Type        Start       Blocks
  MBR partition      :   1   0x80  0x00            0       845824
  MBR partition      :   2   0x00  0xef          180        10780
  MBR partition      :   3   0x00  0x00       684488        43168
  MBR partition path :   2  /images/efiboot.img
  MBR partition path :   3  /images/macboot.img
  ...
  APM                :   N  Info
  APM block size     :      2048
  APM gap fillers    :      0
  APM partition name :   1  EFI
  APM partition type :   1  Apple_HFS
  APM start and size :   1  45  2695
  APM partition path :   1  /images/efiboot.img
  APM partition name :   2  EFI
  APM partition type :   2  Apple_HFS
  APM start and size :   2  171122  10792
  APM partition path :   2  /images/macboot.img
  ...

Both partition tables mark the ISO files efiboot.img and macboot.img as
partitions. The addresses match when interpreted by appropriate block sizes:
  180 = 45 * 4
  684488 = 171122 * 4

When debian-cd adopted this layout, the HFS+ image was omitted, but the
option to mark the EFI image in Apple Partition Map staid with the xorriso
run. So we still see an APM in debian-cd amd64 and i386 ISOs.
E.g. in debian-9.4.0-amd64-xfce-CD-1.iso :

  APM                :   N  Info
  APM block size     :      2048
  APM gap fillers    :      0
  APM partition name :   1  EFI
  APM partition type :   1  Apple_HFS
  APM start and size :   1  1835  208
  APM partition path :   1  /boot/grub/efi.img


Matthew described his invention in
  http://mjg59.dreamwidth.org/11285.html


Have a nice day :)

Thomas

Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

USB Install Fails, Complains about CD-ROM Kent West <westk@acu.edu> - 2018-05-11 18:20 +0200
  Re: USB Install Fails, Complains about CD-ROM Robert Menes <viewtiful.icchan@gmail.com> - 2018-05-11 18:40 +0200
    Re: USB Install Fails, Complains about CD-ROM Rick Thomas <rbthomas@pobox.com> - 2018-05-12 01:10 +0200
      Re: USB Install Fails, Complains about CD-ROM Kenneth Parker <sea7kenp@gmail.com> - 2018-05-12 03:40 +0200
      Re: USB Install Fails, Complains about CD-ROM Pascal Hambourg <pascal@plouf.fr.eu.org> - 2018-05-12 19:40 +0200
  Re: USB Install Fails, Complains about CD-ROM "Thomas Schmitt" <scdbackup@gmx.net> - 2018-05-11 18:40 +0200
  Re: USB Install Fails, Complains about CD-ROM Curt <curty@free.fr> - 2018-05-11 19:10 +0200
    Re: USB Install Fails, Complains about CD-ROM Kent West <westk@acu.edu> - 2018-05-11 20:40 +0200
  Re: USB Install Fails, Complains about CD-ROM songbird <songbird@anthive.com> - 2018-05-11 19:50 +0200
    Re: USB Install Fails, Complains about CD-ROM Kent West <westk@acu.edu> - 2018-05-11 20:40 +0200
      Re: USB Install Fails, Complains about CD-ROM Kent West <westk@acu.edu> - 2018-05-11 21:30 +0200
      Re: USB Install Fails, Complains about CD-ROM Pascal Hambourg <pascal@plouf.fr.eu.org> - 2018-05-11 22:00 +0200
        Re: USB Install Fails, Complains about CD-ROM Kent West <westk@acu.edu> - 2018-05-11 22:20 +0200
          Re: USB Install Fails, Complains about CD-ROM "Thomas Schmitt" <scdbackup@gmx.net> - 2018-05-11 22:40 +0200
            Re: USB Install Fails, Complains about CD-ROM Kent West <westk@acu.edu> - 2018-05-11 23:00 +0200
              Re: USB Install Fails, Complains about CD-ROM "Thomas Schmitt" <scdbackup@gmx.net> - 2018-05-12 00:00 +0200
              Re: USB Install Fails, Complains about CD-ROM Brian <ad44@cityscape.co.uk> - 2018-05-12 12:30 +0200
            Re: USB Install Fails, Complains about CD-ROM Pascal Hambourg <pascal@plouf.fr.eu.org> - 2018-05-12 19:50 +0200
              Re: USB Install Fails, Complains about CD-ROM "Thomas Schmitt" <scdbackup@gmx.net> - 2018-05-12 21:40 +0200
                Re: USB Install Fails, Complains about CD-ROM Pascal Hambourg <pascal@plouf.fr.eu.org> - 2018-05-13 10:20 +0200
                Re: Block sizes in ISOs. was: USB Install Fails, Complains about CD-ROM "Thomas Schmitt" <scdbackup@gmx.net> - 2018-05-13 11:30 +0200
          UEFI/"BIOS" booting, was Re: USB Install Fails, Complains about  CD-ROM David Wright <deblis@lionunicorn.co.uk> - 2018-05-13 17:20 +0200
            Re: UEFI/"BIOS" booting, was Re: USB Install Fails, Complains about  CD-ROM Pascal Hambourg <pascal@plouf.fr.eu.org> - 2018-05-13 19:10 +0200
              Re: UEFI/"BIOS" booting, was Re: USB Install Fails, Complains about  CD-ROM David Wright <deblis@lionunicorn.co.uk> - 2018-05-14 02:10 +0200
                Re: UEFI/"BIOS" booting, was Re: USB Install Fails, Complains about  CD-ROM Pascal Hambourg <pascal@plouf.fr.eu.org> - 2018-05-14 23:40 +0200
                Re: UEFI/"BIOS" booting, was Re: USB Install Fails, Complains about  CD-ROM David Wright <deblis@lionunicorn.co.uk> - 2018-05-15 04:00 +0200
              Re: UEFI/"BIOS" booting, was Re: USB Install Fails, Complains about  CD-ROM songbird <songbird@anthive.com> - 2018-05-14 12:40 +0200
                Re: UEFI/"BIOS" booting, was Re: USB Install Fails, Complains about  CD-ROM Chris Ramsden <chris.ramsden@gmail.com> - 2018-05-14 14:40 +0200
                Re: UEFI/"BIOS" booting, was Re: USB Install Fails, Complains about  CD-ROM David Wright <deblis@lionunicorn.co.uk> - 2018-05-14 16:00 +0200
                Re: UEFI/"BIOS" booting, was Re: USB Install Fails, Complains about  CD-ROM Chris Ramsden <chris.ramsden@gmail.com> - 2018-05-14 17:00 +0200
                Re: UEFI/"BIOS" booting, was Re: USB Install Fails, Complains about  CD-ROM songbird <songbird@anthive.com> - 2018-05-15 02:50 +0200
            Re: UEFI/"BIOS" booting, was Re: USB Install Fails, Complains about CD-ROM Stefan Monnier <monnier@iro.umontreal.ca> - 2018-05-14 15:20 +0200
              Re: UEFI/"BIOS" booting, was Re: USB Install Fails, Complains about  CD-ROM David Wright <deblis@lionunicorn.co.uk> - 2018-05-14 16:40 +0200
                Re: UEFI/"BIOS" booting "Thomas Schmitt" <scdbackup@gmx.net> - 2018-05-14 18:00 +0200
                Re: UEFI/"BIOS" booting Pascal Hambourg <pascal@plouf.fr.eu.org> - 2018-05-14 23:50 +0200
                Re: UEFI/"BIOS" booting "Thomas Schmitt" <scdbackup@gmx.net> - 2018-05-15 09:00 +0200
                Re: UEFI/"BIOS" booting Pascal Hambourg <pascal@plouf.fr.eu.org> - 2018-05-16 00:20 +0200
                Re: UEFI/"BIOS" booting Pascal Hambourg <pascal@plouf.fr.eu.org> - 2018-05-16 23:50 +0200
                Re: UEFI/"BIOS" booting "Thomas Schmitt" <scdbackup@gmx.net> - 2018-05-17 13:00 +0200
                Re: UEFI/"BIOS" booting, was Re: USB Install Fails, Complains about CD-ROM Stefan Monnier <monnier@iro.umontreal.ca> - 2018-05-14 18:00 +0200
                Re: UEFI/"BIOS" booting, was Re: USB Install Fails, Complains about  CD-ROM David Wright <deblis@lionunicorn.co.uk> - 2018-05-15 03:30 +0200
                Re: UEFI/"BIOS" booting, was Re: USB Install Fails, Complains about  CD-ROM Pascal Hambourg <pascal@plouf.fr.eu.org> - 2018-05-16 00:40 +0200
                Re: UEFI/"BIOS" booting, was Re: USB Install Fails, Complains about  CD-ROM David Wright <deblis@lionunicorn.co.uk> - 2018-05-18 20:40 +0200
                Re: UEFI/"BIOS" booting Pascal Hambourg <pascal@plouf.fr.eu.org> - 2018-05-14 23:50 +0200
                Re: UEFI/"BIOS" booting David Wright <deblis@lionunicorn.co.uk> - 2018-05-15 03:40 +0200
                Re: UEFI/"BIOS" booting Pascal Hambourg <pascal@plouf.fr.eu.org> - 2018-05-16 00:40 +0200
                Re: UEFI/"BIOS" booting mess-mate <eric.m.c.declerck@gmail.com> - 2018-05-16 15:20 +0200
                Re: UEFI/"BIOS" booting David Wright <deblis@lionunicorn.co.uk> - 2018-05-18 20:50 +0200
  Re: USB Install Fails, Complains about CD-ROM Mike Kupfer <mkupfer@alum.berkeley.edu> - 2018-05-13 04:20 +0200
    Re: USB Install Fails, Complains about CD-ROM Curt <curty@free.fr> - 2018-05-13 10:30 +0200
      Re: USB Install Fails, Complains about CD-ROM "Thomas Schmitt" <scdbackup@gmx.net> - 2018-05-13 12:10 +0200
        Re: USB Install Fails, Complains about CD-ROM Curt <curty@free.fr> - 2018-05-13 14:10 +0200
          Re: USB Install Fails, Complains about CD-ROM "Thomas Schmitt" <scdbackup@gmx.net> - 2018-05-13 14:50 +0200
        Re: USB Install Fails, Complains about CD-ROM Mike Kupfer <mkupfer@alum.berkeley.edu> - 2018-05-13 19:00 +0200
          Re: USB Install Fails, Complains about CD-ROM "Thomas Schmitt" <scdbackup@gmx.net> - 2018-05-13 20:20 +0200
            Re: USB Install Fails, Complains about CD-ROM Mike Kupfer <mkupfer@alum.berkeley.edu> - 2018-05-14 00:40 +0200
              Re: USB Install Fails, Complains about CD-ROM "Thomas Schmitt" <scdbackup@gmx.net> - 2018-05-14 13:30 +0200
                Re: USB Install Fails, Complains about CD-ROM Mike Kupfer <mkupfer@alum.berkeley.edu> - 2018-05-14 16:50 +0200
                Re: USB Install Fails, Complains about CD-ROM "Thomas Schmitt" <scdbackup@gmx.net> - 2018-05-14 18:20 +0200
                Re: USB Install Fails, Complains about CD-ROM David Wright <deblis@lionunicorn.co.uk> - 2018-05-14 20:10 +0200
                Re: USB Install Fails, Complains about CD-ROM "Thomas Schmitt" <scdbackup@gmx.net> - 2018-05-14 22:10 +0200
                Re: USB Install Fails, Complains about CD-ROM Mike Kupfer <mkupfer@alum.berkeley.edu> - 2018-05-14 23:00 +0200
                Re: USB Install Fails, Complains about CD-ROM Mike Kupfer <mkupfer@alum.berkeley.edu> - 2018-05-15 01:20 +0200
                Re: USB Install Fails, Complains about CD-ROM "Thomas Schmitt" <scdbackup@gmx.net> - 2018-05-15 09:10 +0200
                Re: USB Install Fails, Complains about CD-ROM Mike Kupfer <mkupfer@alum.berkeley.edu> - 2018-05-17 23:40 +0200
                Re: USB Install Fails, Complains about CD-ROM "Thomas Schmitt" <scdbackup@gmx.net> - 2018-05-18 08:50 +0200
                Re: USB Install Fails, Complains about CD-ROM Mike Kupfer <mkupfer@alum.berkeley.edu> - 2018-05-15 01:10 +0200

csiph-web