Is it safe to carry MacBook with HDD in a bag while it has been put sleep? I.e. I know there are some risks of hard disk drive damage if one tries to shake them or rotate them while they're working. But is the HDD working while the Macbook is asleep?
MacBooks are fine to be transported when in sleep mode. When a MacBook goes into sleep, it takes 20-30 seconds to save the current state to the HDD, while this is happening you'll see the status light shine brightly. Once it goes into a slow pulse, the MacBook is asleep and the HDD is inactive so there is no risk to the HDD from normal movement in a bag for example. Just make sure you don't throw it into the bag until it's fully asleep. MacBooks also have a 'Sudden Motion Sensor' which can prevent damage to the HDD by the computer parking the head of the HDD if it detects that it is being shaken or is falling. Read about it on the apple support pages or in the excerpt below:
Sudden Motion Sensor technology is built-in protection for the hard disk, designed to help prevent disk issues if the computer is dropped or if it senses unusually strong vibration. Apple has adjusted this feature carefully to provide the best balance between protecting the hard drive and preventing unwanted activation of the Sudden Motion Sensor. Most Apple portable owners never need to turn this feature off. Apple suggests that you not modify the settings unless absolutely necessary.
In some environments, such as live concert halls, recording studios, or dance clubs, external vibrations may be major enough to cause the module to unexpectedly park the hard drive heads, resulting in interrupted sound or video playback. In these situations, you may find that you want to disable the feature temporarily.