I have a MacBook Pro 2,2 which came with Tiger. Then I upgraded to Leopard, then Snow Leopard and most recently, to Lion. For each of these upgrades I did a clean install, because I’d heard bad things about Ruby, CPAN, fink, MySQL and stuff getting munged. Effectively, I would wipe the old system and copy (not “Restore”) my old files.
The Situation (what didn’t work)
It seems like my GPU may be on its way out, so I wanted to run Apple’s Hardware Test (AHT). I don’t have my original system disks nearby, from which AHT could be run rather easily. Booting holding ‘D’ didn’t work, neither did F2 or Option+’D’, as some forums claimed. So I poked around and found that my /System/Library/CoreSerives/ didn’t have a .diagnostics directory (where AHT reportedly should be). This is probably because of all my clean OS installs. I found a place to download it (see below), but copying AHT into that .diagnostics directory still didn’t allow me to boot into AHT using the normal steps. I think this is because having cleanly installed Lion, it expects to use the new fancy internet-AHT like the MacBook Airs -- but the system ROM doesn’t trap Option+’D’ at start-up. So I still couldn’t get AHT to run. Here’s what I did to get it to run / boot from a USB stick.
The Method (what did work)
1) Download the AHT for your computer (see downloads below for specific models).
1b) My copy had me convert the downloaded .dmg from some “old” type using Disk Utility. (Just open the .dmg in Disk Utility and “Convert” to a new target, then mount the target.)
2) Mount and completely wipe a USB stick.
3) From the AHT image, copy /System to the root folder of your USB stick:
cd /Volumes/USB_STICK/ && cp -r ~/AHT_ARCHIVE/System .
4) Now, from the USB drive, copy the /System/Library/CoreServices/.diagnostics/diags.efi to the root directory:
cd /Volumes/USB_STICK/ && cp ./System/Library/CoreServices/.diagnostics/diags.efi .
4) Shutdown all applications.
5) “bless” the USB drive in mount-mode, with the EFI file, and immediately reboot:
cd /Volumes/USB_STICK/ && sudo bless --mount /Volumes/USB_STICK --setBoot --file diags.efi && sudo reboot
6) You should now be booting into AHT -- don’t hold down any keys.
7) Run the tests, and yank the USB key after AHT reboots you.
You can download the AHT package for your computer using this URL:
http://download.info.apple.com/Apple_Hardware_Test/018-[MODEL NUMBER]-A.dmg
where [MODEL NUMBER] is the four-number ID below:
3282 for Mac-F4208AC8, Mac-F42289C8 Xserve1,1 and Xserve2,1
3259 for Mac-F42C8CC8 MacBookAir1,1
3273 for Mac-F42C88C8 MacPro3,1
3254 for F4238CC8, F42386C8, F4218EC8, F4208EAA, F4208DC8, F4208DA9, F4238BC8, F42388C8 and F22788C8 inclusively.
or more specifically:
3085 for Mac-F22788C8 MacBook3,1
2886 for Mac-F4208EAA Macmini2,1
2845 for Mac-F42386C8 iMac7,1
2833 for Mac-F42388C8 MacBookPro3,1
2770 for Mac-F4238BC8 MacBookPro3,1
2769 for Mac-F4208DC8 MacPro1,1
2667 for Mac-F4208DA9 MacPro2,1
2766 for Mac-F4208CAA MacBook2,1
2592 for Mac-F42189C8 MacBookPro2,1
2591 for Mac-F42187C8 MacBookPro2,2
2590 for Mac-F4208CA9 MacBook2,1
2579 for Mac-F4218FC8 iMac6,1
2535 for Mac-F4218EC8 iMac5,2
2534 for Mac-F4228EC8 iMac5,1
2533 for Mac-F42786A9 iMac5,1
And these are there, but old toidentify: 2418, 2405, 2398, 2393, 2392, 2342, 2216, 2215, 2158, 2120, 2079, 2056, 1880, 1879, 1680 and 1594.
(Thanks to mkincaid at the macnn forum for that post.)
Enjoy!
Awesome post!
ReplyDeleteWhat about the newest models missing from the list?
I need the AHT for a Mac Pro (Mid 2010).
I sorted it out the system model name, it should be "MacPro5,1 (Mac-F221BEC8)", but I don't know how to deduce the ID to use in the download URL. Any ideas?
Yeah, those links are a bit of back-door, I think, for Apple Support and I can't find a real method to the numbering. So unfortunately, I have no idea where you can find the right version of AHT for an MacPro5,1. Apple might have the newer versions of AHT available publicly on their support site though.
ReplyDeleteBest of luck.
I tried every other way to boot into AHT and this one was my last hope, but it just didn't work for me. It wont boot my thumbdrive even if I press D or C or Opt, and all there is in the usb stick is the System folder and the diags.efi from the AppleHardwareTest image I downloaded from the list in your post, corresponding to my iMac7,1.
ReplyDeleteIs there another way to force it to boot from the usb stick? It does boot OSX Install images restored to an extermal hdd but I cant find or boot AHT from those copies either.
Well, I think if you've followed the steps above, and have the correct version of AHT for your Mac, then it should work. The `bless` command is what forces the USB to be bootable (I think.)
DeleteAww, hell, if I had this a month ago. I only check your blog every six months or so. xD
ReplyDeleteOk, any suggestions if the CD/DVD drive is acting up? (Can't load anything. Hence the quest for AHT.) Anyway to push the AHT from the drive on my Mac Book Pro?
ReplyDeleteSo if holding `D` or `[option]+D` during boot doesn't work, try the steps above. But if you have a newer lappie, you can probably just download the regular AHT from apple, not the hidden ones I refer to above, and follow similar steps.
DeleteI tried this with my macbook 2,1 with no luck - just seemed to sit there and take forever to load the users.. hrmmm .. I think i better try and reinstall everything :p
ReplyDeleteSounds like it's trying to run AHT and failing. It might be the wrong version for your macbook, or maybe this method doesn't work for older machines... Hope this didn't waste too much of your time -- best of luck!
Deletelinks for some newer models here:
ReplyDeletehttp://macforum.ro/topic/1194-apple-hardware-test/
links for some newer models here:
ReplyDeletehttp://macforum.ro/topic/1194-apple-hardware-test/
2215 Worked on an iMac G5 20", A1076
ReplyDeleteHow do I find the right Model Number for my Macbook Pro?
ReplyDeleteI think this is what you're looking for: http://support.apple.com/kb/HT4132
DeleteTHANK YOU! After hours and hours of struggle, I found this post and it set me free. Why Apple feels the need to hide all this from us is beyond me. It's totally crazy.
ReplyDeleteAnyway, THANK YOU!
Step #4 is missing something in the line command, but I figured it out.
And thank goodness someone from Romania shared their link to the page with a more exhaustive list of EFI files to download. That was the last missing piece, once I had these beautiful instructions.
HUZZAH, people, HUZZAH!
Glad you got it work -- and hopefully AHT didn't find anything terribly wrong...
DeleteI will post this here so it's easier to find for others. You can find AHTs compatible with multiple Macs on this Romanian site:
ReplyDeletehttp://macforum.ro/files/category/11-apple-hardware-test/
Unfortunately you have to register to download them, but you'll be able to figure it out.
worked for me on a mac pro 2,1
ReplyDeletethanks
Hey, Great Post! glad to see its working for some people!
ReplyDeleteI'm Having some issues, any suggestions?
I follow all directions to a T in terminal and am working with a freshly wiped USB stick, it does make it to a black screen with text flashing after the sudo reboot.
Text Flashing Reads:
"""
Can not open the file \diags.env Status: -2147483634, 0x8000000e
Cab not open the file \Runtime_Files\Common\IndyErrors.h Status: -2147483634, 0x8000000e
Error 0x8000000e loading /Runtime_Files/Common/IndyErrors.h
Error: 0x8000000e, Couldn't load /Runtime_Files/EFI/Drivers/TestSupport.efi
"""
Any help or suggestions would be much appreciated, thanks for your work again!!
Machine Type
iMac 4,1
Serial W8603XBYU2N
Tried files from Romanian site for iMac 4,1 and tried the same files in the same location on my original install media (Optical drive is shot in the iMac, Apple tells me I would need an 'Apple Approved" Firewire Drive in this case)
Thanks again!
Sorry for the delay -- been travelling a bit.
DeleteIt looks like you're doing the USB stuff correctly, but that AHT thinks there should be some files, which there aren't. Are you sure you have the correct version of AHT? Also, you might download Onyx (http://www.macupdate.com/app/mac/11582/onyx) and run the "fix permissions" utility.
Great Informations!
ReplyDeleteJust tell me: How can I find the MODEL NUMBER for my MacBookPro6,2?
Tanks a lot!
Seb
These instructions, I think, may only work for earlier models. But you can try this place: http://www.everymac.com/systems/by_capability/mac-specs-by-machine-model-machine-id.html
DeleteI've got a MacBookAir 3,2
ReplyDeletehttp://www.everymac.com/systems/apple/macbook-air/specs/macbook-air-core-2-duo-2.13-13-late-2010-specs.html
I was able to download a file by filling in 2392 in your URL. But the resulting software was dated 2006. My MacBook Air was released in 2010 so I doubt I got the right one.
Any idea what the right link is to download AHT for my machine?
Thanks!
So I /think/ the Airs use the internet-based AHT, nothing on disk or media. I don't think any of the links above will help. I think you should be able to boot up holding 'D'. But short of that, I really couldn't tell you.
DeleteBest of luck!
Thanks for that response. My MacBook Air did come with a USB drive - I can't find it though. I think you're right about later models though.
DeleteI was working with a 2nd level AppleCare tech the other day. She advised me to run the AHT. It won't work by holding down D because I'm on ML and there is no partition on my disk now with the test.
hi
ReplyDeletei did all the steps as you said. after "bless" rebooting again to osX and not in aht. check the link pls with my steps
http://img10.imageshack.us/img10/5742/screenshot20130129at923.jpg
tnx :)
Does your USB stick have a light that might light up when you're booting? If it does, and it doesn't try to boot from the stick, it's something wrong with step 5. If it's trying to boot from the stick, and fail, then I think that means the version of AHT you downloaded isn't compatible with your machine. Maybe check the mdoel? Or, for newer modes you might apple's mainline support sites.
DeleteSorry I'm not more help...
Hi, you made my day today (feb, 11th 2013). I was near to hopelessness to find HW Test ... but your article rocked!
ReplyDeleteI couldn't boot from another usb pen drive with the Mountain Lion InstallESD.dmg restored onto it, BootManager didn't see it. But your procedure made MBP boot from the drive and the HW Test program started.
My MacBook Pro Intel Core2Duo 2,2MHz (model A1226) and used the 2770 image (Apple HW Test Version 3A121), which was accepted by my MBP - test is now running!
Thanks a lot!!!
Happy to help! Hopefully the tests don't find anything scary...
DeleteYay ... NO TROUBLE FOUND (after 1h 20min -extended- testing).
Delete:-D
Best regards and Thanks again!
Hi Rivenx5
ReplyDeleteYour really going to have to help me out here
Where or how do you find the code identifier begging with F?
What or where am i looking for this?
I can find apple model no which is a1226 i have looked through system profiler & i have also used the link you posted earlier in the comments but i cannot find any reference beginning with F
Please help
Thank you
Hey, so I'd try poking around here:
Deletehttp://macforum.ro/topic/1194-apple-hardware-test/
or here:
http://www.everymac.com/systems/apple/macbook-air/specs/macbook-air-core-2-duo-2.13-13-late-2010-specs.html
They should at least list your model number. Keep in mind you'll only need to do this nonsense if you have an older mac. The newer ones should have AHTs on apple's support site.
best of luck!
Hi Thank you for the quick reply rivenx5
ReplyDeleteI do know how to get the model no ETC how are you getting the code beginning with F?
I'm not searching specifically for my personal Mac i have had a couple of times where i could have done with running a diagnostic on Macs i have been working on & the original installation disks were not available the only answer i get from Apple is to buy the disks again
Something like this would be a godsend if i knew how to find the the Mac-f**** for the mac i'm working on
Cheers
Sorry to say, but I really don't know... If you know your open identifier, like Macbook 2,1, MBP3,2, etc... you can probably look around for an AHT version with that. But I'm oddly not sure how to find the Fxxxxxx identifier. Sorry I'm not more help!
DeleteOne way of getting the Fxxxxxx identifier is to run geekbench (if the mac is able to boot in the OS), that number is the motherboard model in the geekbench report.
DeleteHad to use this method as there are 3 different AHT's listed for an iMac7,1
Nice Jeff, thanks!
DeleteHere's a link: http://www.primatelabs.com/geekbench/download/mac/
Thanks! This worked perfectly. Had to do a lot of Googlimg to find the link for A1278/MacBook5,1 though:
ReplyDeletehttp://download.info.apple.com/Apple_Hardware_Test/022-4048-A.dmg
https://plus.google.com/app/basic/stream/z12uinrhntu5srbmx23gydlhbnzaedh2g
Awesome -- glad it worked. And thanks for the links!
DeleteI have a iomega external hard drive and I recently discovered that it's corrupted. There is some data on there which is important and the "mac disk utility" can't repair it. I need a free software (not limiting demos) that can do either of the following: Transfer files from my external hard drive to my mac repairs the hard drive without erasing the data
ReplyDeleteHey Rajesh -- sorry to say, but I haven't the least bit of experience with this. The techs I used to work with used a Knoppix repair disk on everything (even macs) to clone the drive to somewhere they could fix it. Still know what that really means, but this site looks promising:
ReplyDeletehttp://www.brighthub.com/computing/linux/articles/64736.aspx
The good thing about sticking with Knoppix or something linux is that it has lots of tools which are free and powerful. The bad is that if you're not an expert with unix-like stuff, it might be complicated.
Also, did you /try/ running AHT? Not sure if it will do much, but you might try it with your external drive plugged in and see if it finds / fixes anything. Sorry I'm not of more help -- and good luck!
Is it just a case of dump your command lines shown above into Terminal because my flash drive doesn't appear to have anything on it and i get "Can't statfs diags.efi". Any help greatly appreciated.
ReplyDeleteHey Jason -
DeleteIn step 4, try `ls ./System/Library/CoreServices/.diagnostics/` and look for diags.efi. If it's there, something is seriously horked up (maybe a full drive or bad read/write permissions?), and if it's not, then either a) you've got a bad version of AHT or b) you've the right one, but this method doesn't work for your model / version.
Mac Pro 1,1 upgraded to 2,1, what is going to be the correct dog file ?
ReplyDeleteI downloaded both the 1,1 - 2769 & the 2,2 - 2667 files. You open the files & it shows /System/Library/CoreServices. [.diagnostics is not there ]
Hi Professor -- so the .diagnostics file is a hidden file, meaning it won't show up in Finder, but in a terminal you can type `ls -al` which should show it if it's there. If it's not, then the older models were doing something different than this... In step 4, do you get an error?
DeleteAlso, the model (1,1 or 2,1 etc...) is your hardware's model, and not upgradable. You should definitely download the AHT version for your hardware.
There also might be a readme file that came with the AHT you downloaded -- might have more instructions.