swap: try to make swapfile working on btrfs
Since F35, the swap service started failing with: kernel: BTRFS warning (device nvme0n1p5): swapfile must not be copy-on-write swapon[2976986]: swapon: /swap: swapon failed: Invalid argument swap.swap: Swap process exited, code=exited, status=255/EXCEPTION
This commit is contained in:
parent
104fb66c9c
commit
415731c1ac
1 changed files with 9 additions and 0 deletions
|
@ -2,6 +2,15 @@
|
|||
# swap_file_size_mb
|
||||
# swap_file_path
|
||||
|
||||
- name: Touch an empty file that we will use for swap
|
||||
file:
|
||||
path: "{{ swap_file_path }}"
|
||||
state: touch
|
||||
|
||||
- name: On BTRFS we need NoCOW
|
||||
file: path="{{ swap_file_path }}"
|
||||
attr: +C
|
||||
|
||||
- name: Create swap file
|
||||
command:
|
||||
cmd: "dd if=/dev/zero of={{ swap_file_path }} bs=1024 count={{ swap_file_size_mb }}k"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue