You are not logged in.
Hey folks,
I wanted to configure hibernate for my Framework13 AMD 7640U, but I am struggling.
Filesystem is BTRFS.
I have already a ZRAM device from the archinstall iso.
But I configured a swap file and changed priority. However, I must be missing something. Maybe you can point me into the right direction.
lsblk -f
NAME FSTYPE FSVER LABEL UUID FSAVAIL FSUSE% MOUNTPOINTS
zram0 swap 1 zram0 f937b0ae-0623-4fbd-a20c-3882a2fb651a [SWAP]
nvme0n1
├─nvme0n1p1 vfat FAT32 00D4-6B8D 648.7M 37% /boot
└─nvme0n1p2 crypto_LUKS 2 efd8318b-bf8c-490c-bf14-7040c591a26a
└─root btrfs 73a2074f-404e-41b7-b2ec-e527fbeede5c 1.6T 14% /var/log
/home
/var/cache/pacman/pkg
/swap
/
swapon --show
NAME TYPE SIZE USED PRIO
/dev/zram0 partition 4G 0B 100
/swap/swapfile file 48G 0B 200
Here is my
/etc/default/grub
GRUB_CMDLINE_LINUX_DEFAULT="loglevel=3 quiet resume=73a2074f-404e-41b7-b2ec-e527fbeede5c resume_offset=39460324"
GRUB_CMDLINE_LINUX="cryptdevice=UUID=efd8318b-bf8c-490c-bf14-7040c591a26a:root zswap.enabled=0 rootfstype=btrfs resume=73a2074f-404e-41b7-b2ec-e527fbeede5c resume_offset=39460324"
/etc/mkinitcpio.conf
HOOKS=(base udev autodetect microcode modconf kms keyboard keymap consolefont block btrfs encrypt filesystems resume fsck)
When I try to hibernate I get this error:
Aug 24 00:33:03 framework systemctl[308164]: Call to Hibernate failed: Specified resume device is missing or is not an active swap device
I have done the setup via Ansible
- name: Ensure /swap mount point exists
ansible.builtin.file:
path: /swap
state: directory
mode: '0755'
- name: Create @swap
community.general.btrfs_subvolume:
name: "@swap"
filesystem_uuid: 73a2074f-404e-41b7-b2ec-e527fbeede5c
automount: true
- name: Ensure swapfile is mounted on boot
ansible.posix.mount:
path: /swap
src: "UUID=73a2074f-404e-41b7-b2ec-e527fbeede5c"
fstype: btrfs
opts: "subvol=@swap,compress=no,nodatacow"
state: mounted
- name: Create swapfile
command: btrfs filesystem mkswapfile --size 48g --uuid clear /swap/swapfile
args:
creates: /swap/swapfile
- name: Check if swapfile is already active
ansible.builtin.command: grep -qs '^/swap/swapfile' /proc/swaps
register: swap_active_check
failed_when: false
changed_when: false
check_mode: no
- name: Activate the swapfile
ansible.builtin.command: swapon --discard --priority 200 /swap/swapfile
when: swap_active_check.rc != 0
- name: Get the physical offset of the btrfs swapfile
ansible.builtin.command: btrfs inspect-internal map-swapfile -r /swap/swapfile
register: swap_offset
changed_when: false
check_mode: no
- name: Create GRUB config from template
ansible.builtin.template:
src: grub.j2
dest: /etc/default/grub
owner: root
group: root
mode: '0644'
notify:
- Regenerate GRUB config
vars:
filesystem_uuid: 73a2074f-404e-41b7-b2ec-e527fbeede5c
- name: Set the live kernel resume offset for the current session
ansible.builtin.shell: "echo {{ swap_offset.stdout }} > /sys/power/resume_offset"
changed_when: false
when: swap_offset.stdout is defined and swap_offset.stdout != ""
- name: Create mkinitcpio config from template
ansible.builtin.template:
src: mkinitcpio.j2
dest: /etc/mkinitcpio.conf
owner: root
group: root
mode: '0644'
notify:
- Regenerate initramfs
Offline