An open community 
of Macintosh users,
for Macintosh users.

FineTunedMac Dashboard widget now available! Download Here

Previous Thread
Next Thread
Print Thread
promising new HDD salvage technique discover today
#19330 11/23/11 06:30 PM
Joined: Aug 2009
OP Offline

Joined: Aug 2009
I've seen maybe two dozen of these. Boots to gear or somewhere abouts there and hangs or shuts down. (this one was shutting down due to fsck fail safety) Try to boot off another hard drive and the boot volume won't mount. Run diskwarrior and it won't even scan due to a "hardware malfunction". OK, that's about it for options.

But I thought, hey, it boots a little, what can I do in single user mode? enough, it appears. attached another hard drive and booted into single user. mounted the internal drive read/write, used mount to manually attach the external drive, and was able to ditto the /Users folder to the other drive.

An interesting twist, this one wouldn't let me make a folder in /Volumes, or anywhere else for that matter, as a mount point for the second drive, but /home was there and available (and empty) so I used that as the mount point.
Unfortunately diskutil is not available in single user mode so I wasn't able to look at disk info on the bad drive. (is there a way to load diskarbitration framework by hand?) But at least I could "du -sh" to see how much data I was dealing with.


I work for the Department of Redundancy Department
Re: promising new HDD salvage technique discover today
Virtual1 #19331 11/23/11 08:43 PM
Joined: Sep 2009
Offline

Joined: Sep 2009
Originally Posted By: Virtual1
Unfortunately diskutil is not available in single user mode so I wasn't able to look at disk info on the bad drive. (is there a way to load diskarbitration framework by hand?)


download AppleJack and take a gander at its applejack.sh file

Re: promising new HDD salvage technique discover today
Hal Itosis #19332 11/23/11 08:54 PM
Joined: Aug 2009
OP Offline

Joined: Aug 2009
well you don't see shell scripts that big very often, unless you're browsing my flash drive anyway wink

Quote:
[1] repair disks
[2] repair permissions
[3] cleanup cache files
[4] validate preference files
[5] clean up virtual memory

Not a very big list of tools? nothing I can't do with fsck and plutil. (why would you even need #5 while booted into SUM?)

nothing there for loading frameworks that I see...?


I work for the Department of Redundancy Department
Re: promising new HDD salvage technique discover today
Virtual1 #19333 11/23/11 09:14 PM
Joined: Aug 2009
Likes: 15
Online

Joined: Aug 2009
Likes: 15
I've never understood why [5] clean up virtual memory is included in Applejack's functionality.

Doesn't /var/vm get cleaned up automatically when you restart from SUM?


The new Great Equalizer is the SEND button.

In Memory of Harv: Those who can make you believe absurdities can make you commit atrocities. ~Voltaire
Re: promising new HDD salvage technique discover today
artie505 #19334 11/23/11 09:50 PM
Joined: Aug 2009
OP Offline

Joined: Aug 2009
quite a lot gets cleared, on any boot, such as /tmp/

step 5 looks like a complete waste of time


I work for the Department of Redundancy Department
Re: promising new HDD salvage technique discover today
Virtual1 #19339 11/24/11 05:48 PM
Joined: Sep 2009
Offline

Joined: Sep 2009
Originally Posted By: Virtual1
nothing there for loading frameworks that I see...?

Then you didn't look hard enough...

...because i see over a dozen places where launchctl load is called.
[i.e., we don't load frameworks directly... rather, we ask launchd to run the plist that opens them.]

Pay close attention to the case statement...

case "$ANIMAL" in

...where 4 = tiger, 5 = leopard, 6 = snowy, and so on;
because each OS version has subtle differences.



EDIT: e.g., the essential bit for Snowy looks like this (starting at line 553):
Code:
for plist in com.apple.kuncd com.apple.KernelEventAgent \
	com.apple.distnoted com.apple.aslmanager com.apple.DirectoryServices \
	com.apple.DirectoryServicesLocal com.apple.coreservicesd \
	com.apple.diskmanagementd com.apple.securityd com.apple.diskarbitrationd \
	com.apple.fseventsd
do
	launchctl load /System/Library/LaunchDaemons/${plist}.plist > /dev/null 2>&1 &
	wait
done

...but there is much associated code which precedes and follow that excerpt.

Last edited by Hal Itosis; 11/24/11 06:03 PM.
Re: promising new HDD salvage technique discover today
artie505 #19340 11/24/11 06:09 PM
Joined: Sep 2009
Offline

Joined: Sep 2009
Originally Posted By: Virtual1
(why would you even need #5 while booted into SUM?)

Originally Posted By: artie505
I've never understood why [5] clean up virtual memory is included in Applejack's functionality.

Doesn't /var/vm get cleaned up automatically when you restart from SUM?

Nope... all swapfiles are still there (from the previous user's session), when we arrive in SU mode.

Not sure at which point the swapfiles get cleared... but i suppose if some Mac can't reach the login window, perhaps deleting /var/vm items might be either useful or desirable.

Re: promising new HDD salvage technique discover today
Virtual1 #19341 11/24/11 06:17 PM
Joined: Sep 2009
Offline

Joined: Sep 2009
Originally Posted By: Virtual1
Quote:
[1] repair disks
[2] repair permissions
[3] cleanup cache files
[4] validate preference files
[5] clean up virtual memory

Not a very big list of tools? nothing I can't do with fsck and plutil.

My, quite the critic... aren't we? smile

[3] would require more than fsck and plutil ...including knowledge of where all caches are located. (e.g., don't forget the /var/folders/* hierarchy).

And we are currently discussing the complexities involved with doing [2].

There is an optional RAM test module (installed separately).

But those functions are a fairly basic set which users who aren't Unix gurus can use to do stuff by simply selecting a number. [and of course: the point of doing those in SU mode is that the user is presumably unable to login to the GUI for some reason.]

Perhaps you'd care to author the Lion version of AppleJack though. wink
[or suggest some feature(s) for the author to add at least.]

Last edited by Hal Itosis; 11/24/11 06:38 PM.
Re: promising new HDD salvage technique discover today
Hal Itosis #19342 11/24/11 06:37 PM
Joined: Aug 2009
OP Offline

Joined: Aug 2009
Originally Posted By: Hal Itosis
My, quite the critic... aren't we? smile

[3] would require more than fsck and plutil (including knowledge of where all caches are located).

And we are currently discussing the complexities involved with doing [2].

There is an optional RAM test module (installed separately).

But those functions are a fairly basic set which users who aren't Unix gurus can use to do stuff by simply selecting a number. [and of course: the point of doing those in SU mode is that the user is presumably unable to login to the GUI for some reason.]

Perhaps you'd care to author the Lion version of AppleJack though. wink
[or suggest some feature(s) for the author to add at least.]


Yes I do seem to have missed the launchctl load commands, I was looking for a kext load. Lots of code to look through and I was short on time, ctrl-w was insufficient.

As for caches and permissions, it's been my experience that those are helpful only on extremely rare occasions. I may have had success with those two techniques on a total of two or three occasions each, in all my days.

It's also worth noting that a combo updater accomplishes almost exactly the same thing as a permissions repair, and can actually take less time to run. (it would not surprise me if it also cleared caches when it runs)


I work for the Department of Redundancy Department
Re: promising new HDD salvage technique discover today
Virtual1 #19343 11/24/11 06:46 PM
Joined: Sep 2009
Offline

Joined: Sep 2009
Originally Posted By: Virtual1
As for caches and permissions, it's been my experience that those are helpful only on extremely rare occasions. I may have had success with those two techniques on a total of two or three occasions each, in all my days.

The main purpose of AppleJack (as i recall) was to enable a user to EASILY (and properly and quickly) repair permissions when they could not login (for whatever reason), and were also unable to boot from a dvd (whether it wasn't handy or perhaps the optical drive was bummed out).

Okay?

[i've never suggested it was anything you needed... other than to learn how to code.]

As for the usefulness of cache cleaning, there are plenty of threads which attest to sluggish beach-balling Macs getting a speed boost after cleaning caches. [as a one-shot deal... not weekly as some users are wont to do.]


Originally Posted By: Virtual1
It's also worth noting that a combo updater accomplishes almost exactly the same thing as a permissions repair, and can actually take less time to run. (it would not surprise me if it also cleared caches when it runs)

If a user can't login to the GUI and doesn't have the dvd on the road with them... how do they do a combo update?


Last edited by Hal Itosis; 11/24/11 06:54 PM.
Re: promising new HDD salvage technique discover today
Hal Itosis #19344 11/24/11 06:49 PM
Joined: Aug 2009
OP Offline

Joined: Aug 2009
Originally Posted By: Hal Itosis
If a user can't login to the GUI and doesn't have the dvd on the road with them... how do they do a combo update?


Yep that is a good use for it. Tho unless they've preinstalled it, they're going to require internet access and another computer anyway, so the combo updater is an equally available option.

And if you're going to practice being prepared, a bootable flash drive, or service partition on your internal drive, is a much smarter way to go.


I work for the Department of Redundancy Department
Re: promising new HDD salvage technique discover today
Virtual1 #19345 11/24/11 06:56 PM
Joined: Sep 2009
Offline

Joined: Sep 2009
Originally Posted By: Virtual1
Tho unless they've preinstalled it, they're going to require internet access and another computer anyway, so the combo updater is an equally available option.

Pre-installed. That's a given, yes.

Originally Posted By: Virtual1
And if you're going to practice being prepared, a bootable flash drive, or service partition on your internal drive, is a much smarter way to go.

Again, don't forget to carry that flash. AppleJack (and your partition suggestion) are self contained... though both need "preinstalling". wink



Re: promising new HDD salvage technique discover today
Hal Itosis #19346 11/24/11 07:24 PM
Joined: Aug 2009
Likes: 15
Online

Joined: Aug 2009
Likes: 15
Originally Posted By: Hal Itosis
Originally Posted By: Virtual1
(why would you even need #5 while booted into SUM?)

Originally Posted By: artie505
I've never understood why [5] clean up virtual memory is included in Applejack's functionality.

Doesn't /var/vm get cleaned up automatically when you restart from SUM?

Nope... all swapfiles are still there (from the previous user's session), when we arrive in SU mode.

Not sure at which point the swapfiles get cleared... but i suppose if some Mac can't reach the login window, perhaps deleting /var/vm items might be either useful or desirable.

You misread my post...

Quote:
... when you restart from SUM? (Emphasis added)


at which point swap files are cleared, but you may have a point about being unable to reach the login window.

(Anybody know at precisely which point in the boot process swap files are cleared?)


The new Great Equalizer is the SEND button.

In Memory of Harv: Those who can make you believe absurdities can make you commit atrocities. ~Voltaire

Moderated by  alternaut, dkmarsh, joemikeb 

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.4
(Release build 20200307)
Responsive Width:

PHP: 7.4.33 Page Time: 0.032s Queries: 40 (0.024s) Memory: 0.6381 MB (Peak: 0.7484 MB) Data Comp: Zlib Server Time: 2024-03-28 13:07:43 UTC
Valid HTML 5 and Valid CSS