How do I prevent initramfs from resuming from a zram device?

And*_*ini 12 initramfs zram

Whenever initramfs is updated I get a message similar to this:

I: The initramfs will attempt to resume from /dev/zram1
I: (UUID=1d4b8573-7eee-43c9-a02a-10a65fc17b8a)
I: Set the RESUME variable to override this.
Run Code Online (Sandbox Code Playgroud)

但是,因为我所有的交换分区都是zram设备,所以我想禁用恢复。我怎样才能做到这一点?

And*_*ini 21

您可以通过添加RESUME=none到 initramfs 配置来禁用从交换设备恢复。

将其放入名为 的文件中/etc/initramfs-tools/conf.d/noresume.conf

# Disable resume (this system has no swap)
RESUME=none
Run Code Online (Sandbox Code Playgroud)

  • 请注意,值“none”区分大小写。其他一些页面包含指示使用“RESUME=NONE”的消息,这是不正确的。 (3认同)
  • @MikkoRantalainen,您可以通过运行“sudo update-initramfs -u”来检查是否使用了正确的大小写 (2认同)