Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

example code of Unix bless command

Posted on 2014-09-28
2
Medium Priority
?
351 Views
Last Modified: 2014-10-01
Need Unix example code for using “bless”.

Present situation
******************
Apple downloads a “Mavericks” operating system to my 128-GB thumb drive.

This download takes anywhere from 5-hours to 14-hours

Resulting thumb drive is bootable, no problem, happy user.

I then create a backup of the entire thumb drive using Apple’s “Time Machine” application.

Problem:   Restored thumb drive is no longer bootable, therefore is useless.

This ONLY happens with the physically small thumb drives.

Keep in mind that when Apple downloads their Mavericks OS to the same thumb drive, the drive is bootable, no problem.   If Apple can force the thumb drive to be bootable, then we should be able to also.

If instead of a thumb drive, I use a larger SSD, the physically larger drive does NOT lose its ability to be bootable after being restored by a Time Machine backup.


Question
**********
Is it possible to use Unix “bless” to restore a thumb drives bootable characteristic?

My Unix knowledge is extremely weak, so the “man bless” command is gibberish to me.

I know how to use a few Unix commands, like:   diskutil list
and even:  diskutil partitionDisk disk1 2 JHFS+ MAIL-2 42949672960b JHFS+ UNUSED_AA 1048576b


Could some expert please supply some example code of a bless command?

I might be able to puzzle out how to use “bless” from the example code.

Possibly some example like:     bless  disk2  MyThumb  setBoot

( I don’t have the nerve to try the above example, for fear of omitting essential info’ )


My Setup
**********
MacBook Pro computer running latest “Mavericks” OS.

Bootable external drives, both the spinning mechanical types and the SSD types.
0
Comment
Question by:SuperSenile
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 30

Accepted Solution

by:
serialband earned 2000 total points
ID: 40353453
Near the end of the manpage, you'll see some examples.


man bless
<snip>

   FOLDER MODE
     To bless a volume with only Mac OS X 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 Mac OS X 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

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

           bless --info --plist

Open in new window



Here's a couple of sites with examples as well.

http://www.egg-tech.com/mac_backup/
http://www.projectosx.com/forum/index.php?showtopic=3171
0
 

Author Closing Comment

by:SuperSenile
ID: 40355203
Thanks again serialband,  I appreciate the help.

SuperSenile -
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article we will learn how to backup a VMware farm using Nakivo Backup & Replication. In this tutorial we will install the software on a Windows 2012 R2 Server.
I was prompted to write this article after the recent World-Wide Ransomware outbreak. For years now, System Administrators around the world have used the excuse of "Waiting a Bit" before applying Security Patch Updates. This type of reasoning to me …
To efficiently enable the rotation of USB drives for backups, storage pools need to be created. This way no matter which USB drive is installed, the backups will successfully write without any administrative intervention. Multiple USB devices need t…
This tutorial will walk an individual through configuring a drive on a Windows Server 2008 to perform shadow copies in order to quickly recover deleted files and folders. Click on Start and then select Computer to view the available drives on the se…

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question