How to restore MacOS Backup from SMB share

2023.06.02

Introduction

I have an MacBook Pro mid 2015. The latest MacOS available on this laptop is High Sierra. Let’s pretend, my disk drive is failed and i bough a new SSD drive and installed it in my laptop (actually i accidentely delete all partitions on drive, but that does not matter). The easiest way, i can recover that laptop to working state must be hold alt/option button during the system turning on, boot to recovery downloaded from Apple servers, and choose “Reinstall OS” option.

Recovery mode was booted correctly, but installation is failed because servers are not reachable. I have no other Macs, so i download MacOS DMG image and created a local boot device. But the installation was failed because “your image is corrupted”. I suppose it is a problem with outdated certificate because the High Sierra is now outdated OS.

The only way to recover this laptop was to create a TimeMachine backup of working High Sierra OS, and after that.

Creating the backup

I was using VirtualBox Machine with MacOS: you need an outdated version on Virtualbox Engine, custom Virtual Machine configuration and vmdk disk image. You can use any tipe of source system which you want. Using the vmdk image from internet is not a good option, because it can be infected. I was planning to install MacOS 12 (Monterey) with OpenCore Legacy Patcher anyways, so I could ignore this security issue.

Mount SMB Share

In finder use Go, Go to Server and connect to your server with smb://hostname and select your directoryname where you want to store the backup, enter your login and password for remote SMB server

Create an Image Disk

Open Disk Utility, File, New Image, Blank Image. Select you mounted share in opened window and set the Size of your source system. I would recommend at least 65GB value. Also set the Name for Disk Image. I use TimeMachine name.

ℹ The Disk Image creation can take a lot of time. If you don’t want your source system to sleep run in terminal command pmset noidle

Make sure, you see the mounted image in side panel in Finder

ℹ If you want to use the SMB share for regular backups, you need to add the disk image to System Preferences, Users and Groups, Login Items.

Configure TimeMachine

You need to open terminal

Set the destination of backup

sudo tmutil setdestination /Volumes/TimeMachine/

And start backup

tmutil startbackup

The process of backup you can monitor in System Preferences, Time Machine

Restoring the backup

First of all boot to recovery.

Mount SMB sahre

Open Utilities, Terminal. Create the new folder /tmp/smb and mount SMB share, entering your username:

# mkdir /tmp/smb
# mount_smbfs "//domainname;username@hostname/directoryname" /tmp/smb
🗝[Password for hostname]

Mount backup disk image

After that close the terminal, open Disk Utility, File, Open Disk Image, select mounted share in side menu, and open your disk image TimeMachine.dmg. Close Disk Utility

Start restore process

Now select Restore from backup option. You would see your backup there, start the restoring process.