How to restore your hard drive from a Time Machine backup

How to restore your hard drive from a Time Machine backup

Whether you’re having major problems with your current hard drive or upgrading to a new Mac, Time Machine can help you get back to business.

  1. Power up your Mac and hold down the Command and R keys to enter the macOS Recovery Partition. Your Mac should boot to a screen that says macOS Utilities.
  2. Select Restore from Time Machine Backup and click Continue.
  3. Read the info on the Restore Your System page and click Continue.
  4. Select your Time Machine backup and click Continue.
  5. Select the most recent backup of your hard disk and click Continue. Your Mac will then restore the Time Machine backup; once it’s done it will restart.

If you’ve had to replace it with a stock drive that has nothing on it—not even macOS—you won’t be able to boot from the macOS Recovery Partition. But fear not, you can get the recovery rolling from the Time Machine backup disk itself: Just hold down the Option key when you start your Mac; you’ll be able to select the Time Machine backup disk as your startup drive, and go from there.
 
NB. I haven’t tested this yet, hopefully I’ll never have to. 🙂

How to run a shell script in OS X by double-clicking

  • First in terminal make the script executable by typing:
    chmod a+x (yourscriptname)

 

  • Then, in Finder, right-click your file and select “Open with” and then “Other…”.

 

  • Here you select the application you want the file to execute into, in this case it would be Terminal.
  • To be able to select terminal you need to switch from “Recommended Applications” to “All Applications”.
    NOTE: The Terminal.app application can be found in the Utilities folder

 

  • If you want this to be the default behaviour from now on, check the “Always Open With” box.
  • After clicking OK you should be able to execute you script by simply double-clicking it.

Setting the hostname on your Mac

Setting the hostname on your Mac using scuttle

  1. Open a terminal.
  2. Type the following command to change the primary hostname of your Mac:
    sudo scutil –set HostName <new host name>
  3. Type the following command to change the Bonjour hostname of your Mac:
    sudo scutil –set LocalHostName <new host name>
  4. Optional: If you also want to change the computer name, type the following command:
    sudo scutil –set ComputerName <new name>
Like this:
 sudo scutil --get HostName
 sudo scutil --get LocalHostName
 sudo scutil --get ComputerName

Create a bootable installer for macOS

Example:

sudo /Applications/Install macOS Sierra.app/Contents/Resources/createinstallmedia --volume /Volumes/MyVolume --applicationpath /Applications/Install macOS Sierra.app

See the Apple Support page here : https://support.apple.com/en-us/HT201372
or watch this video
TIP: You will probably need to erase the HDD using the disk utility before installing.
If you do, chose what ever name you like, one of the Mac Formats and make sure to choose the GUID scheme.