Apple Event: May 7th at 7 am PT

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

How can I start the Apple Hardware Test when holding D doesn't work and I don't have the installation disc?

How can I start the Apple Hardware Test when holding D doesn't work and I don't have the installation disc?


  1. The directions say, "Press and hold the D key before the gray startup screen appears." This does not work.
  2. The "Apple Hardware Test Read Me.rtf" file says, "If your computer does not restart to Apple Hardware Test: Restart your computer with the DVD containing Apple Hardware Test." I do not have such a DVD, and my installation disc -- assuming it is with the packaging from when I bought this laptop -- is about 11,000 km away.

I am preparing to send in my August 2010 Macbook Pro to be refurbished, because it is randomly ceasing to function (e.g. randomly taking minutes to complete a given task) but I was hoping to diagnose and solve any problems myself before it came to that. Apple Support recommends this diagnostic test as a first step, and so I am trying to do it. Please help me.

MacBook Pro, OS X Yosemite (10.10.1), 2.4GHzIntelCore2Duo;4GB 1067MHzDDR3

Posted on Jan 22, 2015 6:07 PM

Reply
37 replies

Jan 22, 2015 11:04 PM in response to dot.com

I have downloaded the indicated file for my machine, but cannot copy its hidden files into /System/Library/CoreServices/.diagnostics: It is asking me if I want to overwrite CoreServices (using the Finder application), and saying the folders are identical (in terminal):

$ cp -n CoreServices/ ../../System/Library/CoreServices/

cp: ../../System/Library/CoreServices and CoreServices/ are identical (not copied).


$ cp -Rn CoreServices/ ../../System/Library/CoreServices/

cp: ../../System/Library/CoreServices and CoreServices/ are identical (not copied).


$ cp -Rn CoreServices/. ../../System/Library/CoreServices/

cp: ../../System/Library/CoreServices/. and CoreServices/. are identical (not copied).

Is my attempt to copy the files from the downloaded CoreServices folder into my computer's 'actual' CoreServices folder incorrect? How do I proceed? Is there really no simple way to enable 'Show Hidden Files and Folders' like in Windows?


Replacing or overwriting the folder while trying to copy seems unacceptable, since it implies all the other files will be erased in order to copy these, and I don't know how to copy the hidden files into this hidden directory. Hence I cannot proceed.

Jan 23, 2015 2:36 PM in response to ethereality

These are the commands I would use if it were my system:


Assume you have downloaded the correct hardware test image -- you've never told us the exact model of MacBook you have so are you positive you have the correct one? Once the test image is mounted in /Volumes/AHTCTwo (this name might be different depending on which AHT image you downloaded) -- just double-click on the "dmg" file you downloaded to mount it, then do the following in a terminal window:


cd /Volumes/AHTCTwo/System/Library/CoreServices

sudo mkdir /System/Library/CoreServices/.diagnostics <== only if the .diagnostics folder does not exist

sudo ditto .diagnostics /System/Library/CoreServices/.diagnostics

cd /System/Library/CoreServices/.diagnostics

sudo xattr -dr com.apple.quarantine CommonAHTResources/

sudo xattr -dr com.apple.quarantine Mac-F22586C8/

sudo xattr -d com.apple.quarantine diags.efi


All the "sudo" commands may prompt for your admin password (only do this when you've logged into an "admin" type account).

The last 3 "sudo" commands remove the com.apple.quarantine attributes recursively (if they don't have that extended attribute you don't need to do them) that get put on the files and folders during the copy - doesn't seem to be a way to have this not happen as I tried a couple of different things to copy the folders and file. Also the names of the folders may be different for the version of the AHT image you downloaded for your system - change the names accordingly. There was one "diags.efi" file and two folders in the image I downloaded.


There was also a "Apple Hardware Test Read Me.app" program in the /Volumes/AHTCTwo folder - would guess that all of the AHT download images have them - so run it and it opens up TextEdit and it explains a lot of what will happen. Suggest you read it before running the hardware test (which you do by holding down the "d" key during a power-on or reboot).


If you have any questions -- ASK FIRST.


Good luck

Jan 25, 2015 4:24 PM in response to Drew Reece

Where are you getting these copy instructions from?


dot's thread links to https://github.com/upekkha/AppleHardwareTest which says,

Download the AHT for your computer model and use the contents to restore the /System/Library/CoreServices/.diagnostics folder,

so I was simply trying to copy the contents from the downloaded folder into the correct location.

Jan 25, 2015 4:44 PM in response to dot.com

dot.com wrote:


you've never told us the exact model of MacBook you have so are you positive you have the correct one?

I'm sure I followed github's directions. Quoting the terminal command and output:

$ sysctl hw.model | awk '{ print $2 }'

MacBookPro7,1


There is only one entry matching 'MacBookPro7' on that webpage, "MacBookPro7,1 Mac-F222BEC8", so that is what I downloaded. It mounts as AHTCOne, but I copied its contents to my desktop before trying to copy its contents to the CoreServices folder.

dot.com wrote:


sudo mkdir /System/Library/CoreServices/.diagnostics <== only if the .diagnostics folder does not exist

Doesn't my previously quoted error message from the terminal imply this folder does already exist, and with all the same contents that I downloaded? "[source folder] and [destination folder] are identical", it said when I tried copying earlier. (Perhaps it refused to copy only because the folder names were the same, and it overwrites rather than merges -- i.e. I should have tried using this 'ditto' command instead? I read the man page before trying the command, so I had included the -n precisely to stop it from overwriting other files...)


Moreover, how can I view the hidden folders, such as whether .diagnostics exists?! I cannot find a 'show hidden folders' command in the Finder application!


I had tried earlier to see whether the .diagnostics folder were present: Checking the folder contents with 'ls' from within my Desktop:

$ ls ../../System/Library/CoreServices/

Volume Name Icon

I don't really know what this implies, but ls is supposed to "list directory contents". It's surely wrong, because when I navigate to the same folder within Finder there are many files, e.g. "Dock.app", "DumpPanic", "Encodings" folder, Finder.app, loads of things I don't want to alter.


dot.com wrote:


sudo xattr -dr com.apple.quarantine CommonAHTResources/

sudo xattr -dr com.apple.quarantine Mac-F22586C8/

sudo xattr -d com.apple.quarantine diags.efi


[...]

The last 3 "sudo" commands remove the com.apple.quarantine attributes recursively (if they don't have that extended attribute you don't need to do them) that get put on the files and folders during the copy - doesn't seem to be a way to have this not happen as I tried a couple of different things to copy the folders and file. Also the names of the folders may be different for the version of the AHT image you downloaded for your system - change the names accordingly. There was one "diags.efi" file and two folders in the image I downloaded.

Are you saying I must run this command for every single file in the downloaded CoreServices folder?*


* How do I copy-paste the current path location from the Finder application?

Jan 25, 2015 5:34 PM in response to ethereality

ethereality wrote:

It mounts as AHTCOne, but I copied its contents to my desktop before trying to copy its contents to the CoreServices folder.

Don't do that, dot.com didn't tell you to do that, instructions break when you decide to do your own thing.


ethereality wrote:

Doesn't my previously quoted error message from the terminal imply this folder does already exist, and with all the same contents that I downloaded? "[source folder] and [destination folder] are identical", it said when I tried copying earlier. (Perhaps it refused to copy only because the folder names were the same, and it overwrites rather than merges -- i.e. I should have tried using this 'ditto' command instead? I read the man page before trying the command, so I had included the -n precisely to stop it from overwriting other files...)

Go back & re-read your earlier post. There is no '.diagnostics' in the path you used.

The -n option of copy saved your bacon.

If in doubt get the manual out… ("man commandname" in Terminal or google "mac manual commandname")

https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/ man1/cp.1.html


You were attempting to replace the ENTIRE CoreServices folder.

CoreServices is critical to allow booting, you can't afford to get this wrong.

Do you have a bootable backup?

Don't proceed any further without one.


ethereality wrote:

I had tried earlier to see whether the .diagnostics folder were present: Checking the folder contents with 'ls' from within my Desktop:

$ ls ../../System/Library/CoreServices/

Volume Name Icon

Again manuals help…

https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/ man1/ls.1.html


From ls manual

-a Include directory entries whose names begin with a dot (.).

-a means .diagnostics will be shown


-l (The lowercase letter ``ell''.) List in long format. (See below.) If the output is to a terminal, a total sum for all the file sizes is output on a line before the long listing.

-l gives more info


Put that together…

ls -la /System/Library/CoreServices/

…will list an installed .diagnostics folder if it exists.


You can show hidden files in Finder but I strongly recommend against it - it encourages to look in places where you really do not need to be.

ethereality wrote:


dot.com wrote:


sudo xattr -dr com.apple.quarantine CommonAHTResources/

sudo xattr -dr com.apple.quarantine Mac-F22586C8/

sudo xattr -d com.apple.quarantine diags.efi

Are you saying I must run this command for every single file in the downloaded CoreServices folder?*


* How do I copy-paste the current path location from the Finder application?


Do not run that on every item in CoreServices!!! dot.com is only removing attributes within the .diagnostics folder ONLY.


* Paths can be completed via drag & dropping folders in Terminal.

Please take more care to follow the instructions posted, this part of the OS will give you a bad day if you make typo's or mistakes.

Jan 25, 2015 6:15 PM in response to ethereality

You should pat yourself on the back for tackling this bit of command line stuff - most people don't learn to use the Terminal and command line stuff - it's a different kind of skill that comes in very handy sometimes - for example with this. Finder sometimes makes things easy and sometimes it makes them hard or even impossible.


I'm not trying to give you a hard time or anything, just want to be sure you've got the right version. We can't see what you're doing and can only go by what you say. If you leave out an important detail, need to verify that before recommending what you might want to try. Without knowing exactly which download you got I had to assume a folder name that might not be what you have. So understand what it's doing before you do it and make any appropriate changes since we aren't standing over your shoulder to help. If you don't understand ASK BEFORE, not after, cause by then it might be too late to help.


The commands I gave are what would do the trick I believe. The order is important, very important, so don't do part of them and and then do others and expect things to work (they might but they also might not). Or use different commands that are similar, but not equivalent. They are in a specific order for a reason. The "xattr" command uses the "-dr" argument - the "r" means recursive so you only do it on the top level folder (so you don't need to do the xattr command on dozens or hundreds or thousands of things) - the "d" means to remove the named attribute. Read the "xattr" man page (in a Terminal window do a "man xattr" (without the quotes)). Have fun - there are likely some things in there that would need more explanation - suggest learning about "man" pages if you want to do much with the Terminal command line). A handy thing to do is "man -k xxx" which shows all the commands that contain the string xxx - which is a good way to find the actual command sometimes (but not always).


If you don't want to follow my suggestions, that's fine. I'm just trying to help. By using the "-n" argument, you saved yourself. But the fact that you don't understand that files and folders starting with a "." are hidden from you (unless you use the "-a" arg with ls), you should read the man page for "ls" as well.


I would recommend you read the man pages for any commands you don't understand so you can learn what they are doing. After that and you still don't understand something please ask.

Mar 2, 2015 12:50 AM in response to dot.com

I've done as you described, after reading the commands' man pages to understand them. I will review the included Read Me.app as you suggest (why is this text file an application? in case the computer's installed text editor isn't working?) and try running the software from startup soon.


Here's the relevant parts of my Terminal, in case you wish to double-check me (or see what my downloaded filenames look like):

Last login: Mon Mar 2 15:59:52 on ttys001

[computer name]:~ [account name]$ pwd

/Users/[account name]

[...]

[computer name]:~ [account name]$ ls ../../System/Library/CoreServices/.diagnostics

ls: ../../System/Library/CoreServices/.diagnostics: No such file or directory

[computer name]:~ [account name]$ ls -a ../../System/Library/CoreServices/.diagnostics

ls: ../../System/Library/CoreServices/.diagnostics: No such file or directory

[computer name]:~ [account name]$ cd /Volumes/AHTCOne

[computer name]:AHTCOne [account name]$ cd /Volumes/AHTCOne/System/Library/CoreServices/

[computer name]:CoreServices [account name]$ ls .diagnostics

CommonAHTResources Mac-F222BEC8 diags.efi

[computer name]:CoreServices [account name]$ ls /System/Library/CoreServices/.diagnostics

ls: /System/Library/CoreServices/.diagnostics: No such file or directory

[computer name]:CoreServices [account name]$ man ls

[computer name]:CoreServices [account name]$ ls -a /System/Library/CoreServices/.diagnostics

ls: /System/Library/CoreServices/.diagnostics: No such file or directory

[computer name]:CoreServices [account name]$ sudo mkdir /System/Library/CoreServices/.diagnostics



WARNING: Improper use of the sudo command could lead to data loss

or the deletion of important system files. Please double-check your

typing when using sudo. Type "man sudo" for more information.



To proceed, enter your password, or type Ctrl-C to abort.



Password:

[computer name]:CoreServices [account name]$ man ditto

[computer name]:CoreServices [account name]$ pwd

/Volumes/AHTCOne/System/Library/CoreServices

[computer name]:CoreServices [account name]$ ls -a

. ._Volume Name Icon Volume Name Icon

.. .diagnostics

[computer name]:CoreServices [account name]$ sudo ditto .diagnostics /System/Library/CoreServices/.diagnostics

Password:

[computer name]:CoreServices [account name]$ cd /System/Library/CoreServices/.diagnostics

[computer name]:.diagnostics [account name]$ man xattr

[computer name]:.diagnostics [account name]$ pwd

/System/Library/CoreServices/.diagnostics

[computer name]:.diagnostics [account name]$ ls -a

. CommonAHTResources diags.efi

.. Mac-F222BEC8

[computer name]:.diagnostics [account name]$ sudo xattr -dr com.apple.quarantine CommonAHTResources/

Password:

[computer name]:.diagnostics [account name]$ sudo xattr -dr com.apple.quarantine Mac-F222BEC8/

[computer name]:.diagnostics [account name]$ sudo xattr -d com.apple.quarantine diags.efi

xattr: diags.efi: No such xattr: com.apple.quarantine

[computer name]:.diagnostics [account name]$

Mar 2, 2015 5:59 PM in response to Drew Reece

I successfully ran the Apple Hardware Test. First the simple test, then the extended test. Both reported, "No trouble found."


Is it really okay that under Power (a section under one of the tabs) it says "Capacity: 98%"? Does that mean the battery has degraded only 2% after 4.5 years? But I'm using the Power Adapter, as it also mentioned ("Power source: Adapter"), so it's not clear to me that this capacity is referring to the battery.


The latest showed "Pass Number: 2, Total Time Testing: 59 mins 27 secs". I think this reflects being the second test I ran and includes the 3 min 49 sec of the first test.


I used "Version 3.3.1-3A192 / Copyright 2000-2010 Apple Inc. All Rights Reserved."


Thank you for your help in getting this test working. I am not sure how to proceed, however, because it takes my computer 2.5 minutes to boot up, the longest amount of time I can recall, and it periodically freezes when trying to open an application. It also took about two minutes to open Safari, LimeChat (IRC client) and Google Chrome after booting -- Google Chrome in particular seems to slow it down, though previously I had thought it was better than Safari ... The user 'Branes' in freenode's mac or apple channel recommended I send it in to the Apple Store for cleaning and a fresh application of thermal paste, since it is five years old. He said that it was periodically freezing was to regulate the temperature to avoid overheating, and was consequently a warning sign to repair the cooling system (i.e. thermal paste + cleaning). Do you agree with this recommendation? How likely is the Tokyo Apple Store to erase the hard drive's contents? I have software on it that I will not be able to reinstall, since I am in Japan and my software installation discs are thousands of miles away. Is there a way to backup software such that it can simply be copied rather than reinstalled if my laptop is returned with a fresh OS install? I have been backing up files in preparation of mailing it off, but first thought to clear 10% hard drive space* and run this test to try resolving the matter myself.


I can of course create a new thread for this new discussion, which I suppose is proper forum etiquette.



* currently at 16.03 free of 249.2 GB, i.e. 6% free hard drive space -- but I don't understand why I must keep 10% free, rather than a few GB free for swap memory. I'm actually not sure what's using up so much space ...

How can I start the Apple Hardware Test when holding D doesn't work and I don't have the installation disc?

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