gave-up-waiting-for-suspend-resume-device

环境

发行版Debian9,内核4.9.0-3-amd64,initramfs-tools版本0.130

问题

今天忍不住尝鲜,把Debian8升级到9,重启之后第一个问题就是,进入Grub2后,屏幕只显示一个光标在闪,卡了好一会,弹出提示

1
Gave up waiting for suspend/resume device.

然后才开始继续运行。

谷歌查到原因是,由于我关了swap分区,开机的时候swapon尝试使用启动swap分区,找了半天,然后才提示失败。

尝试(失败)

编辑文件/etc/initramfs-tools/conf.d/resume

1
2
#RESUME=UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
RESUME=none

已经测试,上述方法无效。故还是建了一个文件当swap。

1
2
3
4
sudo dd if=/dev/zero of=/PATH/FILENAME bs=1024 count=SIZE
sudo chmod 600 /PATH/FILENAME
sudo mkswap /PATH/FILENAME
sudo swapon /PATH/FILENAME

编辑/etc/fstab(使用swap文件的话不能用uuid=xxx)

1
/PATH/FILENAME none swap sw 0 0

编辑/etc/initramfs-tools/conf.d/resume

1
RESUME=UUID=xxxxxxx

解决

上面的尝试在于少了一步,没有重新生成ramfs,也就是说,解决步骤是

(1)编辑/etc/initramfs-tools/conf.d/resume

1
RESUME=none

(2)命令行执行

1
2
sudo update-initramfs
sudo update-grub

参考资料

linux - Deleted a partition, now getting ‘Gave up waiting for suspend/resume device’ message during boot - Super User

Gave up waiting for suspend/resume device : debian

#860543 - initramfs-tools: boot delayed by 30sec waiting for suspend/resume device - Debian Bug report logs

Swap - Debian Wiki

[SOLVED] Gave up waiting for root device