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


Groups > comp.sys.mac.system > #119599

Re: APFS on HDD

Subject Re: APFS on HDD
Newsgroups comp.sys.mac.system
References (19 earlier) <BTlID.572643$sO2.508519@fx41.iad> <slrnpv46p1.2did.g.kreme@Snow.local> <1nyiqcn.1rpsrwgn7nqxdN%dempson@actrix.gen.nz> <L8qID.493597$um3.185246@fx32.iad> <1nyiu5v.1byex6aaoj7cdN%dempson@actrix.gen.nz>
From JF Mezei <jfmezei.spamnot@vaxination.ca>
Message-ID <C7MID.598255$OM2.367723@fx37.iad> (permalink)
Date 2018-11-19 23:32 -0500

Show all headers | View raw


On 2018-11-19 19:23, David Empson wrote:

> EFI on the Mac also understands a particular set of supported file
> systems inside GPT partitions.

Yet, EFI on Macs looks at specific fields inside block 0 of a GPT
partition to obtain the location and size of the data to load from disk
and branch to. And it is this file-system-blind tecnique which allows
older Macs to boot an APFS volume without knwing about APFS.


> Apple doesn't use that method to boot HFS+ volumes, and I don't think it
> is used for APFS either.

The EFI partition is necessary for other operating systems which use a
file system unknwon to EFI so EFI needs to boot an EFI program which
understands how to boot that operating system.

Apple chose to bypass that and augment its EFI firmware to add the logic
of lookijg at block 0 of a GPT partition to find location/size of the
boot file.


Macs can boot "EFI native" (load the code from the EFI partition and let
that code then choose/load the operating system boot file) but it
requires some persuasion to get it to do that.


> What is a "system GPT partition"? I'll assume you mean any GPT partition
> which contains a bootable system.

When EFI gets to the boot phase, it uses the boot volume (sourced from
nvram) and considers that GPT partition to be the system disk.  It loads
blocks from that disk and branches to that code. That code which is no
longer EFI then has more knowledged about the file system environment.

There is no need for EFI firmware to understand HFS or APFS. The specs
only call it to understand FAT32 (or some variant) to access files by
name in the EFI partition.



> HFS+ has a startup file referenced from its volume header. The volume
> header begins 1024 bytes after the start of the partition (assuming no
> HFS wrapper). The startup file is identified by its file ID number.
> Locating it requires searching the HFS+ catalog tree for that file ID
> number. The extents of the startup file can then be read from the
> catalog file, and used to load the startup file into memory, from where
> it is executed.

You may recall when APFS was first announce, my asking how EFO woudl
hadle that. I eventually found either in the Apple WWDC presentation or
other documents that EFI did not understand HFS file system, only read
block 0 and that APFS would maintain this compatibility.

Obviously, what is contained in the initial code read from disk by EFI
is very different when booting from a GPT partition that contains APFS
container/volumes. But EFI itself need not be different.

Looking at current behaviour, I suspect this data in block 0 points to
data in the Preboot partition instead of blocks where the traditional
/points to blocks that contain a file in the "Preboot" APFS volume.


Had Apple wanted EFI to parse through the file system to get to the boot
file, it would have used the EFI partition mechanism to gain
understanding of the HFS and now APFS file system.

Instead, it appears that the Preboot partition plays that role and is
contained inside the APFS container which Apple has better control over
during installations.

So while in the past, block 0 pointed to blocks that contained the file
/System/Library/CoreServices/boot.efi in the operating system volume, I
suspect it now point to blocks that contain data from a boot file in the
preboot partition and that code may contain the code that can list the
APFS volumes, ask for decryption password etc and eventually find and
load the /System/Library/CoreServices/boot.efi in the desired operating
system volume. But that is way beyond what the EFI firmware does.





> APFS has a container superblock, a copy of which is at the start of the
> partition (logical block 0, no matter what size your sectors might be).
> That superblock includes fields listing the extents of the EFI jumpstart
> driver, so reading the EFI jumpstart driver only requires reading and
> verifying the superblock then reading the extents of the driver, not
> understanding anything about APFS volumes or anything inside them.

But you just said that I was wrong claiming that.



> Booting from either HFS+ or APFS requires direct support in the EFI
> firmware to recognise the GPT GUIDs indicating an HFS+ or APFS
> partition, then code which is different for each file system to read far
> enough to load the driver for the next boot stage.

No. It would need support to verify that block 0 looks like, smells like
and talks like an HFS block 0 with certain fields in certain locations
of that block and if valid, load X blocks starting at block Y and branch
to that code once loaded.

What is loaded from disk has much greater uderstanding of the file
system, ability to parse some of the plist and raw data stored in the
nvram parameters etc. But that is no longer EFI running. (although EFI
services such as listing of devices, system config remain available).

> APFS support only exists in models new enough to boot High Sierra, and
> was probably added via a firmware update for models between late 2009
> and somewhere in the ballpark of 2016-2017.

Apple's prresentatioN/document stated that EFI would continue to run as
before, load x blocks starting at block Y, where x and Y are taken from
block 0 at specific locations.


> If your claim was right, my 2009 Mac Mini should attempt to boot from an
> APFS volume but the kernel would reject the model because it is too old.
> It can't even get that far. There is no way to even choose an APFS
> volume to boot from, because the firmware doesn't recognise the
> partition type or that it contains an EFI boot driver.

EFI on Macs has no ability to let you choose the boot volume. It
automatically boots into a volume stored in nvram or acts based on what
keys were pressed.  The only way to choose a startup volume is from
system prefernecs in a fully booted system (and older versions woudln't
know about APFS so wouldn't let you choose that as startup volume).

If you could manage to set the boot volume in nvram (or perhaps clear
NVRAM to force EFI to "guess" a new boot volume, it might work. You'd
have to make sure to press the right key to invoke the menu that
presents possible boot menus and that menu should come from the new APFS
volume and let you select the OS APFS volume. (after which you would
have kernel complaints about model number being incompatible).



> It doesn't need to. EFI boots via the EFI jumpstart driver, which can
> then reference other files in the Preview volume.

"EI jusmpstart driver" is not a driver, it is code that EFI transfers
controls to. EFI doesn't know what that code will do, nor does it care.
However, it appears Apple uses that terminology. it is wrong.

And EFI driver would be called by the EFI firmware. It is the opposite
thyat happens as the boot file runs and then calls EFI subroutines (such
as getting list of devices which EFI has obtained on power up).




And since you p]oint me to "EFI Jumpstart" section on the APFS
reference, I will quote the first paragraph of that section:

"You can locate the EFI driver by reading a few data structures,
starting at a known physical address on disk. *****You donʼt need any
support for reading or mounting Apple File System to locate the EFI
driver.********"  (emphasis mine)

What Apple calles "EFI jumpstart" is actually the boot file. It is the
datra which EFI loads in RAM and then transfers control to, expecting
that code to do what it has to do to boot the system. When such a file
doesn't actually boot an OS, it is often called an EFI programme as it
remains in basic consolme mode. (for instance, to get console mode on a
Mac, you would install an EFI program in the EFI partition and then coax
the Mac to boot from it. - On others sytsems, the EFI console is part of
firmware).


Back to comp.sys.mac.system | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Re: APFS on HDD rs99tl@gmail.com - 2018-11-09 17:32 -0800
  Re: APFS on HDD Your Name <YourName@YourISP.com> - 2018-11-10 14:42 +1300
    Re: APFS on HDD RSORLANDO <rs99tl@gmail.com> - 2018-11-09 18:15 -0800
    Re: APFS on HDD Elden <usenet@moondog.org> - 2018-11-09 21:27 -0800
      Re: APFS on HDD dempson@actrix.gen.nz (David Empson) - 2018-11-10 18:52 +1300
        Re: APFS on HDD J Burns <burns@nospam.com> - 2018-11-10 09:11 -0500
          Re: APFS on HDD Your Name <YourName@YourISP.com> - 2018-11-11 10:08 +1300
            Re: APFS on HDD J Burns <burns@nospam.com> - 2018-11-10 17:41 -0500
              Re: APFS on HDD nospam <nospam@nospam.invalid> - 2018-11-10 19:18 -0500
              Re: APFS on HDD Your Name <YourName@YourISP.com> - 2018-11-11 18:03 +1300
                Re: APFS on HDD J Burns <burns@nospam.com> - 2018-11-11 13:21 -0500
                Re: APFS on HDD Lewis <g.kreme@gmail.com.dontsendmecopies> - 2018-11-12 03:09 +0000
                Re: APFS on HDD J Burns <burns@nospam.com> - 2018-11-12 02:10 -0500
                Re: APFS on HDD Lewis <g.kreme@gmail.com.dontsendmecopies> - 2018-11-12 12:32 +0000
                Re: APFS on HDD Your Name <YourName@YourISP.com> - 2018-11-13 08:14 +1300
                Re: APFS on HDD J Burns <burns@nospam.com> - 2018-11-12 20:29 -0500
                Re: APFS on HDD Your Name <YourName@YourISP.com> - 2018-11-13 18:15 +1300
                Re: APFS on HDD J Burns <burns@nospam.com> - 2018-11-13 09:20 -0500
                Re: APFS on HDD JF Mezei <jfmezei.spamnot@vaxination.ca> - 2018-11-12 02:30 -0500
                Re: APFS on HDD Lewis <g.kreme@gmail.com.dontsendmecopies> - 2018-11-12 12:45 +0000
                Re: APFS on HDD JF Mezei <jfmezei.spamnot@vaxination.ca> - 2018-11-12 18:31 -0500
                Re: APFS on HDD Lewis <g.kreme@gmail.com.dontsendmecopies> - 2018-11-13 00:04 +0000
                Re: APFS on HDD Your Name <YourName@YourISP.com> - 2018-11-13 13:46 +1300
          Re: APFS on HDD dempson@actrix.gen.nz (David Empson) - 2018-11-11 15:55 +1300
            Re: APFS on HDD J Burns <burns@nospam.com> - 2018-11-10 23:38 -0500
            Re: APFS on HDD Lewis <g.kreme@gmail.com.dontsendmecopies> - 2018-11-11 07:18 +0000
              Re: APFS on HDD J Burns <burns@nospam.com> - 2018-11-11 12:39 -0500
                Re: APFS on HDD Your Name <YourName@YourISP.com> - 2018-11-12 09:10 +1300
                Re: APFS on HDD J Burns <burns@nospam.com> - 2018-11-11 19:26 -0500
                Re: APFS on HDD Your Name <YourName@YourISP.com> - 2018-11-12 16:20 +1300
                Re: APFS on HDD J Burns <burns@nospam.com> - 2018-11-12 01:46 -0500
            Re: APFS on HDD dempson@actrix.gen.nz (David Empson) - 2018-11-14 02:05 +1300
        Re: APFS on HDD Lewis <g.kreme@gmail.com.dontsendmecopies> - 2018-11-11 07:13 +0000
          Re: APFS on HDD JF Mezei <jfmezei.spamnot@vaxination.ca> - 2018-11-12 02:10 -0500
        Re: APFS on HDD JF Mezei <jfmezei.spamnot@vaxination.ca> - 2018-11-12 02:02 -0500
          Re: APFS on HDD dempson@actrix.gen.nz (David Empson) - 2018-11-12 21:57 +1300
            Re: APFS on HDD JF Mezei <jfmezei.spamnot@vaxination.ca> - 2018-11-12 18:26 -0500
              Re: APFS on HDD Jolly Roger <jollyroger@pobox.com> - 2018-11-13 01:12 +0000
                Re: APFS on HDD JF Mezei <jfmezei.spamnot@vaxination.ca> - 2018-11-12 23:44 -0500
                Re: APFS on HDD Jolly Roger <jollyroger@pobox.com> - 2018-11-13 18:17 +0000
              Re: APFS on HDD dempson@actrix.gen.nz (David Empson) - 2018-11-13 19:38 +1300
                Re: APFS on HDD Lewis <g.kreme@gmail.com.dontsendmecopies> - 2018-11-13 10:21 +0000
                Re: APFS on HDD JF Mezei <jfmezei.spamnot@vaxination.ca> - 2018-11-13 05:55 -0500
                Re: APFS on HDD dempson@actrix.gen.nz (David Empson) - 2018-11-14 01:28 +1300
                Re: APFS on HDD Lewis <g.kreme@gmail.com.dontsendmecopies> - 2018-11-13 13:40 +0000
                Re: APFS on HDD Jolly Roger <jollyroger@pobox.com> - 2018-11-13 18:18 +0000
                Re: APFS on HDD JF Mezei <jfmezei.spamnot@vaxination.ca> - 2018-11-13 05:57 -0500
                Re: APFS on HDD dempson@actrix.gen.nz (David Empson) - 2018-11-14 01:28 +1300
                Re: APFS on HDD JF Mezei <jfmezei.spamnot@vaxination.ca> - 2018-11-13 13:27 -0500
                Re: APFS on HDD dempson@actrix.gen.nz (David Empson) - 2018-11-14 13:31 +1300
                Re: APFS on HDD JF Mezei <jfmezei.spamnot@vaxination.ca> - 2018-11-14 15:33 -0500
                Re: APFS on HDD dempson@actrix.gen.nz (David Empson) - 2018-11-15 12:04 +1300
                Re: APFS on HDD JF Mezei <jfmezei.spamnot@vaxination.ca> - 2018-11-15 00:35 -0500
                Re: APFS on HDD dempson@actrix.gen.nz (David Empson) - 2018-11-15 22:24 +1300
                Re: APFS on HDD JF Mezei <jfmezei.spamnot@vaxination.ca> - 2018-11-15 12:39 -0500
                Re: APFS on HDD Stephen Hoffman <seaohveh@hoffmanlabs.invalid> - 2018-11-16 13:45 -0500
                Re: APFS on HDD JF Mezei <jfmezei.spamnot@vaxination.ca> - 2018-11-16 20:13 -0500
                Re: APFS on HDD dempson@actrix.gen.nz (David Empson) - 2018-11-18 18:37 +1300
                Re: APFS on HDD JF Mezei <jfmezei.spamnot@vaxination.ca> - 2018-11-18 17:40 -0500
                Re: APFS on HDD dempson@actrix.gen.nz (David Empson) - 2018-11-19 13:42 +1300
                Re: APFS on HDD Lewis <g.kreme@gmail.com.dontsendmecopies> - 2018-11-19 02:08 +0000
                Re: APFS on HDD dempson@actrix.gen.nz (David Empson) - 2018-11-19 15:52 +1300
                Re: APFS on HDD JF Mezei <jfmezei.spamnot@vaxination.ca> - 2018-11-18 22:31 -0500
                Re: APFS on HDD dempson@actrix.gen.nz (David Empson) - 2018-11-20 13:23 +1300
                Re: APFS on HDD JF Mezei <jfmezei.spamnot@vaxination.ca> - 2018-11-19 23:32 -0500
                Re: APFS on HDD dempson@actrix.gen.nz (David Empson) - 2018-11-20 22:05 +1300
                Re: APFS on HDD "David B." <"David B"@nomail.afraid.org> - 2018-11-20 09:36 +0000
                Re: APFS on HDD André G. Isaak <agisaak@gm.invalid> - 2018-11-20 06:12 -0700
                Re: APFS on HDD "David B." <"David B"@nomail.afraid.org> - 2018-11-20 14:28 +0000
                Re: APFS on HDD nospam <nospam@nospam.invalid> - 2018-11-20 09:36 -0500
                Re: APFS on HDD nospam <nospam@nospam.invalid> - 2018-11-20 08:57 -0500
                Re: APFS on HDD "David B." <"David B"@nomail.afraid.org> - 2018-11-20 14:34 +0000
                Re: APFS on HDD nospam <nospam@nospam.invalid> - 2018-11-20 09:36 -0500
                Re: APFS on HDD Lewis <g.kreme@gmail.com.dontsendmecopies> - 2018-11-19 05:46 +0000
                Re: APFS on HDD JF Mezei <jfmezei.spamnot@vaxination.ca> - 2018-11-19 02:27 -0500
                Re: APFS on HDD Stephen Hoffman <seaohveh@hoffmanlabs.invalid> - 2018-11-19 11:42 -0500
                Re: APFS on HDD dempson@actrix.gen.nz (David Empson) - 2018-11-20 13:23 +1300
                Re: APFS on HDD JF Mezei <jfmezei.spamnot@vaxination.ca> - 2018-11-19 21:57 -0500
                Re: APFS on HDD dempson@actrix.gen.nz (David Empson) - 2018-11-20 16:28 +1300
                Re: APFS on HDD JF Mezei <jfmezei.spamnot@vaxination.ca> - 2018-11-21 13:24 -0500
                Re: APFS on HDD Stephen Hoffman <seaohveh@hoffmanlabs.invalid> - 2018-11-19 11:34 -0500
                Re: APFS on HDD Lewis <g.kreme@gmail.com.dontsendmecopies> - 2018-11-13 13:41 +0000
  Re: APFS on HDD Alan Browne <bitbucket@blackhole.com> - 2018-11-11 13:04 -0500

csiph-web