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.

Checking Folder Sizes in Recovery Mode

I have an iMac that won't boot due to hard drive problems, and I can't mount the disk on any other computer. I don't have a hard drive the iMac can boot off of (since it can't boot Snow Leopard). For some reason, the disk can be read when the iMac is in recovery mode.


I tried du -sh in Terminal on the iMac in recovery mode. There's no du command! I even tried opening Safari, trying to download a file, and showing the file size column in the download location selector, but it shows dashed lines instead of the size. It works for individual files, but I don't want to add every single file (millions) up.


Is there a different Terminal command I can try?

Posted on May 19, 2013 10:22 PM

Reply
8 replies

May 20, 2013 12:06 AM in response to ServerMac

When you say you can't mount the disk on any other computer, I assume you mean by using Target Disk Mode. If that is true, the drive may be too damaged for that to work, or there may be other problems with the iMac preventing that mode from working.


Since you say the disk can be read in recovery mode, first try using Disk Utility to repair it, running it as you would Terminal or Safari. If that works, try using TDM again. If that works, the most important thing is to copy any document files you don't already have backed up from the iMac drive to another drive.


If none of this works, the drive will have to be replaced, so unless you are confident that you can open the iMac & remove it yourself, you will need to have Apple or another repair shop do that. Once the drive is removed, you may be able to access its contents using an inexpensive adaptor like this one.

May 20, 2013 6:43 AM in response to R C-R

Yeah, I meant by Target Disk Mode. The disk repair always fails (after 3 attempts, says the log) whenever I try. How the computer can read it in recovery mode is a mystery to me. I think it's in some read-only limited access mode when the recovery OS can read it because I can't download anything from Safari onto it.


The iMac is under warranty, and an Apple support guy said I can bring it in. I backed it up while I could still mount the drive in Target Disk Mode, and I want to make sure that it backed everything up. This is the second hard drive in a year that has failed on it, and the first one was already showing signs of failure when it was purchased! The computer is set to sleep and put its hard drive to sleep normally, and it just sits on a desk...

May 20, 2013 6:46 AM in response to Topher Kessler

I'm hoping it won't come to that this time or if I need to do it in the future. I'll try it, but that might not even work since the disk is not mountable on my other machine when the iMac is in Target Disk Mode.


Is there some program I can download onto a flash drive and run in Terminal that will do this? Apps won't launch, but some simple GUI-less command should.

May 20, 2013 7:21 AM in response to ServerMac

You ought to be able to access CLI tools from another boot volume in the Terminal, but will have to target them by their full path. For instance, to run the command "ls" you can simply do so because the Terminal points to the hidden /bin directory on your boot drive that contains this tool (the boot drive being your Recovery HD volume or whatever one is currently active). If in addition you have another OS X boot drive available, then you can run the "ls" command from there with its full path, such as the following:


/Volumes/DRIVENAME/bin/ls


If DRIVENAME has a space in it, then you can precede the space with a back-slash (e.g. Macintosh\ HD) or can use quotes around it (e.g., "Macintosh HD").


In this manner, you can access the "du" program on another OS X installation and use it via the Terminal in the Recovery drive.

May 20, 2013 1:49 PM in response to ServerMac

If it is under warranty & you have backed up everything you can then taking it in to Apple is definitely the next thing to do.


BTW, I'm not sure what you mean about the first drive already showing signs of failure when you bought the iMac but you should make sure the Apple techs know about that -- there may be something besides the HD itself that is causing the failures.

May 22, 2013 7:17 PM in response to Topher Kessler

I don't know why I didn't think of this. Anyway, I installed the OS onto a different volume. I managed to force-mount the drive in a read-only mode or something, which worked.

Topher Kessler wrote:


You ought to be able to access CLI tools from another boot volume in the Terminal, but will have to target them by their full path. For instance, to run the command "ls" you can simply do so because the Terminal points to the hidden /bin directory on your boot drive that contains this tool (the boot drive being your Recovery HD volume or whatever one is currently active). If in addition you have another OS X boot drive available, then you can run the "ls" command from there with its full path, such as the following:


/Volumes/DRIVENAME/bin/ls


If DRIVENAME has a space in it, then you can precede the space with a back-slash (e.g. Macintosh\ HD) or can use quotes around it (e.g., "Macintosh HD").


In this manner, you can access the "du" program on another OS X installation and use it via the Terminal in the Recovery drive.

Checking Folder Sizes in Recovery Mode

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