Jump to content

Hibernation (computing)

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by TSJSwimmer (talk | contribs) at 02:22, 6 May 2014 (The word "often" was added, since not all machines deny access to the bios when resuming Hibernation.). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Hibernation (or Suspend to disk) in computing is powering down a computer while retaining its state.

Upon hibernation, the computer saves the contents of its random access memory (RAM) to a hard disk or other non-volatile storage. Upon resumption, the computer is exactly as it was upon entering hibernation.

When used to save power, hibernation is similar to sleep mode and saves more power at the cost of slower resumption.

Uses

Hibernation saves electrical power. After hibernating, the hardware is almost completely powered down, but not completely like for a regular shutdown. A small amount of power is drawn from the power supply to keep the CMOS powered, and often prevents the user from entering the BIOS setup upon resuming the system. A hibernated machine uses less electrical power than one which is in sleep or suspend mode. [1] Hibernation is a means of avoiding the burden of saving unsaved data before shutting down and restoring all running programs after powering back on.

Hibernation is used in laptops, which have limited battery power available. It can be set to happen automatically on a low battery alarm. Most desktops also support hibernation, mainly as a general energy saving measure.

Problems

In some cases entering into hibernation can cause incorrect operation on restarting, due to problems with the hibernation software, or with devices or software which is not fully compliant. Hibernation also usually causes connections to peripheral devices to terminate; this may cause problems for peripherals that were in use when hibernation started.[citation needed]

Some organizations (mainly large enterprises) mandate automatic hibernation (e.g. as a network policy) if a computer system has been idle for a certain amount of time, mainly as an energy saving measure. This saves some energy at the cost of some lost productivity waiting for the state to be restored.

Another problem with hibernation (mostly on Windows-based systems) is that the system compromises security even with Full Disk Encryption or just the Encrypting File System (EFS) mechanism. When the system is in hibernation mode, an attacker with physical access to the machine can detach the disk drive and install it in another system. This will give access to the encrypted contents without the key.[citation needed]

Comparison to sleep mode

Many systems also support a low-power sleep mode or stand by mode in which the processing functions of the machine are powered down, using a little power to preserve the contents of RAM and support waking up; wakeup is almost instantaneous.

The advantage of sleep mode is that resuming is much quicker than for hibernation. A hibernated system must start up, then read back data to RAM on resuming, which typically takes about ten seconds or more. A system in sleep mode only needs to power up the CPU and display, which is almost instantaneous. On the other hand, a system in sleep mode still consumes power to keep the data in the RAM, while a hibernated system uses much less power. A sleeping computer is a case of a device consuming standby power, covered by regulations in many countries limiting such power under the One Watt Initiative to one watt from 2010. Since these facilities were introduced, most systems have come to offer both sleep mode and hibernation.[citation needed]

Hybrid sleep

Sleep mode and hibernation can be combined: The contents of RAM are copied to the non-volatile storage and the computer enters sleep mode. This approach combines the benefits of sleep mode and hibernation: The machine can resume instantaneously, and its state, including open and unsaved files, survives a power outage. Hybrid sleep consumes as much power as sleep mode while hibernation consumes none.[2][3]

Operating system support

Early implementations of hibernation used the BIOS, but modern operating systems usually handle hibernation. Hibernation is defined as sleeping mode S4 in the ACPI specification.[4]

Microsoft Windows

On Windows computers, hibernation is available only if all hardware and device drivers are ACPI and plug-and-play–compliant. Hibernation can be invoked from the Start menu or the command line.[5]

Windows 95 supports hibernation through hardware manufacturer-supplied drivers and only if compatible hardware and BIOS are present. Since Windows 95 supports only Advanced Power Management (APM), hibernation is called Suspend-to-Disk. Windows 98 and later support ACPI. However, hibernation often caused problems since most hardware was not fully ACPI 1.0 compliant or did not have WDM drivers. There were also issues with the FAT32 file system.[6]

Windows 2000 was the first Windows to support hibernation at the operating system level (OS-controlled ACPI S4 sleep state) without special drivers from the hardware manufacturer. A file named "hiberfil.sys" is used to store the contents of RAM when the computer hibernates, and was of the same size as the total RAM. A hidden system file resides in the root of the system partition, e.g. "C:\hiberfil.sys".

Windows Me, the last release in the Windows 9x family, also supports OS controlled hibernation and requires disk space equal to that of the computer's RAM.[7][8]

Windows XP further improved support for hibernation.[9] Hibernation and resumption are much faster as memory pages are compressed using an improved algorithm; compression is overlapped with disk writes, unused memory pages are freed and DMA transfers are used during I/O.[10] hiberfil.sys contains further information including processor state. This file was documented by a security researcher Matthieu Suiche[11] during Black Hat Briefings 2008 who also provided a computer forensics framework to manage and convert this file into a readable memory dump.[12] The compression algorithm was later documented by Microsoft as well.[13]

Although Windows XP added support for more than 4 gigabytes of memory (through Windows XP 64-bit Edition and Windows XP Professional x64 Edition), this operating system, as well as Windows Server 2003, Windows Vista and Windows Server 2008 do not support hibernation when this amount of memory is installed because of performance issues associated with saving such a large pool of data to disk.[14]

Windows Vista introduced a hybrid sleep feature, which saves the contents of memory to hard disk before but instead of powering down, enters sleep mode. If the power is lost, the computer can resume as if hibernated. Hybrid sleep and hibernation.

Windows 7 introduced compression to the hibernation file and set the default size to 75% of the total physical memory.[13] Microsoft also recommends to increase the size using the powercfg.exe tool in some rare workloads where the memory footprint exceeds that amount. It can be set from anywhere between 50% to 100%, although decreasing it is not recommended.

Windows 8's resume-from-hibernation algorithm is multi-core optimized. Windows 8 also introduces a Hybrid Boot feature. When users select the Shut Down option, it hibernates the computer, but closes all programs and logs out the user session before hibernating.[15] According to Microsoft, a regular hibernation includes more data in memory pages which takes longer to be written to disk. In comparison, when the user session is closed, the hibernation data is much smaller and therefore takes less time to write to disk and resume. Windows 8 also saves the kernel image. Users have the option of performing a traditional shutdown by holding down the Shift key while clicking Shut Down.

Hibernation is often under-used in business environments as it is difficult to enable it on a large network of computers without resorting to third-party PC power management software.[16] This omission by Microsoft has been criticized as having led to a huge waste in energy.[17]

There is a significant market in third-party Power Management Software offering features beyond those present in the Windows operating system[18][19][20] available. Most products offer Active Directory integration and per-user/per-machine settings with the more advanced offering multiple power plans, scheduled power plans, anti-insomnia features and enterprise power usage reporting. Notable vendors include 1E NightWatchman,[21][22] Data Synergy PowerMAN (Software),[23] Faronics Power Save[24] and Verdiem SURVEYOR.[25]

Windows hibernation mode can be disabled as well as the side benefit of deleting the hiberfil.sys file using a simple command.[26]

Mac OS X

On Macs, a feature known as Safe Sleep saves the contents of volatile memory to the system hard disk each time the Mac enters Sleep mode. The Mac can instantaneously wake from sleep mode if power to the RAM has not been lost. However, if the power supply was interrupted, such as when removing batteries without an AC power connection, the Mac would wake from Safe Sleep instead, restoring memory contents from the hard drive.[27] Because Safe Sleep's hibernation process occurs during regular Sleep, the Apple menu does not have a "hibernate" option.

Safe Sleep capability is found only in new Mac models starting with the October 2005 revision of the PowerBook G4 (Double-Layer SD). Mac OS X v10.4 or higher is also required.

Shortly after Apple started supporting Safe Sleep, Mac enthusiasts released a hack to enable this feature for much older Mac computers running Mac OS X v10.4.[28] Classical Mac OS once also supported hibernation, but this feature was dropped by Apple.[29]

Linux

In the Linux kernel, hibernation is implemented by swsusp which is built into the 2.6 series. An alternative implementation is TuxOnIce which is available as patches for the kernel version 3.4. TuxOnIce provides advantages such as support for symmetric multiprocessing and preemption. Another alternative implementation is uswsusp.

See also

References

  1. ^ "Sleep and hibernation: frequently asked questions". Microsoft. Microsoft. Retrieved 22 November 2013.
  2. ^ "Turn off a computer: frequently asked questions". Windows Vista Online Help. Microsoft Corporation. Retrieved 15 October 2011.
  3. ^ "Sleep and hibernation: frequently asked questions". Windows 7 Online Help. Microsoft Corporation. Retrieved 15 October 2011.
  4. ^ ACPI Specification Rev 3.0b
  5. ^ Microsoft Help and Support – How To Put the System into hibernation or Standby from Run menu
  6. ^ BIOS and Hibernate Issues for FAT32 File System
  7. ^ "Interview with Nicolas Coudière, Chief Product Manager: Microsoft Windows Millennium Edition (Me)". Activewin.com. Retrieved 2010-08-26.
  8. ^ "Windows Power Management". Microsoft.com. 2001-12-04. Archived from the original on 2004-07-13. Retrieved 2010-08-26.
  9. ^ Windows Power Management: Instant PC availability and energy savings
  10. ^ Kernel Enhancements for Windows XP
  11. ^ BlackHat USA 2008 – Windows hibernation file for fun and profit
  12. ^ SandMan Computer Forensics Framework
  13. ^ a b "Reducing the Disk Footprint for Windows 7 Hibernation". Retrieved 2012-10-25.
  14. ^ "You cannot put a computer that has more than 4 GB of memory into hibernation in Windows XP, in Windows Server 2003, in Windows Vista, or in Windows Server 2008". Support (9.0 ed.). Microsoft. 23 September 2011. Retrieved 23 March 2014.
  15. ^ Delivering fast boot times in Windows 8
  16. ^ Enable hibernate using group policy
  17. ^ EcoGeek – How Windows XP Wasted $25 Billion of Energy
  18. ^ "Power Management Software for Windows Workstations".
  19. ^ "Energy Star Commercial Packages List".
  20. ^ The Headmasters' and Headmistresses' Conference. "HMC: A Practical Guide to Sustainable Building for Schools".
  21. ^ "PC Power Management Solutions".
  22. ^ "Why use software NightWatchman to turn your PCs off?".
  23. ^ "University of Oxford Low Carbon Project: Energy and the networked computing environment".
  24. ^ "Forrester Study: Total Economic Impact of Faronics Power Save" (PDF).
  25. ^ "1E upgrades NightWatchman, seeks to bring powermanagement to SMEs: Competitive landscape" (PDF).
  26. ^ How to disable and re-enable hibernation on a computer that is running Windows; Microsoft; August 12, 2010.
  27. ^ Apple Support: Progress bar appears after waking from sleep
  28. ^ http://web.archive.org/web/20080105000720/http://andrewescobar.com/archive/2005/11/11/how-to-safe-sleep-your-mac/
  29. ^ http://docs.info.apple.com/article.html?artnum=59016