Skip to content

Fix swap creation issue #1402

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Aug 9, 2024
Merged

Conversation

olexiyb
Copy link
Contributor

@olexiyb olexiyb commented Jul 9, 2024

wrap swap creation with transactional-update --continue shell to fix the issue of missing swap after node reboot fix for #1399

I see the proper transaction with 4Gb used for swap

# snapper list
 # │ Type   │ Pre # │ Date                     │ User │ Used Space │ Cleanup │ Description           │ Userdata
───┼────────┼───────┼──────────────────────────┼──────┼────────────┼─────────┼───────────────────────┼─────────
0  │ single │       │                          │ root │            │         │ current               │
1  │ single │       │ Sat Jun 29 19:42:50 2024 │ root │  80.40 MiB │         │ first root filesystem │
2  │ single │       │ Tue Jul  2 06:03:26 2024 │ root │  14.76 MiB │ number  │ Snapshot Update of #1 │
3- │ single │       │ Tue Jul  2 06:04:01 2024 │ root │ 352.00 KiB │ number  │ Snapshot Update of #2 │
4+ │ single │       │ Tue Jul  9 07:04:59 2024 │ root │   4.00 GiB │ number  │ Snapshot Update of #3 │

More info about swap creation in micros

Creating_a_btrfs_swapfile and openSUSE:Snapper_Tutorial#Swapfile

Due to issue we need to somehow run swapon -a after reboot
to solve

swapon: /var/lib/swap/swapfile: swapon failed: Read-only file system

I use systemd script

@olexiyb olexiyb marked this pull request as draft July 9, 2024 10:57
@olexiyb olexiyb marked this pull request as ready for review July 9, 2024 14:13
Copy link
Collaborator

@mysticaltech mysticaltech left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@olexiyb Looking good, just one tiny change, and please also confirm that this is well tested and the swap on activation service works.

Copy link
Collaborator

@mysticaltech mysticaltech left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! Thanks @olexiyb

@mysticaltech mysticaltech merged commit 7833181 into kube-hetzner:master Aug 9, 2024
3 checks passed
@olexiyb olexiyb deleted the fix-swap-creation branch August 14, 2024 17:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants