如何在Ubuntu 12.04中重新启用Hibernate

image

If you’ve just updated to Ubuntu 12.04, you may notice an option missing in its system menu. The Hibernate option is now hidden by default, but you can get it back if you prefer to hibernate your system.

如果您刚刚更新到Ubuntu 12.04,则可能会注意到其系统菜单中缺少一个选项。 默认情况下,“Hibernate”选项现在处于隐藏状态,但是如果您希望使系统Hibernate,则可以将其恢复。

Hibernate is disabled by default because it can cause problems on some system configurations. You should perform a hibernate with a special command to test that it works properly before re-enabling it.

默认情况下,Hibernate是禁用的,因为它可能导致某些系统配置出现问题。 在重新启用它之前,应使用特殊命令执行Hibernate以测试其是否正常运行。

Hibernate与暂停 (Hibernate vs. Suspend)

The Suspend option is still available in Ubuntu’s system menu. Like hibernate, suspend saves your open programs and data, so you can quickly resume to your previous sate. However, suspend requires power — while in suspend mode, your computer will continue to draw a small amount of power. If the system loses power — for example, if you unplug a desktop computer from the power socket or a laptop’s battery empties, you’ll lose your work.

Suspend选项在Ubuntu的系统菜单中仍然可用。 与Hibernate一样,暂停可以保存打开的程序和数据,因此您可以快速恢复到以前的状态。 但是,挂起需要电源-在挂起模式下,您的计算机将继续消耗少量电源。 如果系统断电(例如,如果从电源插座中拔出台式计算机的电源或笔记本电脑的电池没电了,则将丢失工作)。

image

In contras, hibernate saves your system’s state to your hard disk and shuts the system off, consuming no power. When you resume from hibernate, your open programs and data will be restored. Hibernate saves power, but it takes longer – the computer has to restore data to the RAM, while suspend preserves the data in the RAM.

相反,Hibernate将系统状态保存到硬盘上并关闭系统,而无需消耗电源。 从Hibernate状态恢复时,将恢复打开的程序和数据。 Hibernate可以节省功耗,但是需要更长的时间–计算机必须将数据还原到RAM,而挂起则将数据保留在RAM中。

为什么禁用 (Why It’s Disabled)

Hibernate doesn’t work properly on many hardware configurations with Ubuntu and other Linux distributions. If hibernate doesn’t work properly on your system, you may resume from hibernate to find that your work has been lost. Some hardware drivers may also not work properly with hibernate — for example, Wi-Fi hardware or other devices may not work after resuming from hibernate.

Hibernate在Ubuntu和其他Linux发行版的许多硬件配置上无法正常工作。 如果Hibernate系统无法在您的系统上正常工作,则您可以从Hibernate状态恢复以发现您的工作已丢失。 某些硬件驱动程序也可能无法在Hibernate模式下正常工作-例如,从Hibernate模式恢复后,Wi-Fi硬件或其他设备可能无法工作。

To prevent new users from encountering these bugs and losing their work, hibernate is disabled by default.

为了防止新用户遇到这些错误并失去工作,默认情况下禁用Hibernate模式。

测试Hibernate (Testing Hibernate)

Before re-enabling hibernate, you should test it to verify it works properly on your system. First, save your work in all open programs — you’ll lose it if hibernate doesn’t work properly.

在重新启用Hibernate之前,您应该对其进行测试以验证其在系统上是否可以正常运行。 首先,将您的工作保存在所有打开的程序中-如果Hibernate无法正常工作,您将丢失它。

To test hibernate, launch a terminal. Type terminal into the Dash and or use the Ctrl-Alt-T keyboard shortcut.

要测试Hibernate状态,请启动一个终端。 在Dash中键入terminal,或者使用Ctrl-Alt-T键盘快捷键。

image

In the terminal, run the following command:

在终端中,运行以下命令:

sudo pm-hibernate

须藤pm-Hibernate

image

Your system will shut down. After running the command, turn your system back on — if your open programs reappear, hibernate works properly.

您的系统将关闭。 运行该命令后,重新打开系统-如果重新出现打开的程序,则Hibernate可以正常工作。

Hibernate故障排除 (Troubleshooting Hibernate)

While hardware incompatibilities are a major problem with hibernate, there’s one other common problem. Hibernate saves the contents of your RAM to your swap partition. Therefore, your swap partition must be at least as large as your RAM. If you have a 2GB swap partition and 4GB of RAM, hibernate won’t work properly.

虽然硬件不兼容是Hibernate的主要问题,但还有另一个常见问题。 Hibernate将RAM的内容保存到交换分区。 因此,交换分区必须至少与RAM一样大。 如果您有2GB的交换分区和4GB的RAM,则Hibernate将无法正常工作。

A quick way to compare your RAM and swap sizes is with the System Monitor application.

比较系统内存和交换大小的快速方法是使用系统监视器应用程序。

image

You can view the memory and swap sizes on the Resources tab. “Memory” here refers to your RAM.

您可以在“资源”选项卡上查看内存和交换大小。 此处的“内存”是指您的RAM。

image

If really want to use hibernate and your swap partition is smaller than your RAM, try running GParted from a live CD. You can run GParted from a Ubuntu live CD or a dedicated GParted live CD. From the live CD, you can resize your Ubuntu partitions — you can’t do this while they’re in-use.

如果确实要使用Hibernate模式,并且交换分区小于RAM,请尝试从实时CD运行GParted 。 您可以从Ubuntu Live CD或专用GParted Live CD运行GParted。 从实时CD中,您可以调整Ubuntu分区的大小-在使用它们时无法执行此操作。

重新启用Hibernate (Re-Enabling Hibernate)

You can run the sudo pm-hibernate command whenever you want to hibernate, but this is inconvenient. To re-enable the hibernate option in the menus, you’ll have to create a PolicyKit file.

只要您想Hibernate,就可以运行sudo pm-hibernate命令,但这很不方便。 要重新启用菜单中的Hibernate选项,您必须创建一个PolicyKit文件。

You can use any text editor for this, but we’ll use gedit in this example. Run the following command to launch gedit as the root user and specify the file you want to create:

您可以为此使用任何文本编辑器,但在此示例中,我们将使用gedit。 运行以下命令以root用户身份启动gedit并指定要创建的文件:

gksu gedit /etc/polkit-1/localauthority/50-local.d/com.ubuntu.enable-hibernate.pkla

gksu gedit /etc/polkit-1/localauthority/50-local.d/com.ubuntu.enable-hibernate.pkla

image

Paste the following text into the file:

将以下文本粘贴到文件中:

[Enable Hibernate] Identity=unix-user:* Action=org.freedesktop.upower.hibernate ResultActive=yes

[启用Hibernate] Identity = unix用户:* Action = org.freedesktop.upower.hibernate ResultActive = yes

image

Save the text file, then log out and log back in. You’ll be able to hibernate from the system menu.

保存该文本文件,然后注销并重新登录。您将能够从系统菜单进入Hibernate状态。

翻译自: https://www.howtogeek.com/113923/how-to-re-enable-hibernate-in-ubuntu-12.04/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值