AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / ubuntu / 问题 / 1218399
Accepted
lucidbrot
lucidbrot
Asked: 2020-03-20 01:59:32 +0800 CST2020-03-20 01:59:32 +0800 CST 2020-03-20 01:59:32 +0800 CST

休眠后如何恢复 Ubuntu 18.04?

  • 772

两天前,我按照这个答案在我全新安装的 ubuntu 18.04 上激活了休眠功能,它起作用了。

然后我设法彻底破坏了文件系统,以至于干净的重新安装似乎是最简单的方法。/tmp所以我用, swap,/boot和/分区重新安装了 ubuntu(使用安装程序中的“其他”选项) 。跟我上次做的一模一样。然后我再次按照该答案设置休眠。

休眠有效 - 但恢复无效:
当我执行 asystemctl hibernate时,我的笔记本电脑屏幕立即变黑,只有电源按钮上的 LED 指示与完全关机有任何区别 - 这很好。但是,笔记本电脑不会响应任何交互,例如键盘输入或短按电源按钮。唯一的选择是按住电源按钮 15 秒以强制关机,然后正常按下以重新启动。

以下是有关我的系统的一些信息:

generic@motorbrot-linux:~$ cat /sys/power/state
freeze mem disk
generic@motorbrot-linux:~$ grep swap /etc/fstab
# swap was on /dev/nvme0n1p7 during installation
UUID=93232136-5a6d-4ffc-b40d-809ccead48df none            swap    sw              0       0
generic@motorbrot-linux:~$ cat /etc/default/grub 
# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
#   info -f grub -n 'Simple configuration'

GRUB_DEFAULT=0
GRUB_TIMEOUT_STYLE=hidden
GRUB_TIMEOUT=10
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
#GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""
# FOR HIBERNATION 
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash resume=UUID=93232136-5a6d-4ffc-b40d-809ccead48df"

# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"

# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
#GRUB_GFXMODE=640x480

# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true

# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY="true"

# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"

我注意到的一件事是它update-initramfs显示update-grub了它的输出两次。按照这个答案摆脱了那个,但我很困惑为什么我还有两个linux image:

generic@motorbrot-linux:~$ sudo update-grub
[sudo] password for generic: 
Sourcing file `/etc/default/grub'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.3.0-42-generic
Found initrd image: /boot/initrd.img-5.3.0-42-generic
Found linux image: /boot/vmlinuz-5.3.0-28-generic
Found Windows Boot Manager on /dev/nvme0n1p2@/EFI/Microsoft/Boot/bootmgfw.efi
Adding boot menu entry for EFI firmware configuration
done

我正在寻找有关如何在将笔记本电脑发送到休眠状态后使其恢复的指导。如果相关,我有一个带有 ubuntu 18.04 和 Windows 10 的双启动系统。

Device             Start        End    Sectors   Size Type
/dev/nvme0n1p1      2048    1085439    1083392   529M Windows recovery environme
/dev/nvme0n1p2   1085440    1288191     202752    99M EFI System
/dev/nvme0n1p3   1288192    1320959      32768    16M Microsoft reserved
/dev/nvme0n1p4   1320960  614399999  613079040 292.3G Microsoft basic data
/dev/nvme0n1p5 614400000  614985727     585728   286M Linux filesystem
/dev/nvme0n1p6 614985728  628658175   13672448   6.5G Linux filesystem
/dev/nvme0n1p7 628658176  667719679   39061504  18.6G Linux swap
/dev/nvme0n1p8 667719680 1953523711 1285804032 613.1G Linux filesystem

我刚刚尝试过systemctl suspend,同样的事情发生在那里:屏幕立即变黑,唯一让它重新打开的方法是通过按下电源按钮大约 20 秒来强制关机。有时,挂起后不是黑屏,而是冻结的黑屏,上面有一个不会移动的光标。这个暗示司机有过错的答案nouveau没有帮助。

ping“休眠”系统没有反应,而 ping 完全启动的系统确实得到回复。

在黑屏上按亮度键没有反应。

这/var/log/syslog是我从“请求睡眠”开始到我有理由确定它是随后启动的一部分而不是“休眠”本身的部分摘录。

我已经尝试了所有三个选项 reboot,platform并且shutdown它们都冻结了我的屏幕。


我目前不再遇到这个确切的问题。对于任何拥有 thinkpad 的人,也许ThinkWiki会有所帮助

grub2 hibernate
  • 2 2 个回答
  • 3261 Views

2 个回答

  • Voted
  1. Best Answer
    lucidbrot
    2020-03-20T10:45:15+08:002020-03-20T10:45:15+08:00

    xenoid好心地指出了ubuntu wiki 上一篇很有帮助的文章。

    恢复时出现死屏、空白或黑屏 在某些情况下,机器可以很好地休眠,并且可以毫无问题地恢复,除了醒来时屏幕变黑。换句话说,计算机运行得很好,但显示似乎死了。

    他们建议将nomodeset添加到GRUB_CMDLINE_LINUX_DEFAULTin /etc/default/grub。
    因为我喜欢详细启动,所以我没有quiet splash像他们在他们的示例中那样指定,而且因为我遵循了这个指南,所以我已经有了GRUB_CMDLINE_LINUX_DEFAULT="resume=UUID=<my uuid>". 所以最后我的行看起来像这样:

    GRUB_CMDLINE_LINUX_DEFAULT="nomodeset resume=UUID=93232136-5a6d-4ffc-b40d-809ccead48df"
    

    更改后,您需要运行

    sudo update-grub2
    

    (恰好与sudo update-grub完全相同)。接着

    reboot
    

    现在systemctl hibernate应该可以了。


    这个问题问的是你现在想知道的同样的事情:

    1. 我到底在做什么?为什么有帮助?
    2. 我可以做些什么来避免执行这些步骤吗?

    答案建议“安装合适的视频驱动程序” 。这可能很好地说明了为什么我这次必须添加nomodeset,但不是上次我尝试设置休眠 -我的音频驱动程序也坏了,所以这可能是相关的(尽管我不知道为什么会发生这种情况)。
    事实证明,这个解决方案破坏了我的声卡检测和亮度控制。请参阅此处了解更多信息。不过,截至 2020 年 7 月,似乎内核更新或某些东西已经为我解决了这个问题。


    systemctl suspend现在也“工作”了……但由于某种原因,屏幕一直亮着。它大部分是黑色的,但你可以分辨出来,因为左上角有一个白色的下划线。

    • 1
  2. ByronTaaka
    2020-03-20T04:33:24+08:002020-03-20T04:33:24+08:00

    您可能在重新安装期间分配了一个非常小的SWAP分区。
    因此,在尝试休眠时,要保存的数据远远大于可用的交换空间。
    因此,休眠过程停止。

    • 0

相关问题

  • grub 菜单中的“恢复”选项是什么?

  • 如何让我的电脑中的风扇在暂停时关闭?[关闭]

  • 与 Grub 相比,使用 Grub2 有什么好处?

  • 如果旧版 grub 安装在引导分区扇区而不是 MBR 中,如何将 grub 更新为 grub2?

  • 如何在 Ubuntu 启动时显示或隐藏启动消息?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve