Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Restoring from Time Machine via Unix shell

Machine: 15inch 2010 MBP

NAS: WD Mybook Live (upgraded recently to maintain Time Machine support)


Hello,


I've recently do a clean install of Lion (erased old Lion disk, installed Snow leopard and Lion on top) since my machine kept hanging.


I have a time machine full system backup of the old Lion instance, but I don't want to to a full restore as this would just restore whatever gremlin is buried deep within the OS.


When I attempted to restore just the user data from Time Machine, it didn't see the previous backup - even when selecting the Time Machine option to restore from a different backup


As a result of this I figured the only way to get these files back was to do a unix 'cp -rp' from the NAS Time machine backup location to my /Users directory..


This worked fine and the files are all in place with the correct ownership and file permissions from before, however I don't seem to be able to make any changes in spite of file permissions:


drwxr-xr-x@ 36 MyUserName staff 1224 22 Aug 12:23 .

drwxr-xr-x@ 9 root admin 306 22 Aug 07:32 ..

-rwxrwxrwx+ 1 MickFoxWork staff 7 15 Aug 14:37 testfile

~ $ touch testfile

touch: testfile: Permission denied

~ $ sudo touch testfile


I tried removing the time machine related extended attributes and it's made no difference.


Can anyone suggest what's going on here?

MacBook Pro, Mac OS X (10.7), file permissions after TM restore

Posted on Aug 22, 2011 6:18 AM

Reply
7 replies

Dec 31, 2011 12:40 PM in response to Foxo-Ireland

Hey Foxo,

Sounds like I'm having the same problems you had where I've got a Time Machine backup on my MyBook Live, yet when trying to restore my backup cannot be found. I have contacted both Apple and Western Digital Support but neither could help. I've been looking for a way to copy the contents of the backup through terminal to my new computer, but I'm a novice at unix code, as well as stumped on how exactly to enter the directory of my backup. Do you think you could help me out here and take it step by step? You're the only one I can find who has found a solution to this problem, and if I knew exactly how you did it I could finally stop being so ****** about this situation.


Thanks in advance Foxo

Jan 1, 2012 1:39 PM in response to DonPjr

Hey - I'll help if I can but I think you should read up a little on one of the many unix intro tutorials on the internet... it's best to have an idea of how to traverse directories, to copy files etc.. this will help avoid running into silly issues.


Fundementally, the way I approached this problem wasn't really specific to the WD Mybook live, it applies to any time machine disk.


The most important thing you need to check is weather there is a 'time machine backups' volume mounted.

As suggested below, if you do an ls /Volumes you should see it there.


My backups are stored at /Volumes/Time Machine Backups/Backups.backupdb/<Machine Name>/Latest


So what I did was to start from a fresh copy of OS X and then I restored all the home directories from time machine, which contain most of what was needed. I still needed to reinstall the applications, but once installed my preferences were in place since they are stored in the users home directory.


So the following command should work


cp -rp /Volumes/Time Machine Backups/Backups.backupdb/<Machine name>/Latest/Macintosh HD/Users /Users/


As far as I remember the last / might not be needed so if you get an error, try that.


Obviously you'll need to adapt the long bit of the path to your own machine (note the <machine name> in particular)


The copy could take 24+ hours depending on the amount of data - Mine took 18 hours over a wired network connection to transfer ~400GB of data.


Once the copy is finished, you might need to run the following:


sudo chmod -R -N /Users

Jan 2, 2012 2:09 PM in response to Foxo-Ireland

Foxo,


Thanks for doing your best to help me out. Your solution sounds simple enough, but I'm definitely seeing something different here. When I do an ls /Volumes, I can see a TimeMachine disk (and this is only after I use Finder > Go > Connect to Server > afp://mybooklive.local), but in the TimeMachine disk there is no backup database file, only a locked sparsebundle with the name of my last computer.


When I try to mount the sparsebundle (or just attach it with hdiutil attach) I get a message saying there is no mountable file system.


If I go to Get Info, I can see I fall under the user "everybody" which has read only permissions. The other 2 users, both with read/write, are Staff and some user called Daapd. Of course I can't change the permissions of everybody to read/write, nor can I add an admin user.


Here's a screenshot of where I'm at. I'm guessing if I was to mount the sparsebundle, I'd find the backup database on there?


User uploaded file


Thanks for your help guys.

Jan 5, 2012 7:19 AM in response to DonPjr

Hey - Going from memory I think you might be looking in the wrong place.


I've found that there are two mounts involved in TM backups. The first is the /Volumes/TimeMachine which seems to remain mounted most of the time, and is only accessable by the root user.


This isn't the one I've been talking about & my solution didn't use this partition at all - I guess it's for control info or something like that.


The second mount is "/Volumes/Time Machine Backups" which seems to only be connected when a backup is happening. Once this is connected it should just look like a regular filesystem from which you can copy files as previously mentioned.

Restoring from Time Machine via Unix shell

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.