- 问题
- 配置swapfile
- HOOKS
- This is the most important setting in this file. The HOOKS control the
- order in which HOOKS are added. Run ‘mkinitcpio -H
‘ for - HOOKS=(base)
- HOOKS=(base udev autodetect block filesystems)
- HOOKS=(base udev block filesystems)
- HOOKS=(base udev block mdadm encrypt filesystems)
- HOOKS=(base udev block lvm2 filesystems)
- HOOKS
- This is the most important setting in this file. The HOOKS control the
- order in which HOOKS are added. Run ‘mkinitcpio -H
‘ for - HOOKS=(base)
- HOOKS=(base udev autodetect block filesystems)
- HOOKS=(base udev block filesystems)
- HOOKS=(base udev block mdadm encrypt filesystems)
- HOOKS=(base udev block lvm2 filesystems)
问题
笔记本装的manjaro锁屏一段时间后无法唤醒,电源灯还是亮着的;
休眠功能像关机一样
配置swapfile
参考文档
manjaro休眠功能修复_宇哥是个技术宅-CSDN博客_manjaro休眠无法唤醒
linux定时休眠 - 暗无天日
- 使用swapfile,设置的是物理内存的3/5大小
- 配置swapfie ```shell ~ du -sh /swapfile ✔ 6.7G /swapfile ~ swapon ✔ NAME TYPE SIZE USED PRIO /swapfile file 6.7G 0B -2 ~ df /swapfile ✔ 文件系统 容量 已用 可用 已用% 挂载点 /dev/sda4 96G 25G 66G 28% /
~ sudo filefrag -v /swapfile| head -6 ✔
Filesystem type is: ef53
File size of /swapfile is 7168000000 (1750000 blocks of 4096 bytes)
ext: logical_offset: physical_offset: length: expected: flags:
0: 0.. 2047: 5167104.. 5169151: 2048:
1: 2048.. 4095: 5173248.. 5175295: 2048: 5169152:
2: 4096.. 6143: 5179392.. 5181439: 2048: 5175296:
~ sudo sed -i ‘/GRUB_CMDLINE_LINUX_DEFAULT/ s!”$! resume=/dev/sda4 resume_offset=5167104”!’ /etc/default/grub ✔
✔
~ grep GRUB_CMDLINE_LINUX_DEFAULT /etc/default/grub INT ✘
GRUB_CMDLINE_LINUX_DEFAULT=”quiet udev.log_priority=3 resume=/dev/sda4 resume_offset=5167104”
~ sudo update-grub 1 ✘ 正在生成 grub 配置文件 … 找到主题:/usr/share/grub/themes/manjaro/theme.txt 找到 Linux 镜像:/boot/vmlinuz-5.4-x86_64 找到 initrd 镜像:/boot/intel-ucode.img /boot/initramfs-5.4-x86_64.img Found initrd fallback image: /boot/initramfs-5.4-x86_64-fallback.img 找到 Linux 镜像:/boot/vmlinuz-4.14-x86_64 找到 initrd 镜像:/boot/intel-ucode.img /boot/initramfs-4.14-x86_64.img Found initrd fallback image: /boot/initramfs-4.14-x86_64-fallback.img 警告: os-prober will be executed to detect other bootable partitions. Its output will be used to detect bootable binaries on them and create new boot entries. 找到 Windows Boot Manager 位于 /dev/nvme0n1p1@/EFI/Microsoft/Boot/bootmgfw.efi Adding boot menu entry for UEFI Firmware Settings … Found memtest86+ image: /boot/memtest86+/memtest.bin 完成
~ grep “HOOKS” /etc/mkinitcpio.conf ✔
HOOKS
This is the most important setting in this file. The HOOKS control the
order in which HOOKS are added. Run ‘mkinitcpio -H ‘ for
HOOKS=(base)
HOOKS=(base udev autodetect block filesystems)
HOOKS=(base udev block filesystems)
HOOKS=(base udev block mdadm encrypt filesystems)
HOOKS=(base udev block lvm2 filesystems)
HOOKS=”base udev autodetect modconf block keyboard keymap filesystems fsck”
~ sudo nano /etc/mkinitcpio.conf ✔ ~ grep “HOOKS” /etc/mkinitcpio.conf ✔ 55s
HOOKS
This is the most important setting in this file. The HOOKS control the
order in which HOOKS are added. Run ‘mkinitcpio -H ‘ for
HOOKS=(base)
HOOKS=(base udev autodetect block filesystems)
HOOKS=(base udev block filesystems)
HOOKS=(base udev block mdadm encrypt filesystems)
HOOKS=(base udev block lvm2 filesystems)
HOOKS=”base udev resume autodetect modconf block keyboard keymap filesystems fsck”
~ ls /boot/ 1 ✘ efi initramfs-4.14-x86_64-fallback.img initramfs-5.4-x86_64-fallback.img intel-ucode.img linux54-x86_64.kver vmlinuz-4.14-x86_64 grub initramfs-4.14-x86_64.img initramfs-5.4-x86_64.img linux414-x86_64.kver memtest86+ vmlinuz-5.4-x86_64
~ mkinitcpio -p linux54 1 ✘ ==> Building image from preset: /etc/mkinitcpio.d/linux54.preset: ‘default’ -> -k /boot/vmlinuz-5.4-x86_64 -c /etc/mkinitcpio.conf -g /boot/initramfs-5.4-x86_64.img ==> ERROR: Unable to write to /boot/initramfs-5.4-x86_64.img ==> Building image from preset: /etc/mkinitcpio.d/linux54.preset: ‘fallback’ -> -k /boot/vmlinuz-5.4-x86_64 -c /etc/mkinitcpio.conf -g /boot/initramfs-5.4-x86_64-fallback.img -S autodetect ==> ERROR: Unable to write to /boot/initramfs-5.4-x86_64-fallback.img ~ ls /boot/initramfs-5.4-x86_64.img 1 ✘ /boot/initramfs-5.4-x86_64.img ~ sudo mkinitcpio -p linux54 ✔ [sudo] yx 的密码: ==> Building image from preset: /etc/mkinitcpio.d/linux54.preset: ‘default’ -> -k /boot/vmlinuz-5.4-x86_64 -c /etc/mkinitcpio.conf -g /boot/initramfs-5.4-x86_64.img ==> Starting build: 5.4.150-1-MANJARO -> Running build hook: [base] -> Running build hook: [udev] -> Running build hook: [resume] -> Running build hook: [autodetect] -> Running build hook: [modconf] -> Running build hook: [block] -> Running build hook: [keyboard] -> Running build hook: [keymap] loadkeys: Unable to open file: cn: No such file or directory -> Running build hook: [filesystems] -> Running build hook: [fsck] ==> Generating module dependencies ==> Creating gzip-compressed initcpio image: /boot/initramfs-5.4-x86_64.img ==> Image generation successful ==> Building image from preset: /etc/mkinitcpio.d/linux54.preset: ‘fallback’ -> -k /boot/vmlinuz-5.4-x86_64 -c /etc/mkinitcpio.conf -g /boot/initramfs-5.4-x86_64-fallback.img -S autodetect ==> Starting build: 5.4.150-1-MANJARO -> Running build hook: [base] -> Running build hook: [udev] -> Running build hook: [resume] -> Running build hook: [modconf] -> Running build hook: [block] -> Running build hook: [keyboard] -> Running build hook: [keymap] loadkeys: Unable to open file: cn: No such file or directory -> Running build hook: [filesystems] -> Running build hook: [fsck] ==> Generating module dependencies ==> Creating gzip-compressed initcpio image: /boot/initramfs-5.4-x86_64-fallback.img ==> Image generation successful ```
