ASR’s hidden documentation
As part of trying to trace down a separate mystery, the folks in the ##osx-server IRC room made an interesting discovery: Apple’s asr tool has hidden documentation.
Normally, to access Apple’s documentation on a command-line tool, you would use man toolname_here or toolname_here help. asr has both of those, but it also has a separate command that reveals additional asr options not mentioned in the regular man or help pages.
With asr help, you get the following output:
Usage: asr is one of the following: asr help | version asr restore --source --target [] asr restore --source asr:/// --file [] asr server --source --config [] asr imagescan --source [--filechecksum] [--nostream] [--SHA1] is in bytes but may end with a scale factor (b, k, m, g) common are any of: --source path or url to disk image file, mountpoint, or web accessible disk image --puppetstrings print out messages in format good for machine parsing --verbose display verbose output --debug display debug output restore are any of: --target path to volume or mountpoint --erase formats target volume --format target format when erasing (defaults to source) --noprompt don't require confirmation on erase --noverify don't checksum results --buffers number of buffers to use in block copy --buffersize size of buffers to use in block copy --csumbuffers number of buffers for the checksum if different --csumbuffersize size of buffers for the checksum if different --timeout max wait for stream in multicast client mode server are any of: --interface Use 'if' as the interface for the server's outgoing stream --config server configuration file in plist format imagescan are any of: --filechecksum calculate file checksum --nostream don't reorder file for multicast streaming --SHA1 add a SHA-1 checksum to the image
However, when you run FULL_USAGE=1 asr help, you get the following output:
Usage: asr is one of the following: asr help | version asr restore --source --target [] asr restore --source asr:/// --file [] asr server --source --config [] asr imagescan --source [--filechecksum] [--nostream] [--SHA1] asr partition --target [--testsize ] [--retestsize ] [--recoverysize ] asr freeze --target [--testsize ] [--retestsize ] [--recoverysize ] asr thaw --target [--recovery] [--modifyrecovery] asr adjust --target [--settype ] is in bytes but may end with a scale factor (b, k, m, g) common are any of: --source path or url to disk image file, mountpoint, or web accessible disk image --puppetstrings print out messages in format good for machine parsing --verbose display verbose output --debug display debug output restore are any of: --target path to volume or mountpoint --hidden restore to the hidden customer software partition --erase formats target volume --format target format when erasing (defaults to source) --noprompt don't require confirmation on erase --noverify don't checksum results --buffers number of buffers to use in block copy --buffersize size of buffers to use in block copy --csumbuffers number of buffers for the checksum if different --csumbuffersize size of buffers for the checksum if different --timeout max wait for stream in multicast client mode server are any of: --interface Use 'if' as the interface for the server's outgoing stream --config server configuration file in plist format imagescan are any of: --filechecksum calculate file checksum --nostream don't reorder file for multicast streaming --SHA1 add a SHA-1 checksum to the image
There are now four additional options listed:
asr partition --target [--testsize ] [--retestsize ] [--recoverysize ] asr freeze --target [--testsize ] [--retestsize ] [--recoverysize ] asr thaw --target [--recovery] [--modifyrecovery] asr adjust --target [--settype ]
The question I don’t know the answer to is “What do these options do?”
I’ve seen asr adjust used to correct an incorrectly set Recovery HD partition, but I’m not familiar with what asr freeze and asr thaw do.
Do you know? Let me know in the comments.
Search for Freezing….http://lists.apple.com/archives/macos-x-server/2007/Mar/msg00937.html
Not sure if this is related or not? Kinda sounds like it.
Sounds like Faronics – Deep Freeze commands. I know in ARD Deep Freeze uses thaw and freeze commands specifically. I wonder if there are some ties to imaging a frozen or thawed partition
Very interesting. I just started noticing this same thing recently. I didnt take notes as to which commands had these “hidden” options, but I will start! Thanks for posting about it.
I can give a hint as to what they’re for 🙂 Apple Software Restore is also used during Apple’s manufacturing process to restore and uncover disk images when a system is being built and tested. The ‘puppetstrings’ option is specifically for use in that environment (‘XSTA’ – status, ‘PINF’ – progress information, ‘PSTP’ – progress stop, etc). If you use the freeze, thaw and adjust options (as root) you can cause real mayhem to your partition scheme, which is why I’m mentioning it here by way of warning!
Thank you so much for posting this!
I just stumbled across the page and used the “adjust” command to fix my main OSX partition. I had done some disk operations on Windows bootcamp which somehow ended up with all my HFS+ partitions having their details (name, type etc) wiped. Now I can boot again!
asr adjust –target /dev/disk0s2 –settype “Apple_HFS”