Blog de videotutoriales, videojuegos, hardware, software, informática y tecnologíaBlog de videotutoriales, videojuegos, hardware, software, informática y tecnologíaBlog de videotutoriales, videojuegos, hardware, software, informática y tecnologíaBlog de videotutoriales, videojuegos, hardware, software, informática y tecnología

✕

MENTA ZEN
  • Home
  • Tutorials
  • How to enable hibernation in Bazzite Linux

How to enable hibernation in Bazzite Linux

PHASE 1: Create the swap subvolume for hibernation.

Create a swap subvolume (for example, due to Snapper):

sudo btrfs subvolume create /var/swap sudo semanage fcontext -a -t var_t /var/swap sudo restorecon /var/swap

Create swap file (size should be equal to or greater than your PC’s RAM):

SIZE=26G sudo btrfs filesystem mkswapfile --size $SIZE /var/swap/swapfile sudo semanage fcontext -a -t swapfile_t /var/swap/swapfile sudo restorecon /var/swap/swapfile

Sanity check validation:

sudo swapon /var/swap/swapfile

Backup your fstab file with:

sudo cp /etc/fstab /etc/fstab.bak

Then, edit fstab with this command:

sudo nano /etc/fstab

Then add the following line of code to fstab:

/var/swap/swapfile none swap defaults,nofail 0 0

Disable zram:

echo "" | sudo tee /etc/systemd/zram-generator.conf

Reboot.

In case of any error, you can restore from your backup with this:

sudo cp /etc/fstab.bak /etc/fstab

Revert changes and restore zram. If you want to restore the default, copy zram-generator.conf from /usr/etc/systemd/zram-generator.conf:

sudo cp /usr/etc/systemd/zram-generator.conf /etc/systemd/zram-generator.conf

PHASE 2: Tell the system where to find the hibernation volume.

Verify that the swapfile is active (should show path and size):

cat /proc/swaps

Get the UUID of the partition containing /var (should display an alphanumeric code):

findmnt -no UUID -T /var/swap/swapfile

Get the offset of the swapfile in Btrfs (should display a numeric code, we’ll need it for resume_offset):

sudo btrfs inspect-internal map-swapfile -r /var/swap/swapfile

Add parameters to the kernel (Bazzite uses rpm-ostree) Replace <UUID> and <OFFSET> with what you got earlier and remove the <> symbols:

sudo rpm-ostree kargs --append-if-missing="resume=UUID=<UUID>" --append-if-missing="resume_offset=<OFFSET>"

Reboot the system:

systemctl reboot

Check that the parameters are active (You should see resume=UUID=… resume_offset=… in the line.):

cat /proc/cmdline

KDE should show the “Hibernate” option in the shutdown menu.

Part of the content taken from https://docs.bazzite.gg/Advanced/swapfile/

Related topics

Module 6.4 Elementor: Designing professional headers and footers


See more

Module 6.3 Elementor: Essential widgets and mastering the structure


See more

Module 6.2 Elementor: Getting started with the Elementor editor


See more

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Made with 💔 in Europe
Free Palestine
LGBTQ+ friendly
Technology, code, retro vibes, and free thinking until the adventure ends.
Exploring bits and pixels since 2012.
EnglishEnglish▼
  • EspañolEspañol
  • FrançaisFrançais
  • PortuguêsPortuguês

Web development:
Freelance Web Developer

    • Mentazen.com - News, videogames, tutorials, web and retro!