如何设置 RESUME 变量来覆盖这些问题?

普拉纳夫

我有一个带有 Windows 10 的 Ubuntu 18.10 双启动。我认为由于下面的错误,我的 Ubuntu 在重新启动/启动时最近崩溃/挂起很多。

$ sudo apt-get --with-new-pkgs upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
The following NEW packages will be installed:
  linux-headers-4.18.0-15 linux-headers-4.18.0-15-generic linux-image-4.18.0-15-generic linux-modules-4.18.0-15-generic
  linux-modules-extra-4.18.0-15-generic
The following packages will be upgraded:
  linux-generic linux-headers-generic linux-image-generic
3 upgraded, 5 newly installed, 0 to remove and 0 not upgraded.
Need to get 66.0 MB of archives.
After this operation, 329 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://archive.ubuntu.com/ubuntu cosmic-updates/main amd64 linux-modules-4.18.0-15-generic amd64 4.18.0-15.16 [13.4 MB]
Get:2 http://archive.ubuntu.com/ubuntu cosmic-updates/main amd64 linux-image-4.18.0-15-generic amd64 4.18.0-15.16 [8,154 kB]                     
Get:3 http://archive.ubuntu.com/ubuntu cosmic-updates/main amd64 linux-modules-extra-4.18.0-15-generic amd64 4.18.0-15.16 [32.7 MB]              
Get:4 http://archive.ubuntu.com/ubuntu cosmic-updates/main amd64 linux-generic amd64 4.18.0.15.16 [1,868 B]                                      
Get:5 http://archive.ubuntu.com/ubuntu cosmic-updates/main amd64 linux-image-generic amd64 4.18.0.15.16 [2,480 B]                                
Get:6 http://archive.ubuntu.com/ubuntu cosmic-updates/main amd64 linux-headers-4.18.0-15 all 4.18.0-15.16 [10.5 MB]                              
Get:7 http://archive.ubuntu.com/ubuntu cosmic-updates/main amd64 linux-headers-4.18.0-15-generic amd64 4.18.0-15.16 [1,195 kB]                   
Get:8 http://archive.ubuntu.com/ubuntu cosmic-updates/main amd64 linux-headers-generic amd64 4.18.0.15.16 [2,440 B]                              
Fetched 66.0 MB in 2min 25s (456 kB/s)                                                                                                           
Selecting previously unselected package linux-modules-4.18.0-15-generic.
(Reading database ... 197143 files and directories currently installed.)
Preparing to unpack .../0-linux-modules-4.18.0-15-generic_4.18.0-15.16_amd64.deb ...
Unpacking linux-modules-4.18.0-15-generic (4.18.0-15.16) ...
Selecting previously unselected package linux-image-4.18.0-15-generic.
Preparing to unpack .../1-linux-image-4.18.0-15-generic_4.18.0-15.16_amd64.deb ...
Unpacking linux-image-4.18.0-15-generic (4.18.0-15.16) ...
Selecting previously unselected package linux-modules-extra-4.18.0-15-generic.
Preparing to unpack .../2-linux-modules-extra-4.18.0-15-generic_4.18.0-15.16_amd64.deb ...
Unpacking linux-modules-extra-4.18.0-15-generic (4.18.0-15.16) ...
Preparing to unpack .../3-linux-generic_4.18.0.15.16_amd64.deb ...
Unpacking linux-generic (4.18.0.15.16) over (4.18.0.14.15) ...
Preparing to unpack .../4-linux-image-generic_4.18.0.15.16_amd64.deb ...
Unpacking linux-image-generic (4.18.0.15.16) over (4.18.0.14.15) ...
Selecting previously unselected package linux-headers-4.18.0-15.
Preparing to unpack .../5-linux-headers-4.18.0-15_4.18.0-15.16_all.deb ...
Unpacking linux-headers-4.18.0-15 (4.18.0-15.16) ...
Selecting previously unselected package linux-headers-4.18.0-15-generic.
Preparing to unpack .../6-linux-headers-4.18.0-15-generic_4.18.0-15.16_amd64.deb ...
Unpacking linux-headers-4.18.0-15-generic (4.18.0-15.16) ...
Preparing to unpack .../7-linux-headers-generic_4.18.0.15.16_amd64.deb ...
Unpacking linux-headers-generic (4.18.0.15.16) over (4.18.0.14.15) ...
Setting up linux-headers-4.18.0-15 (4.18.0-15.16) ...
Setting up linux-modules-4.18.0-15-generic (4.18.0-15.16) ...
Setting up linux-headers-4.18.0-15-generic (4.18.0-15.16) ...
Setting up linux-image-4.18.0-15-generic (4.18.0-15.16) ...
I: /vmlinuz.old is now a symlink to boot/vmlinuz-4.18.0-14-generic
I: /initrd.img.old is now a symlink to boot/initrd.img-4.18.0-14-generic
I: /vmlinuz is now a symlink to boot/vmlinuz-4.18.0-15-generic
I: /initrd.img is now a symlink to boot/initrd.img-4.18.0-15-generic
Setting up linux-modules-extra-4.18.0-15-generic (4.18.0-15.16) ...
Setting up linux-headers-generic (4.18.0.15.16) ...
Setting up linux-image-generic (4.18.0.15.16) ...
Setting up linux-generic (4.18.0.15.16) ...
Processing triggers for linux-image-4.18.0-15-generic (4.18.0-15.16) ...
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-4.18.0-15-generic
I: The initramfs will attempt to resume from /dev/sda5
I: (UUID=09e25397-4a2c-4fb0-a605-a7013eecb59c)
I: Set the RESUME variable to override this.
/etc/kernel/postinst.d/zz-update-grub:
Sourcing file `/etc/default/grub'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.18.0-15-generic
Found initrd image: /boot/initrd.img-4.18.0-15-generic
Found linux image: /boot/vmlinuz-4.18.0-14-generic
Found initrd image: /boot/initrd.img-4.18.0-14-generic
Found linux image: /boot/vmlinuz-4.18.0-13-generic
Found initrd image: /boot/initrd.img-4.18.0-13-generic
Found Windows Boot Manager on /dev/sda2@/EFI/Microsoft/Boot/bootmgfw.efi
Adding boot menu entry for EFI firmware configuration
done
特伦斯

需要将交换 UUID 添加到/etc/initramfs-tools/conf.d/resume文件中。

以下命令可以显示您的交换 UUID 是什么:

blkid | awk -F\" '/swap/ {print $2}'

您可以运行以下命令在 RESUME 文件中进行设置:

printf "RESUME=UUID=$(blkid | awk -F\" '/swap/ {print $2}')\n" | sudo tee /etc/initramfs-tools/conf.d/resume

然后运行以下命令来更新系统上的内核:

sudo update-initramfs -u -k all

重新启动系统以使更改生效。


这也是我必须对我的机器做的事情。当我在系统上安装全新的 Ubuntu 时会发生这种情况,但我允许它选择安装而不选择手动并重新分区离开旧的交换分区。好吧,安装会创建一个交换文件并且不使用旧的交换分区。后来我决定使用交换分区而不是文件,我收到这条消息,因为默认情况下从未创建简历,或者它被设置为使用交换文件。

这确实会持续到内核更新。

希望这可以帮助!

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章