boot OS X from a ZFS volume

Moderators: jhartley, MSR734, nola

boot OS X from a ZFS volume

Post by grahamperrin » Sun Sep 23, 2012 2:37 am

Spun off from some of the multiple questions in
viewtopic.php?p=16#p16 (2012-09-15) and in
viewtopic.php?p=293#p293 (2012-09-23)

It'll be good to have two separate and focused topics:


Of the two wishes, one might be realised sooner than the other …
grahamperrin Offline

User avatar
 
Posts: 1596
Joined: Fri Sep 14, 2012 10:21 pm
Location: Brighton and Hove, United Kingdom

boot from ZFS: MacZFS, Ten's Complement and GreenBytes roadm

Post by grahamperrin » Sun Sep 23, 2012 3:19 am

In the MacZFS area:


In the Ten's Complement area (referred from http://forums.macrumors.com/showpost.ph ... stcount=97):



Support for booting is on our product road-map.


I imagine that GreenBytes, Inc.:

  • has, on its roadmap, a level of support for booting from ZFS – at least equal to the level mapped by Ten's Complement
  • will not publicly announce a date for that milestone, until there's certainty that implementations will be close to flawless.

(The timeliness of the first Community Edition – exactly as announced by GreenBytes in July – has been very warmly welcomed.)
grahamperrin Offline

User avatar
 
Posts: 1596
Joined: Fri Sep 14, 2012 10:21 pm
Location: Brighton and Hove, United Kingdom

Apple_Boot slice customisation for ZFS

Post by grahamperrin » Sun Sep 23, 2012 3:55 am

asmod4n wrote:

… bootloader and a kernel image on hfs+ to boot afaik, at least the bless command lets you think that.


In recent months I've been thinking along the same lines.

It seems to me that Coriolis Systems takes a gold standard approach to resizing and moving partitions, to allow an additional Apple_Boot slice – akin to OS X Recovery. Alongside the familiar apps and utilities provided by Apple, there appear the Coriolis apps. For example, the Coriolis slice installed to a 16 GB USB flash drive with FileVault 2:

Code: Select all
macbookpro08-centrim:~ gjp22$ diskutil list /dev/disk12 && diskutil mount readonly /dev/disk12s4 && diskutil info /dev/disk12s4 && diskutil list disk13
/dev/disk12
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *15.9 GB    disk12
   1:                        EFI                         209.7 MB   disk12s1
   2:          Apple_CoreStorage                         14.4 GB    disk12s2
   3:                 Apple_Boot Recovery HD             650.0 MB   disk12s3
   4:                 Apple_Boot Coriolis Recovery HD    650.0 MB   disk12s4
Volume Coriolis Recovery HD on /dev/disk12s4 mounted
   Device Identifier:        disk12s4
   Device Node:              /dev/disk12s4
   Part of Whole:            disk12
   Device / Media Name:      Coriolis Recovery HD

   Volume Name:              Coriolis Recovery HD
   Escaped with Unicode:     Coriolis%FF%FE%20%00Recovery%FF%FE%20%00HD

   Mounted:                  Yes
   Mount Point:              /Volumes/Coriolis Recovery HD
   Escaped with Unicode:     /Volumes/Coriolis%FF%FE%20%00Recovery%FF%FE%20%00HD

   File System Personality:  HFS+
   Type (Bundle):            hfs
   Name (User Visible):      Mac OS Extended
   Owners:                   Disabled

   Partition Type:           Apple_Boot
   OS Can Be Installed:      No
   Media Type:               Generic
   Protocol:                 USB
   SMART Status:             Not Supported
   Volume UUID:              5461E5FB-911A-33F3-976D-91CBAF193356

   Total Size:               650.0 MB (650002432 Bytes) (exactly 1269536 512-Byte-Blocks)
   Volume Free Space:        108.6 MB (108605440 Bytes) (exactly 212120 512-Byte-Blocks)
   Device Block Size:        512 Bytes

   Read-Only Media:          No
   Read-Only Volume:         Yes
   Ejectable:                Yes

   Whole:                    No
   Internal:                 No

/dev/disk13
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:                  Apple_HFS Mountain Lion template *14.1 GB    disk13


Back to ZEVO. I lack developer knowledge, but I guess that for
initial boot from an Apple_Boot slice to be followed by
boot from a ZEVO zfs_pool_proxy slice, the Apple_Boot slice must include:

  • file system plug-in
  • file system kernel extension
  • IOKit driver.

(Reference: InstallationWhat gets Installed?)

An additional slice for this ZEVO purpose need not be as large as Apple's slice for OS X Recovery.

(Side note: I know very little about third party bootloaders. Minimal use of OSX86 stuff to allow Lion and Mountain Lion in VirtualBox, that's about it.)
grahamperrin Offline

User avatar
 
Posts: 1596
Joined: Fri Sep 14, 2012 10:21 pm
Location: Brighton and Hove, United Kingdom

cross reference

Post by grahamperrin » Tue Nov 20, 2012 3:12 pm

grahamperrin Offline

User avatar
 
Posts: 1596
Joined: Fri Sep 14, 2012 10:21 pm
Location: Brighton and Hove, United Kingdom

cross reference and advice

Post by grahamperrin » Sat Dec 01, 2012 2:06 am

At viewtopic.php?p=3346#p3346 under Adding ZFS drivers to boot disk & recovery?:

mk01 wrote:whole trick about recovery partition is in the read only dmg inside it. you have to extrakt it, add kext, run cache update via terminal on a custom dir and put everything back into same type read only image.


I should:

  • strongly discourage modification of any Apple_Boot slice that is installed by Install OS X Mountain Lion.app or comparable routines – in particular, do not modify the slice that is for OS X Recovery
  • discourage modification of any additional Apple_Boot slice that is installed for FileVault 2 purposes, or for other routines that are aligned with Apple practices
  • encourage an additional Apple_Boot slice for any modification that involves third party (non-Apple) software.

Please note that:

  • with a single installation of OS X Mountain Lion, on a single disk, there may be two or more Apple_Boot slices
  • all such slices may be named Boot OS X – it's not always Recovery HD for Recovery OS, and the name seen at EfiLoginUI may not match the name of the partition.

I guess that there's open source, somewhere, to assist with customisation.
grahamperrin Offline

User avatar
 
Posts: 1596
Joined: Fri Sep 14, 2012 10:21 pm
Location: Brighton and Hove, United Kingdom

Re: boot OS X from a ZFS volume

Post by mk01 » Thu Dec 06, 2012 7:30 pm

btw: boot partition and recovery partition are quite different. apple boot is 128m in size, holding kernel and kexts and few .plist configs. recovery part is 650m in size holding live OS image.

btw2: boot partition is updated each time kextd is updating caches. inject boot partition is not a big deal. it's possible to even delete it, if disk utility is run with recovery process on disk (not partition), it's automatically recreated - if needed to boot system (file vault, apple raid). it is interesting, but somewhere in docs to diskutil (or dev?) it's written, that according to apple standards, partitions must not be closer to each other than these 128m. and this is the reason. to be able to place boot part. if disk is partitioned via disk utility, partitions are automatically placed apart according to those specs.

btw3: grehamperrin is right, never try to jailbreak anything without deep knowledge what is needed and what can happen.
mk01 Offline


 
Posts: 65
Joined: Mon Sep 17, 2012 1:16 am

Apple_Boot

Post by grahamperrin » Fri Dec 07, 2012 10:23 pm

Thanks, to clarify:

  • Apple_Boot is the type of partition that is used for Recovery OS, also known as Recovery System.

An example, with Recovery OS at slice 6 (ignore slice 3):

Code: Select all
sh-3.2$ diskutil list disk0
/dev/disk0
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *750.2 GB   disk0
   1:                        EFI                         209.7 MB   disk0s1
   2:                  Apple_HFS swap                    32.0 GB    disk0s2
   3: FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF               536.9 MB   disk0s3
   4:                  Apple_HFS spare                   671.1 MB   disk0s4
   5:          Apple_CoreStorage                         99.5 GB    disk0s5
   6:                 Apple_Boot Boot OS X               650.0 MB   disk0s6
   7:          Apple_CoreStorage                         616.3 GB   disk0s7
   8:                 Apple_Boot Boot OS X               134.2 MB   disk0s8
grahamperrin Offline

User avatar
 
Posts: 1596
Joined: Fri Sep 14, 2012 10:21 pm
Location: Brighton and Hove, United Kingdom


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest

cron