LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1656|回复: 18

休眠求助

[复制链接]
发表于 2006-6-25 17:33:13 | 显示全部楼层 |阅读模式
下了内核代码 2。6。16-20
打上 suspend2 休眠补丁
选择 交换分区左面休眠的空间

用hibernate scrip 安装了 hibernate命令  
再在 menulst上 kenel 一栏 加上了 resume=swap:/dev/hda3
然后打入  hibernate 成功的休眠了
但是再启动的时候,跟正常启动没有两样
没有从休眠状态醒来

而且启动过程出现个错误 :swap activation failed with code 255
不过还是可以进系统的:beat
发表于 2006-6-25 20:30:16 | 显示全部楼层
linux对笔记本的电源管理还是差强人意的,我倒现在为止,连个电池的参数它都没正确显示过,只不过有个图标在那儿作样子。那位牛人把这个电源管理的功能弄妥贴了,发个贴共享下?
回复 支持 反对

使用道具 举报

发表于 2006-6-25 20:41:08 | 显示全部楼层
http://www.suspend2.net/HOWTO-2.html#ss2.5

2.5 Installing the new kernel
You must set the resume2= kernel option to the swap partition or filewriter location you want to use for suspending. For the swapwriter, if your swap partition is, for instance, the third primary one on first ide disk (/dev/hda3) you have to append "resume2=swap:/dev/hda3" as a kernel parameter in your lilo.conf file or GRUB's menu.lst.

I find a little mistake in your menu.list  " resume=swap:/dev/hda3 ", try "resume2"
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-6-25 21:48:45 | 显示全部楼层
Post by quanliking
http://www.suspend2.net/HOWTO-2.html#ss2.5

2.5 Installing the new kernel
You must set the resume2= kernel option to the swap partition or filewriter location you want to use for suspending. For the swapwriter, if your swap partition is, for instance, the third primary one on first ide disk (/dev/hda3) you have to append "resume2=swap:/dev/hda3" as a kernel parameter in your lilo.conf file or GRUB's menu.lst.

I find a little mistake in your menu.list  " resume=swap:/dev/hda3 ", try "resume2"

thank you for replying,i made a mistake of typing,actually,i copy "resume2=swap:/dev/hda3" and paste them to menu.lst
MORE,i hibernate sucessfully.i just can;t wake it up when boot up
回复 支持 反对

使用道具 举报

发表于 2006-6-25 22:06:56 | 显示全部楼层
我是用debian etch 自己的内核,suspend to disk 和 suspend to ram 都工作的很好(Thinkpad T23).
自从 用debian之后 总是尽量不自己编译东西包括内核.
suspend2 比 suspend 好像多了不少功能,不过suspend已经足够了,工作的很好
回复 支持 反对

使用道具 举报

发表于 2006-6-25 22:30:07 | 显示全部楼层
Post by shitbaby
thank you for replying,i made a mistake of typing,actually,i copy "resume2=swap:/dev/hda3" and paste them to menu.lst
MORE,i hibernate sucessfully.i just can;t wake it up when boot up


ok, first check whether /dev/hda3 is your swap partition, if not, change it to yours.
if there are no typoes in above, try reconfigure your kernel, like below:
$ make menuconfig
Power management options (ACPI, APM)  --->
--- Power Management support
  • Suspend2  --->
  •      Swap Writer
    ---   General Options
    (/dev/hda3)   Default resume device name

    change /dev/hda3 to yours, and remove "resume2=swap:/dev/hda3" from menu.lst.

    I can succeed resume from hiberhate through suspend2 by this default swap setup.
    Good luck!
  • 回复 支持 反对

    使用道具 举报

    发表于 2006-6-25 23:02:22 | 显示全部楼层
    Post by jinnee
    我是用debian etch 自己的内核,suspend to disk 和 suspend to ram 都工作的很好(Thinkpad T23).
    自从 用debian之后 总是尽量不自己编译东西包括内核.
    suspend2 比 suspend 好像多了不少功能,不过suspend已经足够了,工作的很好



    能具体讲一下如何用自带的内核suspend to disk ?
    我用sid,也觉得编译内核麻烦
    所以一直懒得编译
    以前编译时差不多都成功了(suspend2)
    我用N600C,觉得开机速度太慢了
    所以如果不用编译还真想试试suspend to disk
    回复 支持 反对

    使用道具 举报

    发表于 2006-6-26 00:08:12 | 显示全部楼层
    to LinuxCPP:
    suspend to ram 应该没有问题吧?
    我没有用过suspend2, 我用swsusp的感觉是速度不是很快,从suspend2 与 swsusp的对比,感觉suspend2在速度上会有比较大的优势,所以基本上还是用suspend to ram 比较多.

    我使用的内核版本
    Linux debian 2.6.15-1-686 #2 Mon Mar 6 15:27:08 UTC 2006 i686 GNU/Linux
    测试:

    可以通过以下命令看是否支持休眠模式:

    #cat /sys/power/state
    mem disk
    如果有 disk表示系統已支持休眠模式
    ---------------------------------------------
    简单测试一下休眠是否有响应
    #echo -n disk > /sys/power/state
    如果这里不出现 类似 write error 这些错误,那就成功了一半,接下来就看看唤醒有没有问题了.

    另外两个配置问题值得注意:
    1 我的kernel command line: /boot/vmlinuz-2.6.15-1-686 root=/dev/hda1 ro  resume=/dev/hda5

    2 我的initrd.img 是定制的,一开始我用了yaird来生成image,结果唤醒的时候总是失败,后来换用mkinitrdcramfs 就好了.(这个问题困扰了我好久)
    使用debian Etch或者sid的需要注意,你应该使用initramfs-tools,目前(2006-05-18) yaird 还不支持 swsusp  ,更多信息可以查阅debian wiki


    我还有几个没有解决的问题,不过问题不大

    1.显卡有些问题,必须禁用framebuffer才可以.

    2.唤醒后没有声音,必须重新调整音量.

    3.不能通过 ThinkPad 的ALT+F12 进入 休眠.不过.可以用gnome-power-manager
    我没有试过hibernate script,如果你用gnome桌面环境,强烈推荐用gnome-power-manager,
        * Suspend to RAM
        * Suspend to Disk (Hibernate)
        * Shutdown
        * Blank screen
    这些的功能都正常.
    回复 支持 反对

    使用道具 举报

     楼主| 发表于 2006-6-26 17:31:41 | 显示全部楼层
    Post by quanliking
    ok, first check whether /dev/hda3 is your swap partition, if not, change it to yours.
    if there are no typoes in above, try reconfigure your kernel, like below:
    $ make menuconfig
    Power management options (ACPI, APM)  --->
    --- Power Management support
  • Suspend2  --->
  •      Swap Writer
    ---   General Options
    (/dev/hda3)   Default resume device name

    change /dev/hda3 to yours, and remove "resume2=swap:/dev/hda3" from menu.lst.

    I can succeed resume from hiberhate through suspend2 by this default swap setup.
    Good luck!

  • :comp 我不是很了解你的意思
    打完补丁 我编译内核的时候 我把
  • Suspend2  --->
  •      Swap Writer 已经编译进内核了
    你说remove resume2=swap:/dev/hda3 ,那岂不是休眠不了了
    还是先把resume2=swap:/dev/hda3 加入 menu.lst 休眠成功,让后启动时候把 resume2=swap:/dev/hda3 从menu。lst去掉,再进入系统 可以唤醒系统???
  • 回复 支持 反对

    使用道具 举报

    发表于 2006-6-26 20:09:00 | 显示全部楼层
    抱歉我没说明白。
    我的意思是在内核编译时即选好 swap 分区位置,
    上面写了:
    (/dev/hda3) Default resume device name

    有了这个后,menu.lst 你不需要动它,resume2=swap:/dev/hda3 这句不用加了。
    下次 hibernate 醒来时,会自动监测到。

    还有休眠成功和 grub 无多大关系。编辑 menu.lst 是告诉 grub 到指定的 swap 分区去找休眠 image。
    回复 支持 反对

    使用道具 举报

    您需要登录后才可以回帖 登录 | 注册

    本版积分规则

    快速回复 返回顶部 返回列表