Wednesday, July 27, 2011

Lion, Time Machine and AFP feature bits.

Update2: SMB should be supported in _r2 version. Probably not a very good idea unless your network connection is solid. Also remember that you can't restore the whole system from a TM image on an SMB share.. at least not from OS X boot disk.
Update1: Please try updating your NAS firmware first; most manufacturers will be releasing updates that make their devices Lion-compatible in the near future.
These new flags made mandatory in Lion help with AFP session recovery after network connection loss, so you will be at a higher risk of data corruption when using this workaround over spotty WiFi.

'The network backup disk does not support the required AFP features' message means that
Lion's backupd now requires 'TM Lock Stealing' and 'Server Reply Cache' AFP features on all TM destinations.

TMShowUnsupportedNetworkVolumes workaround affects the UI but has no effect on actual daemon behaviour.
So, seeing as how I'm not going to buy a Time Capsule any time soon, an idea was born:
What if we could make backupd work with those unsupported volumes and unleash any potentially data-munching-monster-ish bugs this unsupportedness shall surely entail? Sounds like a plan!

tldr: Download, unzip and run the script.

^^ A dylib that fakes those new shiny AFP feature bits for your old musty half-dead early 20th century NAS-o-saurus.

Disclaimer: Use at your own risk; data-corru¾*{5Ë# may occur!

Boring tech details: just read the source.


Björn said...

hey, great to see you're working on that. but every time I run the script, "cannot execute binary file" appears. can you please help me. thanks for all!

msft.guy said...

@Björn: Please run the script in debug mode (bash -x ~/Downloads/backupd_anyafp/ and copy the output to, then post a link here..

Björn said...

YEEEHAAAAAA! I got it!!! Thanks so much!!! what a great day. thanks again ;) !!!!!

Unknown said...

it works great!!!

Anonymous said...

Confirm from me too.. Works just fine. Now I can make timemachine backups from Lion to my Lacie Networkspace.

Also thanks goes to Google to rank this page so high, so soon :)

eli said...

I have a Terastation. I ran your script, but I am still not able to mount the Buffalo Terastation via AFP in Lion.

Any suggestions? Am I doing something wrong.

Thank you Very much.

msft.guy said...

@eli: Afaik there were two problems with Lion compat. The first was SMB1 support and 'DHCAST128' auth were disabled. Read here ( on how to reenable them.
My post only pertains to the specific problem where you already _can_ mount your network drive via AFP or SMB, but Time Machine displays an error 'The network backup disk does not support the required AFP features'.
Hope this helps.

mattpreston said...

Glad I found your post, however I'm struggling to run the script? I ran this in terminal:

bash -x ~/Downloads/backupd_anyafp/

made sure all the paths were okay but then got your about about message..

TechWorldTips said...

Hello, also didn't work for me -

All I did was drag the script to Terminal? Is that right?

msft.guy said...

@mattpreston: "but then got your about about message.." - can you elaborate on that? Or paste some Terminal output?..

@TechWorldTips: Script ran fine. Now start Console, filter for backup, then click 'Back Up Now' in TM menu; you should get some logs; copy them to as well.
Were you getting 'The network backup disk does not support the required AFP features' message or something else?

woodstok said...

Just to clarify, should this work when using TM via SMB ? Doesn't work for me although script installs fine and did a reboot.

msft.guy said...

@woodstok: New version will work with SMB.. at least it works for me ;)
(Updated the post)
Post the Console log if it doesn't..

woodstok said...

Installed the current version and this makes a difference, but still no luck. See Am trying to backup to a previous image created under Snow Leopard (then and now via SMB).

msft.guy said...

@woodstok: the dylib works as expected, but TM can't create new images over SMB, and that's what it attempts to do according to the log.
Please try to mount the volume 'owl.sparsebundle' manually to verify it works and is writable.

woodstok said...

@mfst.guy, problem solved :-) TM now wanted the image at the top level of the mount point. Completed 11GB backup over WiFi. Works perfectly incld. restore. Can highly recomend this hack. Briliant, and thanks for sharing this!

Callum Catterall said...

@mfst.guy Hi, I've got it to backup, done a 58GB backup, and some others after it, can't seem to enter Time Machine, just says connecting to backup volume and then it goes?

Callum Catterall said...

@mfst.guy this is the console log, enter time machine shows up on my MacBook Pro, not the iMac -

msft.guy said...

@Callum Catterall: Not sure what's wrong there... no errors and the backup volume seems to have been mounted OK. I think Finder does the TM UI, so no idea what goes wrong after backupd mounts the image; and I can't reproduce that myself (TM UI works for me over SMB), so good luck figuring this one out :/

Callum Catterall said...

@mfst.guy Nevermind, thanks for this though :)

RODVAL said...

Everything is working fine, but I cannot enter Time Machine to navigate through the hourly backups created. However I can see backups are done automatically. What could be wrong?

RODVAL said...

Here is the results...

Ekynos said...

Works like a charm with my Buffalo Link Station WXL798. Thank you very much!

Woife said...


Works on a SMB-Share on WHS 2011.
Thanks alot.

Regards from Munich, Germany


woodstok said...

Hi mfst.guy, backups and browsing TM have been working great. Backups do now (using SMB) take a lot longer than under Snow Leopard. There is an indexing-the-backup phase which I don't recall to have seen under Snow Loepard. This take a lot of time. Do you know if this is a Lion feature, or could this be a side effect of your sourcery ?

alexndr said...

How do I rollback the changes that the script makes?

minWi said...

You make my day! THANK YOU! :)

mixmax said...

Trying to recover media from my iPhone2G 3.1.3 via SHH with RAMdisk method. I can't mount user data partition (getting invalid argument error) and can't fix it via fsck - see below:

-sh-4.0# fsck_hfs -r /dev/disk0s2
** /dev/rdisk0s2
** Checking Non-journaled HFS Plus volume.
** Detected a case-sensitive catalog.
** Checking Extents Overflow file.
** Checking Catalog file.
** Rebuilding Catalog B-tree.
** The volume Data could not be repaired.
-sh-4.0# fsck_hfs -p /dev/disk0s2
Invalid node structure
(4, 1582)

Any chance to access /dev/disk0s2 or dump raw contents of it via USB to host PC for further processing and recovery? Any other suggestions? %(

Blinde Kuh said...

You made a small error in the script. Nothing serious.

It should be:

sudo killall backupd 2>&1 >/dev/null

instead of

sudo killall backupd 2&>1 >/dev/null

Raffy said...

Cannot thank you enough for this work. I went around and around for *weeks* with numerous D-Link support forums, and command line AFP_DISABLED_UAMS prefs before trying your script to success. My DNS-323 now works with OSX Lion and Time Machine. Thanks again!

medic said...

Quick question concerning your disclaimer:

"Also remember that you can't restore the whole system from a TM image on an SMB share.. at least not from an OS X boot disk."

In case I want to restore do it do it? Do I copy the TM image on a usb drive from my NAS and take it up from there or what would be the best way?


Anonymous said...

could you help me with this one please?
Problem:"cannot execute binary fie"

apes said...

i think i love you. a while back i found out how to enable unsupported network disks and create a sparsebundle but it never would run the backup. it works now in Lion thanks to your script. i can breath now, so can my business... THANKS!

shortpitch said...

worked great on my MacMini with a DNS-323. Thanks!

albis said...
This comment has been removed by the author.
albis said...

Thanks thanks thanks thanks! I am finally able to use time machine to backup my macbook air and cisco x3000

seath2008 said...

On a BA4000 I keep getting this error from TM "The network backup disk does not support the required AFP features"

Any ideas?

seath2008 said...

wrong alert. everything works fine. I got the chicken answer first and I thought I was ok with installation (I typed the phrase with Capitals and Lows) just as it appeared and not in low letters
Anyway, after days of trials and errors and looking to install linux in BA it worked without all these tricks. Script was perfect

TechNazgul said...

Another thumbs up here. In my case I was mounting a Windows Server 2008 share to a MBP 13" via wireless and it worked fine.

Just to provide one other point to check if anyone is having problems... make sure you are only mounting via SMB, not NFS, which was how I started and that will not work. These were the first part of the instructions I followed to make the sparsebundle on the network share if anyone else needs them:

Thank you!

Mark said...

thank you! it worked great (once I had sorted out my administrator rights on my mbp). Buffalo Linkstation HS-DH500GL working with Time Machine & Lion. thanks again.

wuotr said...

So if I understand this correctly I have to run this script on my Macbook, which will enable me to connect with an SMB share? And then I'll have to create a .sparsebundle? Thanks in advance ;-)

msft.guy said...

@wuotr: just find an article describing how to set up TM to SMB in SL, now you can do the same stuff but in Lion, using this hack. I wouldn't know setup details anyway, since I already had a backup before my 10.6->10.7 upgrade.

wuotr said...

@msft.guy: Thanks for the info ;-)

One more (little) question though: What does the script actually do? Does it force Lion to use the DHCAST128 protocol instead of DHX2 when connecting to the SMB? Because I looked into the sourcecode, but I can't figure out how it works exactly :-S.

And can it be "undone"?

Thanks in advance (again).

msft.guy said...

@wuotr: To uninstall, go to /System/Library/LaunchDaemons/ and move to
Then you can remove the dylib from /usr/local/lib/..
It works by intercepting backupd's calls to fsctl() and returning stuff that makes backupd think AFP features are supported by the volume.

wuotr said...

@msft.guy: Allright! Thanks man ;-)

Steve said...

Witty install script... Time Machine working on my 'unsupported' SMB network drive for the first time since Lion. Thanks!

Alexander said...

It didn't work for me either. Tried to do backup - got the message "The network backup disk does not support the required AFP features." Here is the link Thanks much for your help

msft.guy said...

@Alexander: reboot, try to back up again, then start Console, select 'All Messages', type 'backup' into the Filter field, select all and post that too.

Alexander said...

Thanks for suggestions. After reboot and attempt to backup same message "The network backup disk does not support the required AFP features.

here is the Console "backup" results link

msft.guy said...

@Alexander: fascinating.. looks like the dylib isn't getting loaded.

Copy following commands to Textedit/Terminal (don't type them manually if possible) to preserve line breaks and prevent typos

Try those commands (and pastie the output):
cat /System/Library/LaunchDaemons/| grep -2 DYLD
cat /System/Library/LaunchDaemons/| grep -1 Program
DYLD_INSERT_LIBRARIES=/usr/local/lib/libbackupd_anyfs.dylib /System/Library/CoreServices/backupd

Press 'Clear display' in Console, execute this command:
sudo bash -c "launchctl unload /System/Library/LaunchDaemons/; launchctl load /System/Library/LaunchDaemons/; launchctl start"
and copy the stuff that gets logged in Console.

Alexander said...

here is link to first set of commands


msft.guy said...

@Alexander: Install didn't modify the files it was supposed to modify - make sure you're an admin etc.
sudo cp /Users/Callum/Downloads/backupd_anyafp/ /System/Library/LaunchDaemons/

I can't figure out why things like 'sudo cp file dest' don't work on your machine, so you'll have to figure this out for yourself, sorry ;/

Alexander said...

Well, I followed your last suggestion, re-installed. Now, when I start TM it is sitting forever on "looking for backup disk". Sparsebundle is available and can be mounted manually, but that doesn't help... Any ideas? Thanks much.

msft.guy said...

@Alexander: Well, now it seems backupd crashes because you've changed the plist but didn't install the dylib.
Try these now:

sudo mkdir -p /usr/local/lib/
sudo cp ~/Downloads/backupd_anyafp/libbackupd_anyfs.dylib /usr/local/lib/

Alexander said...

Thank you SOOOO MUCH!!!! Backup started and going, probably will take some time... It's backing up to Buffalo LS-WTGL/R1-V3.

Anonymous said...

on my iMac with 10.7.2 the directory /usr/local/lib does not exist! instead there is the directory /usr/lib

echo puts out to miss a few nuts and bolts ;-)
So what is missing?

msft.guy said...

@54fce6ca-51be-11e1-b694-000bcdcb5194: "nuts and bolts" error just means install script can't find other files from the zip; they all should be in the same directory after extraction. Care to post the verbose log? (run 'bash -x ~/Downloads/backupd_anyafp/')

Anonymous said...

thank you
I had find it out on myself also ;-) i have to fill in the base directory manually and then "run" the script command per command.
And its works with my Medion Life NAS ;-)
Thank you much.

littlegti said...

Thank you so much for this. Just upgraded to Lion after testing everything else but TM. Not sure what I was thinking.

Anonymous said...

Use this to create sparse bundle on unsupported drive:

Currently have 150 gb tm backup on a usb drive attached to a linksys wrt610n! Thanks!

Anonymous said...
This comment has been removed by a blog administrator.
Anonymous said...

Yeah, sooo f*cking great, even in 10.8! Thanks!

Papa Fink said...

Thanks for this, it is great. However, my Mac drive crashed and now have to restore from my smb backup on Win machine. How do I do it? Can't figure it out for the life of me.

snekiam said...
This comment has been removed by the author.
snekiam said...

Can somebody help me with this error message?

bash -x /Users/MYUSERNAME/Downloads/backupd_anyafp/
++ dirname /Users/MYUSERNAME/Downloads/backupd_anyafp/'
usage: dirname path
+ check_my_stuff
+ test -f /libbackupd_anyfs.dylib -a -f /
+ echo 'Seem to be missing a few nuts and bolts, ABORT, ABORT!!'
Seem to be missing a few nuts and bolts, ABORT, ABORT!!
+ exit 9001

Thank You!

shound said...

great solution!!! finally lacie network work with TM!
thk a lot
(lion 10.7)


wilcodis said...

Hey msft.guy, great script. It's just that TM fails to create the sparsebundle. When it first starts, I can see it creates a .tmp.sparsebundle but then it fails with error 45. See Any thoughts? Thanks!

Chris McGrew said...


I am having the same issues it not letting me back up due to the error of the disk not being afp. I have ran the your script and i also did the manual move of the files in your zip files to the locations you specified. and I am still getting the error. I have my NFS server mounted under the NFS share. any help will be most appreciated.

Chris McGrew said...


Thank you for the great script I got it to work after I manually created the sparsbundle using the hdiutil command and now it is working great.


osxwouteer said...

I still get the message saying the drive doesn't support the new afs encryption. is there anything I could do other than buying a time machine drive?

Deron said...

It worked very well for me for about 2 weeks, but then the 'integrity check' by Time Machine failed. I had to start over. It's working fine again, but now I'm not so sure I can trust this solution. Apple should make this easier. I don't want to plug in a USB drive to my laptop.

Shawn E. said...

Looks like another step for Mountain Lion is needed to make it work. The file updates. (, but Time Machine still won't see the network drive using SMB.

shound said...

your process was really great to use lacie with lion! just yesterday I upgrade to mountain lion...TM didn'tsee the smb NAS, so I repeat the procedure again, now it see the lacie but say me that the file alreadu in use!
what can I do?
thank so much for help

Liza Jenifer said...

I found this article very helpful, iPhone hacking is major issue now a day, I've got it to backup, done a 58GB backup, and some others after it, can't seem to enter Time Machine. more that there is an indexing-the-backup phase which I don't recall to have seen under Snow Loepard. This take a lot of time. you have done good job. Now I'm using Watch Phone but I want to buy iPhone, That's is main reason to search about iPhone.

Halman Freud said...

Yes, I have found and error, the same mistake I have made in my version of whatsapp for pc. but nothing bad. Congrats!

Sarah Hall said...

My congratulates on your debut! I like this educational article!It's indeed very helpful for my research! But I'm still using term paper writing service when I need to get my academic work done in time!

Albert Smith said...

This is a good site that provides diverse programming information. I have find out new information about cracking especially for the iphone. I will bookmark this site so that I can visit it occasionally to read new programming and computational information. For more creative articles, feel free to hire our Confidential Case Study Writers.

Beth Whitehurst said...

Works very well and I also found out about appaddict repo which is basically an app that lets you download paid apps for free!

Neil Jakson said...

Participants will get the certificate provided 6 ECTS credits for passing the internship. Expenditures for meals, study trip to Soviet bunker in Ligatne and two social evenings will be covered organizers.
dissertation Writing Services

Jimmy loof said...

My life was falling apart, I was being cheated and abused, I had to know the truth and needed proof. i saw a recommendation about a private investigator by a friend. i contacted them and they took care of my needs. they hacked her iphone and gave me all information in her facebook,instagram, Whatsapp, twitter and email account. I got all I wanted as proof . I am glad i had a proven truth she was cheating . I recommend them if you need help