How to hibernate laptop with Lubuntu 14.04?

Please post all general support questions for LXDE here.
Locked
euroblue
Posts: 3
Joined: Fri Aug 08, 2014 7:31 am
Contact:

How to hibernate laptop with Lubuntu 14.04?

Post by euroblue »

Hi,
how can I hibernate my laptop with Lubuntu 14.04? When I try it to do in "Logout Lubuntu 14.04 session" dialog window I see message:

Code: Select all

GDBus.Error:org.freedesktop.DBus.Error.Failed: Operation not supported
I spent some time with this problem and found that it can be something with encrypted disk. When i run command

Code: Select all

swapon --summary
I see nothing specific respectively just this:

Code: Select all

root@WORK:~# swapon --summary
Filename				Type		Size	Used	Priority
root@WORK:~#
rvan2012
Posts: 2
Joined: Mon Aug 18, 2014 1:31 pm

Re: How to hibernate laptop with Lubuntu 14.04?

Post by rvan2012 »

That response to the swapon command means you don't have swap space, so it definitely isn't encrypted. OTOH it also means you can't hibernate, as that requires a swap partition, one at least as large as your RAM. I haven't had to add swap space after installation so i can't make recommendations on the technique except to google "add swap partition linux" or something like that and see what turns up.

EIther way you can check if hibernate is enabled with :

Code: Select all

dbus-send --system --dest=org.freedesktop.UPower --print-reply /org/freedesktop/UPower org.freedesktop.DBus.Properties.Get string:"UPower" string:"CanHibernate"
or if you have qdbus installed

Code: Select all

qdbus --system org.freedesktop.UPower /org/freedesktop/UPower org.freedesktop.UPower.CanHibernate
Other References:
How-To Geek
Ubuntu Help
euroblue
Posts: 3
Joined: Fri Aug 08, 2014 7:31 am
Contact:

Re: How to hibernate laptop with Lubuntu 14.04?

Post by euroblue »

rvan2012 wrote:That response to the swapon command means you don't have swap space,
Thank you for an answer! I also realised that I need to set up swap space. Here is tutorial which I wrote on this topis. Hope it helps somebody:

As I wrote I have on my computer dual boot Lubuntu and Win (I have recently installed Lubuntu because I don't like direction of Windows development) and I found that there are few things which doesn't work as I'm used. One of them is hibernation. I don't know if it's because my specific configuration (dual boot) or it's a default setting, but you need to configure hibernation in Lubuntu 14.04 manually.

How to manually configure hibernation in Ubuntu, Lubuntu, Xubuntu, Kubuntu 14.04


Firts of all, make sure you have defined a swap partition (basic advice from this great post). If you don't know what is swap read http:/help.ubuntu.com/community/SwapFaq from Ubuntu.com faq (we will use that page for purpose of tutorial).

Run swapon -s to find out if you have swap enabled. You should see something like this:

Filename Type Size Used Priority
/dev/sda7 partition 2096124 0 -1


Originally I saw only first line so I realized that I need to set up the swap space.

How to set up the swap space?


Download Gparted (it's similar program like Partition Magic for Win) with command sudo apt-get install gparted. Here is great video tutorial how to do it made by EasyLearnTips.com.

Run command less /proc/meminfo to find out size of your computer RAM. First line of my output was MemTotal: 2054736 kB (bit calculator says it's 2006MB, almost 2GB).

Open Gparted (it's installed under System tools) and take 2048MB (2GB) from some disk partition with free space. I took 2GB of "free space" from Windows Disk C. Warning: Every time when you deal with a disk create a back-up!

Right click on "free space" partition > "Format to" > linux-swap. Apply all changes. It will take a while so go to kitchen and clean some dishes.

When is everything done right click on newly created linux-swap partition > Informations > Get UUID (my is a6d4c93d-85f2-4c08-9a80-a1e18264846e) and reboot.

Swap space is created and not we need to activate it on startup


Run gksu gedit /etc/fstab a add into new line UUID=a6d4c93d-85f2-4c08-9a80-a1e18264846e none swap sw 0 0 (don't forget to use your own UUID) and save the file.

2. Enable new partition with command sudo swapon --all and check if it's really works with swapon -s. Reboot to make sure it starts when you turn on computer (swapon -s).

And now 2 last steps and Lubuntu hibernation will start to work. Run gksu gedit /etc/default/grub and find GRUB_CMDLINE_LINUX="". Change it to GRUB_CMDLINE_LINUX="resume=UUID=a6d4c93d-85f2-4c08-9a80-a1e18264846e" and save it.

Run sudo update-grub

Run gksu gedit /etc/initramfs-tools/conf.d/resum and make sure that it contains resume=UUID=a6d4c93d-85f2-4c08-9a80-a1e18264846e (your own UUID, remember) and save the file.

Run sudo update-initramfs -u and reboot.



That's it


You just set up hibernation for Lubuntu 14.04 (and also for Ubuntu 14.04, Xubuntu 14.04 and Kubuntu 14.04).

Update: Whereas you made changes to Disk C and things went wrong you see some strange error message when you try to access disk C. You didn't make a backup and therefore you are starting to be really nervous. Don't worry just run a command sudo ntfsfix /dev/sda5 which will fix your broken NTFS partition (sda5 is nick name of Disk C in my Lubuntu, your nick can be found in gparted > disk C > right click > information).
Locked