## [转] 为什么一线城市大龄未婚女性越来越多？

http://download.virtualbox.org/virtualbox/5.2.26/ 通过 上面这个网址找到你要下载的 virtualbox 版本， 选择后缀 .amd64.run 的来下载。下载可以使用 aria2c 来下载，下载完成之后，把 run 文件放入 /usr/portage/distfiles 文件夹即可。

## [转]Kernel parameters

You configure the suspend and resume support by adding parameters to the kernel parameter line.

Read syntax diagramSkip visual syntax diagram suspend and resume kernel parameter syntax

-resume=--+---------------------+--+-----------+->< '- no_console_suspend-' '- noresume-'

where:

## resume=

specifies the standard device node of the swap partition with the data that is required for resuming the Linux instance.

## no_console_suspend

prevents Linux consoles from being suspended early in the suspend process. Without this parameter, you cannot see the kernel messages that are issued by the suspend process.

## noresume

boots the kernel without resuming a previously suspended Linux instance. Add this parameter to circumvent the resume process, for example, if the data written by the previous suspend process is damaged.

# Example

To use a partition /dev/disk/by-path/ccw-0.0.2f50-part1 as the swap partition and prevent Linux consoles from being suspended early in the suspend process specify:

resume=/dev/disk/by-path/ccw-0.0.2f50-part1 no_console_suspend

The example uses a "by-path" definition of the disk to ensure that the correct device is used, for example, after a reboot.

# What Hibernation Is and Does

Hibernation takes all the data in your ram and stores it on your hard drive and then powers down the computer. The data is stored in a special type of partition called a swap partition (you can also have a swap file). When you power the computer on again the data stored from your old session is reloaded.

In the following article I am going to lead you through a systematic approach to diagnosing why Linux’s hibernation feature isn’t working on your computer and hopefully fix it. Here’s a Brief overview.

1. Not Enough Swap
4. Your Computer Says “resuming from /dev/sdX” but freezes

## 1. Not Enough Swap

You should have as much swap as you have RAM plus some margin. If you try to hibernate and you are using more ram than you have swap the process will fail and sometimes hangs. Sometimes there is an error message that says “not enough swap” This is an easy problem to check for. Run the command in red.

 chris@Starace ~ $free -m total used free shared buffers cached Mem: 10005 9922 82 0 1647 5844 -/+ buffers/cache: 2430 7574 Swap: 8100 0 8100 The output shows the amount of swap and ram on my computer. As you can see I have 8005 Mb of RAM and I have 8100 Mb of swap. For a hibernate to work you have to have more swap than used RAM not counting cached), Also if you run out of RAM during your session your swap is used. To hibernate you must have free swap greater than the sum of your RAM and your used swap. As a general rule you should have a swap partition slightly bigger than your RAM (hopefully you aren’t using swap during your session, if you are it’s time for a RAM upgrade.) If you don’t have enough swap or if you don’t have any swap, roll up your sleeves you need to repartition your hard drive. ## Repartitioning to add more SWAP Remember to be careful with your repartitioning, you can destroy your OS easily. Pull out your bootable CD/Jump Drive and boot It (we can’t repartition the drive we we are using it.) Run the “gparted” disk utility. If you have swap, right click -> Delete Right click on your linux partition -> Resize/Move Decrease the size of the partition by the amount of space you want to increase your swap. Click Okay Right click on the free space -> New Change the File System Type to “linux-swap,” click okay. Click the apply check mark in the top menu of gparted to apply the changes Right Click On the new swap partition -> Information Copy down the UUID value and /dev/sdXN value for later. Linux Create Parition Make Sure the File System is linux-swap uuid info linux Copy down the UUID and path values. We will use them later. Note:Remember to be careful with your repartitioning, you can destroy your OS easily. After repartitioning you will need to edit your Linux Hard Drive file. Open up terminal and run the command. chris@Starace ~$ sudo gedit /media/NAME_OF_YOUR_COMPUTER/etc/fstab

If you had a swap partition before, look for the line that has the word swap and change the /dev/sdXN to the new /dev/sdXN value. You can also use the UUID instead of the path as shown in red. If never had a swap partition to begin with add the following line to the bottom of the “/media/NAME_OF_YOUR_COMPUTER/etc/fstab” file.

UUID=a453-Your-UUID-Number-ea33 none swap sw

The path variable can change depending on how you have your hard drive plugged in (ex /dev/sda1 -> /dev/sdb1). This usually isn’t a problem if you don’t move your hard drives around in your computer. However, Using a UUID is more reliable. The /dev/sdXN designator can change, but the UUID is unique to the storage device and doesn’t change even if you move to another computer.

After you’ve made the changes to the fstab file, shut down and boot your computer normally. To make sure this all worked run the following command in red. You should see your swap partition listed.

 chris@Starace ~ $cat /proc/swaps Filename Type Size Used Priority /dev/sdNX partition 8295420 0 -1 If you see this take you have successfully created/expanded your swap to accommodate hibernation. 1. Your Computer Isn’t Saving Your Session If you’ve tried to get your computer to hibernate and it didn’t work it’s helpful to look at the hibernation log. tail /var/log/pm-suspend.log  chris@Starace ~$ tail  /var/log/pm-suspend.log
Running hook /usr/lib/pm-utils/sleep.d/00powersave thaw hibernate:

/usr/lib/pm-utils/sleep.d/00powersave thaw hibernate: success.
Running hook /usr/lib/pm-utils/sleep.d/00logging thaw hibernate:

/usr/lib/pm-utils/sleep.d/00logging thaw hibernate: success.
Running hook /usr/lib/pm-utils/sleep.d/000kernel-change thaw hibernate:

/usr/lib/pm-utils/sleep.d/000kernel-change thaw hibernate: success.
Sun Jul 24 13:15:14 HST 2011: Finished.

If you see something that has a date and says “Finished” like the what is shown in blue, that means that your computer successfully saved the session. If you see a bunch of errors then get ready to roll up your sleeves again. Unfortunately this is the hardest error to fix. There could be dozens of reasons for this to happen, but in my case it had something to do with binding and unbinding peripheral devices. The following article explains what I did to fix the problem.

http://chriseiffel.com/everything-linux/how-i-got-suspend-and-hibernate-working-in-linux-ubuntu-11-04-mint-11/

One solution that I found that worked for a lot of people, but not me is this simple fix

http://www.ubuntugeek.com/fix-for-suspend-and-hibernation-problem-for-laptops.html/comment-page-2#comment-53547

Don’t lose hope if you get stuck in this step. Instead google everything you can on the problem. Google the errors you see in the log. Someone has solved the problem you just need to find the solution.

So your computer successfully saves a session, but doesn’t resume the session upon power up? It acts as if it was rebooted rather than hibernated? Well the good news is that this is a fairly easy thing to fix. This is most likely because GRUB the bootloader doesn’t know to resume from your swap. Take a look at the GRUB profile.

 chis@Starace ~ $sudo gedit /etc/default/grub Look for the line that starts with. GRUB_CMDLINE_LINUX Add the following option in red. GRUB_CMDLINE_LINUX=”resume=UUID=a353e-Your-SWAP-UUID-34eda other-option=value” Or GRUB_CMDLINE_LINUX=”resume=/dev/sdXN other-option=value” You may or may nor have other options. Be careful that you type in the correct path or UUID for the drive here. If you don’t then when you try to resume you will have to boot in safe mode to fix the drive name and re-run the update-grub script. Save the file and then update grub with the following command.  chris@Starace ~$ sudo update-grub

In addition to grub we need to update/create one more file. Edit the following file.

 chris@Starace ~ $sudo gedit /etc/initramfs-tools/conf.d/resume  Add this line to the file.  resume=UUID=41e86209-3802-424b-9a9d-d7683142dab7  Then run this command to update.  chris@Starace ~$ sudo update-initramfs -u

Now hibernate your computer and cross your fingers! It just might work.

# 4. Your Computer Says “resuming from /dev/sdX” but freezes

Linux is so close to hibernating and resuming successfully that it even says it is resuming. Fortunately this is another easy fix. The problem with this comes from two programs that are redundant. Removing them should fix the problem.

 chris@Starace: sudo apt-get remove hibernate uswsusp

I know that the command may seem counterintuitive. but it worked for me so hopefully it will work for you.

## All Done

Remember to check to make sure your USB ports work after the suspend/hibernate.

If you tried the steps above, please leave a comment below with your system setup (OS, Computer Hardware) so that we can create a reference that others can use.

https://help.ubuntu.com/community/SwapFaq

Happy Linuxing!

This entry was posted in ASUS G53SW Setup, Everything Penguin Related, Uncategorized. Bookmark the permalink.

## gentoo hibernate

Power management and ACPI options --->
[*] Suspend to RAM and standby
[*] Hibernation (aka 'suspend to disk')

emerge --ask sys-power/suspend

cat /sys/power/state

echo mem > /sys/power/state

1. 在内核里面增加下面语句, 然后重新编译内核.

resume=/dev/sda3 no_console_suspend
2. 替换genkernel 软件, 原来的 genkernel 据说有　bug, 安装 genkernel-next软件, 替换原来的 genkernel 软件,　然后使用 genkernel --install initramfs, 重新生成 initramfs.

echo disk > /sys/power/state

1. /etc/default/grub

GRUB_CMDLINE_LINUX_DEFAULT="resume=/dev/sda3"
2. grub-mkconfig -o /boot/grub/grub.cfg
3. genkernel --install initramfs
4. vim /etc/pm/config.d/gentoo
SLEEP_MODULE="kernel"

1. Power management and ACPI options --->
[*] Suspend to RAM and standby
[*] Hibernation (aka 'suspend to disk')
2.  pm-utils
3. 后面的配置.

- 阅读剩余部分 -

## [转]pm-hibernate(8) - Linux man page

Name pm-action - Suspend or Hibernate your computer

Synopsis pm-hibernate [--help]

pm-suspend [--quirk---help] pm-suspend-hybrid [--quirk---help] Description

This manual page documents briefly the pm-action, pm-hibernate, pm-suspend and pm-suspend-hybrid commands. This manual page was originally written for the Debian(TM) distribution and has been adopted by the pm-utils project.

- 阅读剩余部分 -

- 阅读剩余部分 -