Hello everybody, I’am a Chinese student using Manjaro, the question I asked above makes me confusing, so I really need your help so that I can solve my problem. Besides, my english is not very well, therefore, please feel free to ask me about any thing if I didn’t describe clearly in the below, thank you very much!
-
I’am currently using the latest version of Manjaro, and it’s kernal is “x86_64 Linux 5.13.19-2-MANJARO”
-
Because of don’t want to open too much softwares and drop them to the position I want, so I really need the hibernation function.
-
I prefer using swap file instead of swap partition owing to the size of the swap file can be change easily in the future.
-
Although as a manjaro user, I have readed the description in ArchWiki.
-
What I have done all are listed in the below.
-
Firstly, I checked the version of btrfs by running
btrfs --version
, and I gotbtrfs-progs v5.14.2
. -
After that, by running commands
sudo swapoff /swapfile
,sudo dd if=/dev/zero of=/swapfile bs=1M count=8192 status=progress
,sudo chmod 600 /swapfile
,sudo mkswap /swapfile
andsudo swapon /swapfile
, a 8GB swapfile was created. -
Then, I appended command
/swapfile none swap defaults 0 0
to the ‘/etc/fstab’ file, save and exit by running ‘:wq’. -
Besides, I have edited the file ‘/etc/default/grub’, only changed the line of ‘GRUB_CMDLINE_LINUX_DEFAULT’ existing to
GRUB_CMDLINE_LINUX_DEFAULT="quiet udev.log_priority=3 nowatchdog resume=UUID=f8913796-f929-449f-ad39-5f6884e648f7 resume_offset=1179648"
-
:wq
-
Finally,
sudo update-grub
-
After test, it’s failed…
-
If I have missed something or did wrong? Looking forward to anyone’s reply. thanks!
chinese:
Manjaro linux 如何配置系统休眠功能(交换到文件)?
- 我使用的最新 Manjaro 操作系统
- Kernel: x86_64 Linux 5.13.19-2-MANJARO
- 不想每次开机都需要重新打开很多软件,并将它们排列到合适的位置
- 所以想使用休眠(hibernation)功能
- 考虑到交换到文件而不是交换到分区,因为这样我可以方便地调整交换文件的大小
- 作为 manjaro 用户,我去蹭了 archwiki 上的相关说明,做了以下操作
- 首先,我检查了btrfs的版本,确认它的版本超过5.0(文档中说低于5.0 不支持)
- 然后,由于我在装系统的时候点选了「交换到文件」这一选项,所以我已经有一个较小的 /swapfile,开机状态下它处于忙碌状态,所以我执行了
sudo swapoff /swapfile
- 接下来,由于我内存只有8G,所以我创建了8G容量的交换文件,并给它设置了权限,即执行
sudo dd if=/dev/zero of=/swapfile bs=1M count=8192 status=progress``和``sudo chmod 600 /swapfile
- 然后格式化它并让它生效,即执行
sudo mkswap /swapfile``和``sudo swapon /swapfile
- 然后我在 /etc/fstab 文件末尾追加了
/swapfile none swap defaults 0 0
并保存退出(给交换文件新增 fstab 的配置嘛) - 我查询了我系统磁盘分区的情况,如下图,然后对
/etc/default/grub
进行了设置,即将 GRUB_CMDLINE_LINUX_DEFAULT 所在行改为了GRUB_CMDLINE_LINUX_DEFAULT=“quiet udev.log_priority=3 nowatchdog resume=UUID=f8913796-f929-449f-ad39-5f6884e648f7 resume_offset=1179648” 保存退出 - 最后重新执行
sudo update-grub
重新生成 grub 的配置文件 - 重启电脑,打开两个软件,然后点击「休眠」按钮进行系统休眠
- 系统确实断电关闭,但是再次点按开机键,电源指示灯闪烁了一下,然后电脑没有任何反应,依然处于断电状态,再次点按开机键,系统开机,进入系统后是电脑刚重启的样子,并没有恢复到之前的工作环境,打开浏览器,提示我浏览器未正常关闭,是否恢复之前的浏览,实锤了,休眠没有配置成功
- 向互联网中隐藏的大佬请教!感激不尽!
Moderator edit: Email address removed