14

I have a 2014 MacBook Pro.

I want to restore my OS from a Time Machine backup which is on a shared network volume.

When I restart in recovery (Apple-Opt-R), it boots from internet, but if I try to restore from Time Machine backup, it fails to see the server where the shared volume is.

Do I need to log/mount the share somehow?

bmike
  • 235,889
d0g
  • 3,902

3 Answers3

32

UPDATE: On recent versions of macOS (tested with High Sierra 10.13.4) you can restore from a networked drive directly from the "Restore from Time Machine Backup" option in the recovery mode. The following steps are not required (but are super awesome!).


Prerequisites:

– admin account & password
– AFP/SMB-share & server IP-address

  1. Boot the Computer to Recovery Mode.
  2. Open Terminal in the Utilities menu
  3. At the prompt enter: cd /Volumes
  4. Create a sub-directory in Volumes as a mount point for your time machine share:
    mkdir TimeMachine
  5. Enter cd TimeMachine
  6. Enter pwd. pwd should show /Volumes/TimeMachine
  7. Mount the network share with your admin loginname & password:

    mount -t afp afp://adminname:password@ServerIPAddress/ShareName /Volumes/TimeMachine
    

    If your password contains wonky characters like :@\/ use URL encoding to protect them

  8. Enter: ls -la. Note the exact name of your sparsebundle.
  9. Enter: hdid /Volumes/TimeMachine/NameOfYourSparseBundle. You may enter the first letters of the sparsebundle name and then hit TAB. Hitting tab should auto-complete the Time Machine sparsebundle name. It may not look the same as above as it escapes spaces and special characters.
  10. After auto-completing the name, hit return. If you return to the prompt the sparsebundle has been opened.
  11. Enter exit and and quit Terminal.
    Example steps 3-11:

    enter image description here

  12. Select Restore From Time Machine Backup and click Continue.

    enter image description here

  13. After a search it should show you the Time Machine Backups directory as a volume that contains your backup. Select that (in my example 'Time Machine Backups') and click Continue.

    enter image description here

  14. In the next screen you will see all the backups that you can restore from listed by time and date.

    enter image description here

  15. Select the backup you want to restore and continue and finally choose your destination disk:

    enter image description here

chmac
  • 534
klanomath
  • 66,391
  • 9
  • 130
  • 201
  • I actually tried all that previously ... but the mount command gives me this error: mount_afp: AFPMountURL returned error -5023, errno is -5023 -- which it gives even when I try to mount when NOT in recovery. – d0g Dec 18 '14 at 19:46
  • AH! I figured it out. My password has a \ in it ... so I need to quote the afp:.. string. Hopefully that will work in recovery as well. – d0g Dec 18 '14 at 19:48
  • @Ze'ev that's no good. do you have admin rights at the server? – klanomath Dec 18 '14 at 19:52
  • @Ze'ev i had no problem using this with a regular password (=not containing any "forbidden" chars like :@/) – klanomath Dec 18 '14 at 20:52
  • Not sure what you're saying. My password DOES have a \ in it, so I put single quotes around the afp://... part of the command. And it worked. However, upon getting to the restore part, it said there was 930GB free on my HD, when there are only 215GB. That scared me. Any idea why? – d0g Dec 20 '14 at 01:15
  • @Ze'ev the password hint wasn't directed directly to you ;-) i tested different passwords (containing : or @) and quoting/escaping didn't work. – klanomath Dec 20 '14 at 01:21
  • @Ze'ev What do you want to restore? The whole system? Probably it's better to ask a second question with some screenshots here at askdifferent. – klanomath Dec 20 '14 at 01:26
  • strange... It worked for me – d0g Dec 20 '14 at 01:29
  • @Ze'ev i just test it again (in a VM) before i approve your edit... – klanomath Dec 20 '14 at 01:33
  • If I have my own folder at the root level of the drive, e.g. /media, will restoring from Time Machine erase that folder? – d0g Jan 24 '15 at 20:27
  • @Ze'ev which drive do you mean? Your system drive? Your backup should contain this folder or it's no real backup! Or do want to revert to a much older version? – klanomath Jan 24 '15 at 20:38
  • Yes, system drive. I have a big /media folder which I do NOT backup with Time Machine. I could back it up if necessary, but was hoping there was a way to revert JUST the OS. – d0g Jan 24 '15 at 20:40
  • You may restore single folders (eg /System /Library /bin /sbin /Applications /Users etc) which won't hurt your /media folder. – klanomath Jan 24 '15 at 20:48
  • I know this is rather old but if you do have any special characters (like \ ) in your password, you may need to escape some or even all of them with... \ (yep, a backslash :) ). So \\ represents that single \ in your password. – Erathiel Nov 20 '15 at 15:13
  • I've posted an edit because this is no longer required. I actually tried this method first before trying using the GUI directly, and it allowed me to specify a server, username / password, and then restore. Makes the handling of special characters and so on a lot simpler. :-) – chmac Aug 02 '18 at 14:35
  • Its very important to print full path to your backups folder on network drive. Without this you will not see backups and contiue button. Its very stupid and confusing people. I wasted 2 days to figure out that I just neet to print "smb://computername/Shared/mac_backups" . This is where my backups is stored. And without "mac_backups" part it did not work. – andre719mv Oct 11 '18 at 21:38
  • After trying a lot of things for a couple of days to make system restore see my backups, I also discovered that recovery version must be not older than the OS the backup was taken with. I had a backup taken with 10.15, and recovery 10.14 didn't see any backups. I had to hold Option-Command-R during boot to get a newer recovery image, which finally worked as expected. – gelraen Jan 15 '21 at 14:26
4

The above answers are a bit too complicated for my taste. I actually tried klanomath's answer and failed, maybe because I have an encrypted backup on the network share. But might also have to do with a wrongful URL encryption.

However there is a much easier way. In this step:

enter image description here

just reinstall your OS X.

After that is finished the migration assistant should popup or if it does not, one can create a user, login and then start the migration assistant by hand.

In the migration assistant:

Migration Assistant

choose "From a Mac, Time Machine backup, or startup disk". Click Continue, and choose "Other server". This will allow you to enter the address of the volume and it will ask you for the password, in case you used an encrypted backup.

After that you can choose what to recover. Beware, if the user you created after the installation has the same name as the one you used in the backup, there will be a conflict. You will then need to choose, whether you would like to keep delete the user or keep the data.

scentia
  • 41
  • 1
  • I tried this method first after reading the introduction "there is a much easier way" - If this would work, it certainly seems easier than @klanomath's method. When I did this, it immediately found my mac network share on my Synology network storage device and I'm restoring now. Very, very easy. – Doug Harris Feb 19 '18 at 17:31
  • You need to enter the server name and share in the other disk box, eg. afp://server-name/share, and then it will find the disk. – Kevin Kuszyk Sep 05 '18 at 18:06
2

Recovery mode needs a netboot server (like OS X server app) to serve up that image.

You could set one up or you could copy the backup instance to a USB drive and connect it locally.

For netboot, I'd recommend deploy studio as your go to solution in terms of ease of use and robustness of the solution.

Also, if you just need user files and applications, you could do a clean install of the OS and then make a temporary user account and use migration assistant to copy the real user and files over once the Mac can run it's own OS to perform the network mount.

bmike
  • 235,889