PDA

View Full Version : Fix Time Machine AFP Issues!




CallumCc
Aug 3, 2011, 06:00 AM
Hello, recently I created a post on how to fix the Time Machine AFP issue with OS X Lion. View it here - http://techpump.co.uk/?p=105 :D



Takuro
Aug 3, 2011, 06:54 AM
Well, I tried it out and figured it was worth a shot. Whatever hack this uses seems to rely on an external library file that you inject into the file system and point to using a modified .plist file. So long as you restore the backup plist, all changes should be reverted safely.

The tool used for creating sparsebundles didn't work for me for some reason. No file was generated in my home directory (~). There are other tools out there that I tried, and they seemed to work fine. I used this: http://code.google.com/p/backmyfruitup/

I've started a backup, and so far I'm noticing that data rates to the disk are insanely low right now. I don't know if this is due to the hack, or due to the fact that I've attached a really crappy old NAS unit to my network for testing purposes, not wanting to screw with the one I usually use.

CallumCc
Aug 3, 2011, 08:20 AM
Well, I tried it out and figured it was worth a shot. Whatever hack this uses seems to rely on an external library file that you inject into the file system and point to using a modified .plist file. So long as you restore the backup plist, all changes should be reverted safely.

The tool used for creating sparsebundles didn't work for me for some reason. No file was generated in my home directory (~). There are other tools out there that I tried, and they seemed to work fine. I used this: http://code.google.com/p/backmyfruitup/

I've started a backup, and so far I'm noticing that data rates to the disk are insanely low right now. I don't know if this is due to the hack, or due to the fact that I've attached a really crappy old NAS unit to my network for testing purposes, not wanting to screw with the one I usually use.
I should of been more specific, when I meant home folder, I meant the home user folder. :)

Takuro
Aug 3, 2011, 08:34 PM
I've decided to dissect some of the scripts to see what they do and why there isn't anything in the home directory, as there is supposed to be according to the instructions.

Here's the preparefortimemachine applescript:
on open names
set volumeName to names as text
set macAddress to (do shell script "ifconfig en0 | grep ether | tr -d '\\011' | sed s/ether// | sed 's/ //g' | sed s/://g")
set hostName to (do shell script "hostname -fs")
tell application "Finder"
set theSize to round (((capacity of startup disk) / 1024 / 1024) / 1024)
end tell

do shell script "defaults write com.apple.systempreferences TMShowUnsupportedNetworkVolumes 1" with administrator privileges

do shell script "sudo hdiutil create -size " & theSize & " -type SPARSEBUNDLE -nospotlight -volname \"Backup of " & hostName & "\" -fs \"Journaled HFS+\" ~/" & hostName & "_" & macAddress & ".sparsebundle" with administrator privileges
do shell script "mv ~/" & hostName & "_" & macAddress & ".sparsebundle /Volumes/" & volumeName & "/" with administrator privileges

tell application "Finder" to eject volumeName

tell application "System Preferences"
activate
end tell

tell application "System Events"
tell application process "System Preferences"
set frontmost to true
click menu item "Time Machine" of menu "View" of menu bar 1
end tell
end tell

end open

The following line in particular is interesting:
do shell script "mv ~/" & hostName & "_" & macAddress & ".sparsebundle /Volumes/" & volumeName & "/" with administrator privileges

Looks like the script actually moves the sparsebundle file out of the home directory and into the volume that you're creating it for. So you need to revise your instructions a bit. There's nothing left in the home directory when the process completes.

CallumCc
Aug 4, 2011, 05:03 PM
I've decided to dissect some of the scripts to see what they do and why there isn't anything in the home directory, as there is supposed to be according to the instructions.

Here's the preparefortimemachine applescript:
on open names
set volumeName to names as text
set macAddress to (do shell script "ifconfig en0 | grep ether | tr -d '\\011' | sed s/ether// | sed 's/ //g' | sed s/://g")
set hostName to (do shell script "hostname -fs")
tell application "Finder"
set theSize to round (((capacity of startup disk) / 1024 / 1024) / 1024)
end tell

do shell script "defaults write com.apple.systempreferences TMShowUnsupportedNetworkVolumes 1" with administrator privileges

do shell script "sudo hdiutil create -size " & theSize & " -type SPARSEBUNDLE -nospotlight -volname \"Backup of " & hostName & "\" -fs \"Journaled HFS+\" ~/" & hostName & "_" & macAddress & ".sparsebundle" with administrator privileges
do shell script "mv ~/" & hostName & "_" & macAddress & ".sparsebundle /Volumes/" & volumeName & "/" with administrator privileges

tell application "Finder" to eject volumeName

tell application "System Preferences"
activate
end tell

tell application "System Events"
tell application process "System Preferences"
set frontmost to true
click menu item "Time Machine" of menu "View" of menu bar 1
end tell
end tell

end open

The following line in particular is interesting:
do shell script "mv ~/" & hostName & "_" & macAddress & ".sparsebundle /Volumes/" & volumeName & "/" with administrator privileges

Looks like the script actually moves the sparsebundle file out of the home directory and into the volume that you're creating it for. So you need to revise your instructions a bit. There's nothing left in the home directory when the process completes.
When I created the instructions, it was at the same time of performing this myself, the .sparsebundle went to my username in the 'Go' tab at the top of finder. Other users of this have also found this there.

syth
Aug 21, 2011, 04:41 PM
Hello, recently I created a post on how to fix the Time Machine AFP issue with OS X Lion. View it here - http://techpump.co.cc/?p=105 :D

This seems to be a SMB fix, not an AFP fix.