bless

Set volume bootability and set the active boot volume.
bless has 5 modes of execution: Folder Mode, Mount Mode, Device Mode, NetBoot Mode, and Info Mode.

Syntax (brief)

Info Mode:
   --info [dir]    Print blessing information for a specific volume, or the
                   currently active boot volume if dir is not specified
   --getBoot       Suppress normal output and print the active boot volume
   --version       Print bless version number
   --plist         For any output type, use a plist representation
   --verbose       Verbose output

File/Folder Mode:
   --file file     Set file as the blessed boot file
   --folder dir    Set dir as the blessed directory
   --bootinfo [file]
                   Use file to create a "BootX" file in the blessed dir
   --bootefi [file]
                   Use file to create a "boot.efi" file in the blessed dir
   --setBoot       Set firmware to boot from this volume
   --openfolder dir Set dir to be the visible Finder directory
   --verbose       Verbose output

Mount Mode:
   --mount dir     Use this mountpoint in conjunction with --setBoot
   --file file     Set firmware to boot from file
   --setBoot       Set firmware to boot from this volume
   --verbose       Verbose output

Device Mode:
   --device dev    Use this block device in conjunction with --setBoot
   --setBoot       Set firmware to boot from this volume
   --verbose       Verbose output

NetBoot Mode:
   --netboot       Set firmware to boot from the network
   --server url    Use BDSP to fetch boot parameters from url
   --verbose       Verbose output

Syntax (Detailed)

     bless --folder directory [--folder9 directory] [--file file]
           [--bootinfo [file]] [--bootefi [file]] [--bootBlockFile file]
           [--save9] [--saveX] [--use9] [--label name | --labelfile file]
           [--setBoot] [--openfolder directory] [--nextonly] [--shortform]
           [--legacy] [--legacydrivehint device] [--options string]
           [--quiet | --verbose]

     bless --mount directory [--file file] [--setBoot] [--nextonly]
           [--shortform] [--legacy] [--legacydrivehint device]
           [--options string] [--quiet | --verbose]

     bless --device device [--label name | --labelfile file]
           [--startupfile file] [--setBoot] [--nextonly] [--shortform]
           [--legacy] [--legacydrivehint device] [--options string]
           [--quiet | --verbose]

     bless --netboot --server url [--nextonly] [--options string]
           [--quiet | --verbose]

     bless --info [directory] [--getBoot] [--plist] [--quiet | --verbose]
           [--version]
     bless -help

Bless predates SIP, APFS, and T2 Secure Boot. On modern Macs, bless should be used with great caution as it may render the Mac unbootable.

In macOS 10.11 and above, bless should not be used to try to set the startup disk as System Integrity Protection (SIP) is in place.
Instead use systemsetup -setstartupdisk

For a full description of all the bless options see man bless the options available for bless will vary according to the version of macOS you are running.

Examples

INFO MODE
Gather information about the currently selected volume (as determined by the firmware):

sudo bless --info

Gather plist information about the currently selected volume (as determined by the firmware), suitable for piping to a program capable of parsing Property Lists:

sudo bless --info --plist

FOLDER MODE
To bless a volume with only Mac OS 9:

bless --folder9 "/Volumes/Mac OS 9/System Folder" --bootBlockFile "/usr/share/misc/bootblockdata"

To bless a volume with only macOS or Darwin, and create the BootX and boot.efi files as needed:

bless --folder "/Volumes/Mac OS X/System/Library/CoreServices" --bootinfo --bootefi

MOUNT MODE
To set a volume containing either Mac OS 9 and macOS to be the active volume:

bless --mount "/Volumes/Mac OS" --setBoot

NETBOOT MODE
To set the system to NetBoot and broadcast for an available server:

bless --netboot --server bsdp://255.255.255.255

“If everything seems under control, then you're not going fast enough” - Mario Andretti

Related macOS commands:

asr - Apple Software Restore.
diskutil - Disk utilities - Format, Verify, Repair.
mount - Mount a file system.
newfs(8)
nvram(8)
systemsetup -setstartupdisk
HT204455 - How to set a firmware password on your Mac


 
Copyright © 1999-2020 SS64.com
Some rights reserved