Outils pour utilisateurs

Outils du site


francois:hibernation

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Prochaine révision
Révision précédente
francois:hibernation [2025/10/18 08:41] – créée francoisfrancois:hibernation [2025/10/18 09:19] (Version actuelle) – francois
Ligne 1: Ligne 1:
 ====== Comment activer l'hibernation avec l'install de base CachyOS ====== ====== Comment activer l'hibernation avec l'install de base CachyOS ======
 +
 +===== Procédure =====
  
  
Ligne 9: Ligne 11:
 Steps to enable hibernation Steps to enable hibernation
  
-    Create a subvolume for your swapfile+Create a subvolume for your swapfile
  
     sudo btrfs subvolume create /swap     sudo btrfs subvolume create /swap
  
-    Calculate the size of your swapfile+Calculate the size of your swapfile
  
-    It’s your zram size + your RAM size. You can see the size of your zram with:+It’s your zram size + your RAM size. You can see the size of your zram with:
  
     swapon --show     swapon --show
  
-    Mine was 30GB and my RAM size is 30GB, so my swapfile needs to be 60GB. That’s a lot of space, but for me not a problem.+Mine was 30GB and my RAM size is 30GB, so my swapfile needs to be 60GB. That’s a lot of space, but for me not a problem.
  
-    Create the swapfile+Create the swapfile
  
     sudo btrfs filesystem mkswapfile --size 60g --uuid clear /swap/swapfile     sudo btrfs filesystem mkswapfile --size 60g --uuid clear /swap/swapfile
  
-    Find the UUID of the (virtual) device where the swapfile resides, copy it for later use+Find the UUID of the (virtual) device where the swapfile resides, copy it for later use
  
     sudo findmnt -no UUID -T /swap/swapfile     sudo findmnt -no UUID -T /swap/swapfile
  
-    You will get something like 58239ee3-aa2b-32ef-b7b2-2f591ee2251b+You will get something like 58239ee3-aa2b-32ef-b7b2-2f591ee2251b
  
-    Aquire swap file offset, copy it for later use+Aquire swap file offset, copy it for later use
  
     sudo btrfs inspect-internal map-swapfile -r /swap/swapfile     sudo btrfs inspect-internal map-swapfile -r /swap/swapfile
  
-    You will something like 52635+You will something like 52635
  
-    Add kernel parameters you acquired is step 4 and 5+Add kernel parameters you acquired is step 4 and 5
  
-    Edit the file /etc/sdboot-manage.conf and add resume=UUID=step 4 and resume_offset=step 5 in LINUX_OPTIONS=. It will look something like this:+Edit the file /etc/sdboot-manage.conf and add resume=UUID=step 4 and resume_offset=step 5 in LINUX_OPTIONS=. It will look something like this:
  
     LINUX_OPTIONS="zswap.enabled=0 resume=UUID=58239ee3-aa2b-32ef-b7b2-2f591ee2251b resume_offset=52635 nowatchdog splash"     LINUX_OPTIONS="zswap.enabled=0 resume=UUID=58239ee3-aa2b-32ef-b7b2-2f591ee2251b resume_offset=52635 nowatchdog splash"
  
-    Regenerate all systemd-boot entries with the following command+Regenerate all systemd-boot entries with the following command
  
     sudo sdboot-manage gen     sudo sdboot-manage gen
  
-    Configure initramfs - add resume hook+Configure initramfs - add resume hook
  
-    Edit the file /etc/mkinitcpio.conf and add resume into HOOKS= It must be after udev and encrypt. It will look something like this:+Edit the file /etc/mkinitcpio.conf and add resume into HOOKS= It must be after udev and encrypt. It will look something like this:
  
     HOOKS=(base udev autodetect microcode kms modconf block keyboard keymap consolefont plymouth encrypt resume filesystems)     HOOKS=(base udev autodetect microcode kms modconf block keyboard keymap consolefont plymouth encrypt resume filesystems)
  
-    Regenerate initramfs+Regenerate initramfs
  
     sudo mkinitcpio -P     sudo mkinitcpio -P
  
-    Add swapfile to fstab with low priority+Add swapfile to fstab with low priority
  
-    Edit the file /etc/fstab and add on the last line:+Edit the file /etc/fstab and add on the last line:
  
     /swap/swapfile none swap defaults,pri=0 0 0     /swap/swapfile none swap defaults,pri=0 0 0
  
-    Enable swap on running system+Enable swap on running system
  
     sudo swapon /swap/swapfile     sudo swapon /swap/swapfile
- +Check if swap is enabled
-    Check if swap is enabled+
  
     swapon --show     swapon --show
  
-    You should now see something like+You should now see something like
  
     NAME           TYPE       SIZE USED PRIO     NAME           TYPE       SIZE USED PRIO
Ligne 77: Ligne 78:
     /dev/zram0     partition 30,7G 6,3M  100     /dev/zram0     partition 30,7G 6,3M  100
  
-    Reboot your system+Reboot your system
  
 After reboot, hibernation should be enabled in the settings of your Desktop Environment (if you use one). You can also test it on the command line with: After reboot, hibernation should be enabled in the settings of your Desktop Environment (if you use one). You can also test it on the command line with:
Ligne 86: Ligne 87:
 If you’re a fan of suspend-then-hibernate, like me (ideal for laptops if you ask me), you should edit the file /etc/systemd/sleep.conf, remove the # in front of HibernateDelaySec= and add the number of seconds. I have 7200 seconds (2 hours). You also need to configure it in your Desktop Environment after that. Gnome has no setting for that, but KDE Plasma (Settings-Power Managment) does. If you’re a fan of suspend-then-hibernate, like me (ideal for laptops if you ask me), you should edit the file /etc/systemd/sleep.conf, remove the # in front of HibernateDelaySec= and add the number of seconds. I have 7200 seconds (2 hours). You also need to configure it in your Desktop Environment after that. Gnome has no setting for that, but KDE Plasma (Settings-Power Managment) does.
  
 +<code>
 /etc/systemd/sleep.conf /etc/systemd/sleep.conf
  
Ligne 99: Ligne 101:
 #HibernateOnACPower=yes #HibernateOnACPower=yes
 #SuspendEstimationSec=60min #SuspendEstimationSec=60min
 +</code>
 +
 Sources used: Sources used:
  
-Boot Manager Configuration in CachyOS +  * Boot Manager Configuration in CachyOS 
- +  * Suspend and Hibernate at ArchWiki 
-Suspend and Hibernate at ArchWiki +  * BTRFS at ArchWiki 
- +  * Framework Community 
-BTRFS at ArchWiki+  * Disable/Enable modules pre-post hibernation in linux
  
-Framework Community+===== Résolution des problèmes =====
  
-Disable/Enable modules pre-post hibernation in linux +==== Le système se réveille immédiatement après hibernation ====
-zcfan for OpenRC +
-Blog+
  
-    OPNsense dnsmasq + UniFi adoption (option 43)  
-    OPNsense with KPN fiber and iTV  
-    Disable/Enable modules pre-post hibernation in linux  
-    Enable hibernation in CachyOS alongside zram swap with full disk encryption on BTRFS  
-    zcfan for OpenRC  
-    Thinkfan for OpenRC  
-    PiTemps  
-    ZFS Health script  
  
-Logo Meganerd.nl 
-Privacy Policy 
  
-© 2025 Meganerd.nl+Il faut blacklister le module ''intel_hid''
  
francois/hibernation.1760776895.txt.gz · Dernière modification : de francois

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki