Sun Aug 12, 2012 2:45 am
If you're going to do sync follwed by a quick shutdown, do the sync twice, as
in:
sudo sync; sync
When you get the next prompt, do your shutdown. There reason for this (and assuming--always dangerous--that Linux sync works like unix sync) is that sync will allow the system to issue a new prompt *immediately* and not hold the session until it completes. If you do it the way I gave above, the second sync operation can't start until the first one finishes, so when you get a prompt, you are guaranteed that the first sync has completed. There won't be anything for the second sync to do, so it's safe to shut the system down.
There is one other consideration...SD cards are internally buffered and do wear-leveling. There may be card activity (that requires power) *after* the system halts--though not for very long in human terms.
To get at the power connector to my Pi, I have to get up and move around a small table, so I figure that once the system appears to be truly down (e.g. PuTTY has reported no signal), and I get to the power connector, the SD card has finished anything it might be doing as well.
An alternative is to give the Pi about 5 seconds between system actually halted and pulling the plug on it.