Bless

From OpenZFS on OS X
Revision as of 06:43, 27 July 2016 by Evansus (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Using a layout as specified in ZFS on Boot, using disk1:

The simplest version of this command will locate the boot helper following the ZFS partition:

# sudo bless --device /dev/disk1s2 --setBoot --verbose

Currently --folder and --mount options will work (partially) but may select the wrong boot helper if there are multiple bootable ZFS pools. (For example, if you have ZFS boot setup on both the internal disk and an external disk.)

# sudo bless --folder /Volumes/Capitan --setBoot --verbose
# sudo bless --mount /Volumes/Capitan --setBoot --verbose


There is an undocumented environment variable that can resolve the conflict. For example, if the ZFS pool is located on disk3s2, and the boot helper is disk3s3:

# sudo bless --mount /Volumes/Capitan --setBoot --verbose
{ ... Truncated output ... }
Returning booter information dictionary:
<CFBasicHash 0x7fd7c2400a30 [0x7fff75c10440]>{type = mutable dict, count = 3, entries =>
       0 : <CFString 0x10bd97990 [0x7fff75c10440]>{contents = "System Partitions"} = (
   disk1s1,
   disk0s1,
   disk2s1,
   disk3s1
)
       1 : <CFString 0x10bd98170 [0x7fff75c10440]>{contents = "Data Partitions"} = (
   disk1s2,
   disk2s2,
   disk3s2
)
       2 : <CFString 0x10bd98190 [0x7fff75c10440]>{contents = "Auxiliary Partitions"} = (
   disk1s3,
   disk2s3,
   disk3s3
)
}
Substituting booter disk1s3
{ ... Truncated output ... }

Adding an environment variable 'BL_PRIMARY_BOOTER_INDEX' can instruct bless to use the correct partition. The index will start from 0 and count upwards in the list of "Auxiliary Partitions"

In this case, the pool is located on disk3s2 and the boot helper is disk3s3, so adding an index of 2 will select the third boot device:

# sudo env BL_PRIMARY_BOOTER_INDEX=2 bless --mount /Volumes/Capitan --setBoot --verbose
{ ... Truncated output ... }
Returning booter information dictionary:
<CFBasicHash 0x7fd7c2400a30 [0x7fff75c10440]>{type = mutable dict, count = 3, entries =>
       0 : <CFString 0x10bd97990 [0x7fff75c10440]>{contents = "System Partitions"} = (
   disk3s1,
   disk1s1,
   disk0s1,
   disk2s1
)
       1 : <CFString 0x10bd98170 [0x7fff75c10440]>{contents = "Data Partitions"} = (
   disk3s2,
   disk1s2,
   disk2s2
)
       2 : <CFString 0x10bd98190 [0x7fff75c10440]>{contents = "Auxiliary Partitions"} = (
   disk3s3,
   disk1s3,
   disk2s3
)
}
{ ... Truncated output ... }
Substituting booter disk3s3
IOMedia disk3s3 has UUID 4C5E73A9-05D0-4B7F-A6A8-050715D620A0
Setting EFI NVRAM:
       efi-boot-device='<array><dict><key>IOMatch</key><dict><key>IOProviderClass</key>
<string>IOMedia</string><key>IOPropertyMatch</key>
<dict><key>UUID</key><string>4C5E73A9-05D0-4B7F-A6A8-050715D620A0</string></dict></dict>
<key>BLLastBSDName</key><string>disk3s3</string></dict></array>'
{ ... Truncated output ... }