Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Save kernel panic logs between multiple reboots System
While this may apply only to a very few people in rare circumstances, it is quite useful at those times. When a kernel panic occurs, the log information is stored in NVRAM for a reboot cycle, which means that if the information isn't saved after the first reboot, it's gone. For those like me who prefer to boot single-user to fsck manually after issues, and use reboot afteward, the panic information is lost. The way to save it is as follows:
  1. After fsck finishes with filesystem OK, mount / as writable:
     % /sbin/mount -uw /
  2. Run panicdump to save the information:
     % /usr/libexec/panicdump
  3. Finally, sync and reboot:
     % sync;sync;sync;reboot
This should get the panic information into the proper place (/Library/Logs/panic.log) before the information is lost.
  • Currently 3.25 / 5
  You rated: 3 / 5 (4 votes cast)

Save kernel panic logs between multiple reboots | 4 comments | Create New Account
Click here to return to the 'Save kernel panic logs between multiple reboots' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Save kernel panic logs between multiple reboots
Authored by: mks on Feb 16, '04 01:08:08PM

Why the three sync commands? Shouldn't one be enough?

[ Reply to This | # ]
Save kernel panic logs between multiple reboots
Authored by: the1truestripes on Feb 16, '04 01:45:10PM

There are three theories about the multiple sync thing.

  1. In extremely old versions of Unix (like V7 Unix, early 1970s) reboot wouldn't sync the disk blocks, and the first sync would return after asking for the blocks to be written, but the second sync would wait for the first set of blocks to finish being written. NOTE: for more then a decade a normal reboot causes the dirty disk blocks to be written, so any sync for this reason is unneeded.
  2. Doing sync RETURN, sync RETURN, sync RETURN, reboot RETURN gives the sync time to finish even if the second sync doesn't cause the first to finish (I have to admit, I read the V7 source code, but I don't remember which way it works)
  3. Doing sync RETURN, sync RETURN, sync RETURN, reboot RETURN gives the person doing the reboot time to realize "oh dear, that's the wrong box!" or "oh my, I forgot to schedule the downtime!" or whatever other reason there might be to not reboot.

I don't see any real reason to do "sync;sync;sync;reboot" rather then just the reboot. I don't see any way it'll hurt though.

[ Reply to This | # ]

sync not necessary on Mac OS X
Authored by: daveschroeder on Feb 16, '04 08:19:55PM
All actions performed by sync are performed by reboot, halt, and shutdown on Mac OS X, and sync - even a single one - is not necessary.

Doing sync two (or three, as in this example) times is not necessary. The first time does the exact same thing as all subsequent ones do. The reason it was done multiple times was:

1. Sometimes the first sync alone wouldn't complete by the time the system was halted. Doing sync one or two more times ensured that the initial (only meaningful) sync completed. Doing one sync and just waiting a bit would have been completely sufficient.

2. Completely aside from the purpose of sync itself, to give the person rebooting or downing the box a chance to think "Hey, is rebooting this thing now really what I'm supposed to be doing?" This is somewhat supplanted by sudo on today's systems.

3. Other people will give you various and sundry reasons.

It's completely unnecessary on modern systems, including Mac OS X, and the only reason anyone still does it is habit, superstition, or both. :-)

For more information, see this old USENET thread.

[ Reply to This | # ]
Authored by: blb on Feb 17, '04 03:04:59AM

Old habits truly do die hard...

[ Reply to This | # ]