The officially official Devuan Forum!

You are not logged in.

#1 2023-09-08 17:30:41

nixer
Member
From: North Carolina, USA
Registered: 2016-11-30
Posts: 211  

How to Hibernate and Suspend

The following information was taken mostly from the following link:

https://askubuntu.com/questions/848698/ … nux-distro

Situation:  Computers have this thing called power saving using Hibernation and Suspend.  I had never used it because, well, I never configured it correctly - but I really did not try very hard.  For a lot of years, I always left the computer running all day and would sometimes shut it down at night.  My local utility raised the electricity rates recently, so I thought I would try a little harder.

Result:  I have Hibernation and Suspend working flawless and upon waking up the system by either pressing the power button or typing a key on the keyboard or wiggling the mouse the system works perfectly.  Even if I save the system state with virtual machines running, they too will work perfectly.

How to configure for Hibernate/Suspend, taken from other devuan sources - mainly from dev1galaxy.org:
My system started as chimaera and was upgraded to daedalus.
- Create a swap partition as least as large as your current amount or RAM.
- Configure your system to use this partition as your swap area.
- at terminal run "blkid" to get the uuid info for this partition
- Add this swap partition to fstab
   

UUID=12345-your-uuid none    swap    sw    0    0

- Add entry to /etc/initramfs-tools/conf.d/resume
   

RESUME=UUID=12345-your-uuid

- Update initramfs with:
   

update-initramfs -u

-    reboot

This should get the Hibernation and Suspend working from the xfce menu.  In my case, I had a problem getting the system to wake up by pressing a keyboard key or moving the mouse.  Pressing the system power button worked fine.  I then found the link above and ran two commands to get some system information, and then made an entry to the /etc/rc.local file.

Command #1, as root: 
   

grep . /sys/bus/usb/devices/*/product

This will produce output that looks like this, as it will list your usb devices.  My usb keyboard and mouse were the bottom two:

/sys/bus/usb/devices/1-3/product:ASM107x
/sys/bus/usb/devices/1-4/product:HD Pro Webcam C920
/sys/bus/usb/devices/1-5/product:USB Receiver
/sys/bus/usb/devices/1-6/product:USB Receiver

Command #2, as root:
   

grep . /sys/bus/usb/devices/*/power/wakeup

This will list the devices and whether they will be allowed to wake the system:
Note: all of mine were disabled, which is why they were not waking up the system.

/sys/bus/usb/devices/1-3/power/wakeup:disabled
/sys/bus/usb/devices/1-5/power/wakeup:disabled
/sys/bus/usb/devices/1-6/power/wakeup:disabled

In my case, I wanted my usb keyboard and usb mouse to wake the system, so I added this to my /etc/rc.local file:
echo enabled > /sys/bus/usb/devices/1-5/power/wakeup
echo enabled > /sys/bus/usb/devices/1-6/power/wakeup

Note: 
In daedalus I had to add "sleep 30" to the  /etc/rc.local  to get it to work:

So the related contents of the rc.local file is:

sleep 30
echo enabled > /sys/bus/usb/devices/1-5/power/wakeup
echo enabled > /sys/bus/usb/devices/1-6/power/wakeup

Now, when I step away from the system and I don't know when I will return, I simply Menu > Logout > Suspend.  When I shut it down at night, I Menu > Logout > Hibernate.  These could be shortened with a script added to the desktop.

This works flawlessly now and has for over a year.  Hope this helps someone.

Offline

Board footer