Fedora 27 - Laptop won't suspend when closing lidIssue with laptop screen when opening lidFedora 21 - Problem...

How to vertically align the three columns of my table top, top, middle

What are the uses and limitations of Persuasion, Insight, and Deception against other PCs?

Why aren’t emergency services using callsigns?

During the Space Shuttle Columbia Disaster of 2003, Why Did The Flight Director Say, "Lock the doors."?

How do I calculate the difference in lens reach between a superzoom compact and a DSLR zoom lens?

Why doesn't the "ch" pronunciation rule occur for words such as "durch" and "manchmal"?

Max Order of an Isogeny Class of Rational Elliptic Curves is 8?

Can I legally make a real mobile app based on a fictional app from a TV show?

How do we avoid CI-driven development...?

Accidentals - some in brackets, some not

How do I explain to a team that the project they will work on for six months will certainly be cancelled?

Plausibility of Ice Eaters in the Arctic

Why are the inside diameters of some pipe larger than the stated size?

Non-OR journals which regularly publish OR research

What is my malfunctioning AI harvesting from humans?

Is it incorrect to write "I rate this book a 3 out of 4 stars?"

Why did Gandalf use a sword against the Balrog?

How would I as a DM create a smart phone-like spell/device my players could use?

Infeasibility in mathematical optimization models

How to say "Third time lucky" in Latin

Does a code snippet compile? Or does it get compiled?

In Pokémon Go, why does one of my Pikachu have an option to evolve, but another one doesn't?

sed delete all the words before a match

Why isn’t SHA-3 in wider use?



Fedora 27 - Laptop won't suspend when closing lid


Issue with laptop screen when opening lidFedora 21 - Problem waking up after suspendPower button does not trigger suspend (nor anything)Can not suspend when lid closed, even if external display is connectedForce xfce4-power-manager to suspendMy Dell Latitude freezes upon suspending if libvirtd/virtlogd is runningHybrid-sleep fails with high memory usageHow does systemctl suspend work?Suspend delayed after lid closeHP x2 Notebook w/ detachable tablet that keeps waking from suspend






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







3















I am facing this rather bizarre situation. After shutting down my laptop by pushing the power button for a few seconds and powering it on again the "suspend when lid is closed" option isn't working.



So when I close the lid, the laptop powers off. The strange thing is that when I open the lid the laptop powers on! This is strange because I don't push any power button whatsoever!



I checked my /etc/systemd/logind.conf file, but the following lines are uncommented



HandleLidSwitch=suspend
HandleLidSwitchDocked=suspend


Any idea on what might be the issue?



I am pasting the entire logind.conf file, because it might be useful to locate the problem.



#  This file is part of systemd.
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
#
# Entries in this file show the compile time defaults.
# You can change settings by editing this file.
# Defaults can be restored by simply deleting this file.
#
# See logind.conf(5) for details.

[Login]
#NAutoVTs=6
#ReserveVT=6
#KillUserProcesses=no
#KillOnlyUsers=
#KillExcludeUsers=root
#InhibitDelayMaxSec=5
#HandlePowerKey=poweroff
#HandleSuspendKey=suspend
#HandleHibernateKey=hibernate
HandleLidSwitch=suspend
HandleLidSwitchDocked=suspend
#PowerKeyIgnoreInhibited=no
#SuspendKeyIgnoreInhibited=no
#HibernateKeyIgnoreInhibited=no
#LidSwitchIgnoreInhibited=yes
#HoldoffTimeoutSec=30s
#IdleAction=ignore
#IdleActionSec=30min
#RuntimeDirectorySize=10%
#RemoveIPC=yes
#UserTasksMax=12288


UPDATE-1



I upgraded my system to Fedora 27, but still the problem remains.
Any idea on how to solve it?



UPDATE-2



I tried @isapir answer, but it didn't work... More specifically





  1. $ swapon -s
    which gave



    Filename Type Size Used Priority
    /dev/dm-2 partition 7864316 0 -2



  2. Then I edited the /etc/default/grub file. On the entry about GRUB_CMDLINE_LINUX= there was "rd.lvm.lv=fedora/root rd.lvm.lv=fedora/swap rhgb quiet" which I changed to resume=/dev/dm-2


  3. To identify whether my system is UEFI or legacy I did $ sudo efibootmgr. The output was EFI variables are not supported on this system. which I guess means that I own a legacy system. So finally I did grub2-mkconfig -o /etc/grub2.cfg



Any idea on how to proceed?



UPDATE-3



I also checked the journal typing



sudo journalctl -b | grep "Feb 13" > journal.dat



but I am not sure what am I looking for. You can find the output here



Any idea on what's wrong?










share|improve this question






















  • 1





    IME, suspend is always fragile. What does the journal say about what's happening? Also F25 is no longer supported (or if it is, it's close to EOL). Have you tried upgrading to F27? Problems like this tend to be resolved with time, so older laptops tend to get "fixed", with newer models exhibiting problems.

    – NickD
    Jan 2 '18 at 13:57











  • Fedora 25 end-of-life December 12, 2017. I second the recommendation of doing an upgrade as the first step.

    – mattdm
    Jan 2 '18 at 22:05











  • @Nick : Thanks a lot for your comment! Although F25 is no longer supported, I don't think an upgrade solves the problem, but I will try it! Thanks!

    – Thanos
    Jan 5 '18 at 10:33











  • Do you see anything relevant in the journal?

    – mattdm
    Jan 8 '18 at 20:55











  • @mattdm : What do you mean? Which journal? *I am new to Fedora - I used to be an ubuntu user for many years.

    – Thanos
    Jan 9 '18 at 6:08


















3















I am facing this rather bizarre situation. After shutting down my laptop by pushing the power button for a few seconds and powering it on again the "suspend when lid is closed" option isn't working.



So when I close the lid, the laptop powers off. The strange thing is that when I open the lid the laptop powers on! This is strange because I don't push any power button whatsoever!



I checked my /etc/systemd/logind.conf file, but the following lines are uncommented



HandleLidSwitch=suspend
HandleLidSwitchDocked=suspend


Any idea on what might be the issue?



I am pasting the entire logind.conf file, because it might be useful to locate the problem.



#  This file is part of systemd.
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
#
# Entries in this file show the compile time defaults.
# You can change settings by editing this file.
# Defaults can be restored by simply deleting this file.
#
# See logind.conf(5) for details.

[Login]
#NAutoVTs=6
#ReserveVT=6
#KillUserProcesses=no
#KillOnlyUsers=
#KillExcludeUsers=root
#InhibitDelayMaxSec=5
#HandlePowerKey=poweroff
#HandleSuspendKey=suspend
#HandleHibernateKey=hibernate
HandleLidSwitch=suspend
HandleLidSwitchDocked=suspend
#PowerKeyIgnoreInhibited=no
#SuspendKeyIgnoreInhibited=no
#HibernateKeyIgnoreInhibited=no
#LidSwitchIgnoreInhibited=yes
#HoldoffTimeoutSec=30s
#IdleAction=ignore
#IdleActionSec=30min
#RuntimeDirectorySize=10%
#RemoveIPC=yes
#UserTasksMax=12288


UPDATE-1



I upgraded my system to Fedora 27, but still the problem remains.
Any idea on how to solve it?



UPDATE-2



I tried @isapir answer, but it didn't work... More specifically





  1. $ swapon -s
    which gave



    Filename Type Size Used Priority
    /dev/dm-2 partition 7864316 0 -2



  2. Then I edited the /etc/default/grub file. On the entry about GRUB_CMDLINE_LINUX= there was "rd.lvm.lv=fedora/root rd.lvm.lv=fedora/swap rhgb quiet" which I changed to resume=/dev/dm-2


  3. To identify whether my system is UEFI or legacy I did $ sudo efibootmgr. The output was EFI variables are not supported on this system. which I guess means that I own a legacy system. So finally I did grub2-mkconfig -o /etc/grub2.cfg



Any idea on how to proceed?



UPDATE-3



I also checked the journal typing



sudo journalctl -b | grep "Feb 13" > journal.dat



but I am not sure what am I looking for. You can find the output here



Any idea on what's wrong?










share|improve this question






















  • 1





    IME, suspend is always fragile. What does the journal say about what's happening? Also F25 is no longer supported (or if it is, it's close to EOL). Have you tried upgrading to F27? Problems like this tend to be resolved with time, so older laptops tend to get "fixed", with newer models exhibiting problems.

    – NickD
    Jan 2 '18 at 13:57











  • Fedora 25 end-of-life December 12, 2017. I second the recommendation of doing an upgrade as the first step.

    – mattdm
    Jan 2 '18 at 22:05











  • @Nick : Thanks a lot for your comment! Although F25 is no longer supported, I don't think an upgrade solves the problem, but I will try it! Thanks!

    – Thanos
    Jan 5 '18 at 10:33











  • Do you see anything relevant in the journal?

    – mattdm
    Jan 8 '18 at 20:55











  • @mattdm : What do you mean? Which journal? *I am new to Fedora - I used to be an ubuntu user for many years.

    – Thanos
    Jan 9 '18 at 6:08














3












3








3


1






I am facing this rather bizarre situation. After shutting down my laptop by pushing the power button for a few seconds and powering it on again the "suspend when lid is closed" option isn't working.



So when I close the lid, the laptop powers off. The strange thing is that when I open the lid the laptop powers on! This is strange because I don't push any power button whatsoever!



I checked my /etc/systemd/logind.conf file, but the following lines are uncommented



HandleLidSwitch=suspend
HandleLidSwitchDocked=suspend


Any idea on what might be the issue?



I am pasting the entire logind.conf file, because it might be useful to locate the problem.



#  This file is part of systemd.
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
#
# Entries in this file show the compile time defaults.
# You can change settings by editing this file.
# Defaults can be restored by simply deleting this file.
#
# See logind.conf(5) for details.

[Login]
#NAutoVTs=6
#ReserveVT=6
#KillUserProcesses=no
#KillOnlyUsers=
#KillExcludeUsers=root
#InhibitDelayMaxSec=5
#HandlePowerKey=poweroff
#HandleSuspendKey=suspend
#HandleHibernateKey=hibernate
HandleLidSwitch=suspend
HandleLidSwitchDocked=suspend
#PowerKeyIgnoreInhibited=no
#SuspendKeyIgnoreInhibited=no
#HibernateKeyIgnoreInhibited=no
#LidSwitchIgnoreInhibited=yes
#HoldoffTimeoutSec=30s
#IdleAction=ignore
#IdleActionSec=30min
#RuntimeDirectorySize=10%
#RemoveIPC=yes
#UserTasksMax=12288


UPDATE-1



I upgraded my system to Fedora 27, but still the problem remains.
Any idea on how to solve it?



UPDATE-2



I tried @isapir answer, but it didn't work... More specifically





  1. $ swapon -s
    which gave



    Filename Type Size Used Priority
    /dev/dm-2 partition 7864316 0 -2



  2. Then I edited the /etc/default/grub file. On the entry about GRUB_CMDLINE_LINUX= there was "rd.lvm.lv=fedora/root rd.lvm.lv=fedora/swap rhgb quiet" which I changed to resume=/dev/dm-2


  3. To identify whether my system is UEFI or legacy I did $ sudo efibootmgr. The output was EFI variables are not supported on this system. which I guess means that I own a legacy system. So finally I did grub2-mkconfig -o /etc/grub2.cfg



Any idea on how to proceed?



UPDATE-3



I also checked the journal typing



sudo journalctl -b | grep "Feb 13" > journal.dat



but I am not sure what am I looking for. You can find the output here



Any idea on what's wrong?










share|improve this question
















I am facing this rather bizarre situation. After shutting down my laptop by pushing the power button for a few seconds and powering it on again the "suspend when lid is closed" option isn't working.



So when I close the lid, the laptop powers off. The strange thing is that when I open the lid the laptop powers on! This is strange because I don't push any power button whatsoever!



I checked my /etc/systemd/logind.conf file, but the following lines are uncommented



HandleLidSwitch=suspend
HandleLidSwitchDocked=suspend


Any idea on what might be the issue?



I am pasting the entire logind.conf file, because it might be useful to locate the problem.



#  This file is part of systemd.
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
#
# Entries in this file show the compile time defaults.
# You can change settings by editing this file.
# Defaults can be restored by simply deleting this file.
#
# See logind.conf(5) for details.

[Login]
#NAutoVTs=6
#ReserveVT=6
#KillUserProcesses=no
#KillOnlyUsers=
#KillExcludeUsers=root
#InhibitDelayMaxSec=5
#HandlePowerKey=poweroff
#HandleSuspendKey=suspend
#HandleHibernateKey=hibernate
HandleLidSwitch=suspend
HandleLidSwitchDocked=suspend
#PowerKeyIgnoreInhibited=no
#SuspendKeyIgnoreInhibited=no
#HibernateKeyIgnoreInhibited=no
#LidSwitchIgnoreInhibited=yes
#HoldoffTimeoutSec=30s
#IdleAction=ignore
#IdleActionSec=30min
#RuntimeDirectorySize=10%
#RemoveIPC=yes
#UserTasksMax=12288


UPDATE-1



I upgraded my system to Fedora 27, but still the problem remains.
Any idea on how to solve it?



UPDATE-2



I tried @isapir answer, but it didn't work... More specifically





  1. $ swapon -s
    which gave



    Filename Type Size Used Priority
    /dev/dm-2 partition 7864316 0 -2



  2. Then I edited the /etc/default/grub file. On the entry about GRUB_CMDLINE_LINUX= there was "rd.lvm.lv=fedora/root rd.lvm.lv=fedora/swap rhgb quiet" which I changed to resume=/dev/dm-2


  3. To identify whether my system is UEFI or legacy I did $ sudo efibootmgr. The output was EFI variables are not supported on this system. which I guess means that I own a legacy system. So finally I did grub2-mkconfig -o /etc/grub2.cfg



Any idea on how to proceed?



UPDATE-3



I also checked the journal typing



sudo journalctl -b | grep "Feb 13" > journal.dat



but I am not sure what am I looking for. You can find the output here



Any idea on what's wrong?







linux fedora suspend laptop troubleshooting






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Feb 13 '18 at 6:44







Thanos

















asked Jan 2 '18 at 12:56









ThanosThanos

2252 silver badges12 bronze badges




2252 silver badges12 bronze badges











  • 1





    IME, suspend is always fragile. What does the journal say about what's happening? Also F25 is no longer supported (or if it is, it's close to EOL). Have you tried upgrading to F27? Problems like this tend to be resolved with time, so older laptops tend to get "fixed", with newer models exhibiting problems.

    – NickD
    Jan 2 '18 at 13:57











  • Fedora 25 end-of-life December 12, 2017. I second the recommendation of doing an upgrade as the first step.

    – mattdm
    Jan 2 '18 at 22:05











  • @Nick : Thanks a lot for your comment! Although F25 is no longer supported, I don't think an upgrade solves the problem, but I will try it! Thanks!

    – Thanos
    Jan 5 '18 at 10:33











  • Do you see anything relevant in the journal?

    – mattdm
    Jan 8 '18 at 20:55











  • @mattdm : What do you mean? Which journal? *I am new to Fedora - I used to be an ubuntu user for many years.

    – Thanos
    Jan 9 '18 at 6:08














  • 1





    IME, suspend is always fragile. What does the journal say about what's happening? Also F25 is no longer supported (or if it is, it's close to EOL). Have you tried upgrading to F27? Problems like this tend to be resolved with time, so older laptops tend to get "fixed", with newer models exhibiting problems.

    – NickD
    Jan 2 '18 at 13:57











  • Fedora 25 end-of-life December 12, 2017. I second the recommendation of doing an upgrade as the first step.

    – mattdm
    Jan 2 '18 at 22:05











  • @Nick : Thanks a lot for your comment! Although F25 is no longer supported, I don't think an upgrade solves the problem, but I will try it! Thanks!

    – Thanos
    Jan 5 '18 at 10:33











  • Do you see anything relevant in the journal?

    – mattdm
    Jan 8 '18 at 20:55











  • @mattdm : What do you mean? Which journal? *I am new to Fedora - I used to be an ubuntu user for many years.

    – Thanos
    Jan 9 '18 at 6:08








1




1





IME, suspend is always fragile. What does the journal say about what's happening? Also F25 is no longer supported (or if it is, it's close to EOL). Have you tried upgrading to F27? Problems like this tend to be resolved with time, so older laptops tend to get "fixed", with newer models exhibiting problems.

– NickD
Jan 2 '18 at 13:57





IME, suspend is always fragile. What does the journal say about what's happening? Also F25 is no longer supported (or if it is, it's close to EOL). Have you tried upgrading to F27? Problems like this tend to be resolved with time, so older laptops tend to get "fixed", with newer models exhibiting problems.

– NickD
Jan 2 '18 at 13:57













Fedora 25 end-of-life December 12, 2017. I second the recommendation of doing an upgrade as the first step.

– mattdm
Jan 2 '18 at 22:05





Fedora 25 end-of-life December 12, 2017. I second the recommendation of doing an upgrade as the first step.

– mattdm
Jan 2 '18 at 22:05













@Nick : Thanks a lot for your comment! Although F25 is no longer supported, I don't think an upgrade solves the problem, but I will try it! Thanks!

– Thanos
Jan 5 '18 at 10:33





@Nick : Thanks a lot for your comment! Although F25 is no longer supported, I don't think an upgrade solves the problem, but I will try it! Thanks!

– Thanos
Jan 5 '18 at 10:33













Do you see anything relevant in the journal?

– mattdm
Jan 8 '18 at 20:55





Do you see anything relevant in the journal?

– mattdm
Jan 8 '18 at 20:55













@mattdm : What do you mean? Which journal? *I am new to Fedora - I used to be an ubuntu user for many years.

– Thanos
Jan 9 '18 at 6:08





@mattdm : What do you mean? Which journal? *I am new to Fedora - I used to be an ubuntu user for many years.

– Thanos
Jan 9 '18 at 6:08










1 Answer
1






active

oldest

votes


















2














The problem is that your laptop is trying to resume from the wrong partition. That can be fixed in the grub by following the steps below:



As a superuser, run:



# swapon -s


That should show you which partition is used for Swap. On my machine, for example, it shows /dev/dm-1:



Filename        Type        Size     Used   Priority
/dev/dm-1 partition 8388604 0 -2


Next edit /etc/default/grub and find the line that starts with GRUB_CMDLINE_LINUX=. It needs to have a value of resume=<your-swap-device>. In my example that is resume=/dev/dm-1. If the resume entry is there, update it. If not, add it.



Next you have to regenerate the grub. On UEFI systems that would be:



# grub2-mkconfig -o /etc/grub2-efi.cfg


On legacy systems that would be



# grub2-mkconfig -o /etc/grub2.cfg


The next time that you open the lid your laptop should find the resume information and recover from suspend correctly.



Reference



EDIT (from the OP)



An additional step is required :



Rebooting the laptop prior to closing the lid for the first time.






share|improve this answer




























  • Thank you very much for your answer! There was indeed an entry GRUB_CMDLINE_LINUX="rd.lvm.lv=fedora/root rd.lvm.lv=fedora/swap rhgb quiet" I will change it according to your answer! About the last step, how can I see whether I have UEFI or legacy system?

    – Thanos
    Jan 29 '18 at 11:39











  • I did [$ sudo efibootmgr and the output was EFI variables are not supported on this system. so I guess I will have to run # grub2-mkconfig -o /etc/grub2.cfg.

    – Thanos
    Jan 29 '18 at 11:43











  • This didn't work. Laptop is still not suspending.

    – Thanos
    Jan 31 '18 at 6:14











  • @Thanos did you figure this out? I had a similar issue, and after adding the resume= bit to my grub config, I had to run dracut --regerate-all --force to make it work /shrug

    – Andbdrew
    May 1 '18 at 11:22














Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f414297%2ffedora-27-laptop-wont-suspend-when-closing-lid%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









2














The problem is that your laptop is trying to resume from the wrong partition. That can be fixed in the grub by following the steps below:



As a superuser, run:



# swapon -s


That should show you which partition is used for Swap. On my machine, for example, it shows /dev/dm-1:



Filename        Type        Size     Used   Priority
/dev/dm-1 partition 8388604 0 -2


Next edit /etc/default/grub and find the line that starts with GRUB_CMDLINE_LINUX=. It needs to have a value of resume=<your-swap-device>. In my example that is resume=/dev/dm-1. If the resume entry is there, update it. If not, add it.



Next you have to regenerate the grub. On UEFI systems that would be:



# grub2-mkconfig -o /etc/grub2-efi.cfg


On legacy systems that would be



# grub2-mkconfig -o /etc/grub2.cfg


The next time that you open the lid your laptop should find the resume information and recover from suspend correctly.



Reference



EDIT (from the OP)



An additional step is required :



Rebooting the laptop prior to closing the lid for the first time.






share|improve this answer




























  • Thank you very much for your answer! There was indeed an entry GRUB_CMDLINE_LINUX="rd.lvm.lv=fedora/root rd.lvm.lv=fedora/swap rhgb quiet" I will change it according to your answer! About the last step, how can I see whether I have UEFI or legacy system?

    – Thanos
    Jan 29 '18 at 11:39











  • I did [$ sudo efibootmgr and the output was EFI variables are not supported on this system. so I guess I will have to run # grub2-mkconfig -o /etc/grub2.cfg.

    – Thanos
    Jan 29 '18 at 11:43











  • This didn't work. Laptop is still not suspending.

    – Thanos
    Jan 31 '18 at 6:14











  • @Thanos did you figure this out? I had a similar issue, and after adding the resume= bit to my grub config, I had to run dracut --regerate-all --force to make it work /shrug

    – Andbdrew
    May 1 '18 at 11:22
















2














The problem is that your laptop is trying to resume from the wrong partition. That can be fixed in the grub by following the steps below:



As a superuser, run:



# swapon -s


That should show you which partition is used for Swap. On my machine, for example, it shows /dev/dm-1:



Filename        Type        Size     Used   Priority
/dev/dm-1 partition 8388604 0 -2


Next edit /etc/default/grub and find the line that starts with GRUB_CMDLINE_LINUX=. It needs to have a value of resume=<your-swap-device>. In my example that is resume=/dev/dm-1. If the resume entry is there, update it. If not, add it.



Next you have to regenerate the grub. On UEFI systems that would be:



# grub2-mkconfig -o /etc/grub2-efi.cfg


On legacy systems that would be



# grub2-mkconfig -o /etc/grub2.cfg


The next time that you open the lid your laptop should find the resume information and recover from suspend correctly.



Reference



EDIT (from the OP)



An additional step is required :



Rebooting the laptop prior to closing the lid for the first time.






share|improve this answer




























  • Thank you very much for your answer! There was indeed an entry GRUB_CMDLINE_LINUX="rd.lvm.lv=fedora/root rd.lvm.lv=fedora/swap rhgb quiet" I will change it according to your answer! About the last step, how can I see whether I have UEFI or legacy system?

    – Thanos
    Jan 29 '18 at 11:39











  • I did [$ sudo efibootmgr and the output was EFI variables are not supported on this system. so I guess I will have to run # grub2-mkconfig -o /etc/grub2.cfg.

    – Thanos
    Jan 29 '18 at 11:43











  • This didn't work. Laptop is still not suspending.

    – Thanos
    Jan 31 '18 at 6:14











  • @Thanos did you figure this out? I had a similar issue, and after adding the resume= bit to my grub config, I had to run dracut --regerate-all --force to make it work /shrug

    – Andbdrew
    May 1 '18 at 11:22














2












2








2







The problem is that your laptop is trying to resume from the wrong partition. That can be fixed in the grub by following the steps below:



As a superuser, run:



# swapon -s


That should show you which partition is used for Swap. On my machine, for example, it shows /dev/dm-1:



Filename        Type        Size     Used   Priority
/dev/dm-1 partition 8388604 0 -2


Next edit /etc/default/grub and find the line that starts with GRUB_CMDLINE_LINUX=. It needs to have a value of resume=<your-swap-device>. In my example that is resume=/dev/dm-1. If the resume entry is there, update it. If not, add it.



Next you have to regenerate the grub. On UEFI systems that would be:



# grub2-mkconfig -o /etc/grub2-efi.cfg


On legacy systems that would be



# grub2-mkconfig -o /etc/grub2.cfg


The next time that you open the lid your laptop should find the resume information and recover from suspend correctly.



Reference



EDIT (from the OP)



An additional step is required :



Rebooting the laptop prior to closing the lid for the first time.






share|improve this answer















The problem is that your laptop is trying to resume from the wrong partition. That can be fixed in the grub by following the steps below:



As a superuser, run:



# swapon -s


That should show you which partition is used for Swap. On my machine, for example, it shows /dev/dm-1:



Filename        Type        Size     Used   Priority
/dev/dm-1 partition 8388604 0 -2


Next edit /etc/default/grub and find the line that starts with GRUB_CMDLINE_LINUX=. It needs to have a value of resume=<your-swap-device>. In my example that is resume=/dev/dm-1. If the resume entry is there, update it. If not, add it.



Next you have to regenerate the grub. On UEFI systems that would be:



# grub2-mkconfig -o /etc/grub2-efi.cfg


On legacy systems that would be



# grub2-mkconfig -o /etc/grub2.cfg


The next time that you open the lid your laptop should find the resume information and recover from suspend correctly.



Reference



EDIT (from the OP)



An additional step is required :



Rebooting the laptop prior to closing the lid for the first time.







share|improve this answer














share|improve this answer



share|improve this answer








edited 17 mins ago









RalfFriedl

5,9934 gold badges13 silver badges26 bronze badges




5,9934 gold badges13 silver badges26 bronze badges










answered Jan 27 '18 at 1:35









isapirisapir

2532 silver badges7 bronze badges




2532 silver badges7 bronze badges
















  • Thank you very much for your answer! There was indeed an entry GRUB_CMDLINE_LINUX="rd.lvm.lv=fedora/root rd.lvm.lv=fedora/swap rhgb quiet" I will change it according to your answer! About the last step, how can I see whether I have UEFI or legacy system?

    – Thanos
    Jan 29 '18 at 11:39











  • I did [$ sudo efibootmgr and the output was EFI variables are not supported on this system. so I guess I will have to run # grub2-mkconfig -o /etc/grub2.cfg.

    – Thanos
    Jan 29 '18 at 11:43











  • This didn't work. Laptop is still not suspending.

    – Thanos
    Jan 31 '18 at 6:14











  • @Thanos did you figure this out? I had a similar issue, and after adding the resume= bit to my grub config, I had to run dracut --regerate-all --force to make it work /shrug

    – Andbdrew
    May 1 '18 at 11:22



















  • Thank you very much for your answer! There was indeed an entry GRUB_CMDLINE_LINUX="rd.lvm.lv=fedora/root rd.lvm.lv=fedora/swap rhgb quiet" I will change it according to your answer! About the last step, how can I see whether I have UEFI or legacy system?

    – Thanos
    Jan 29 '18 at 11:39











  • I did [$ sudo efibootmgr and the output was EFI variables are not supported on this system. so I guess I will have to run # grub2-mkconfig -o /etc/grub2.cfg.

    – Thanos
    Jan 29 '18 at 11:43











  • This didn't work. Laptop is still not suspending.

    – Thanos
    Jan 31 '18 at 6:14











  • @Thanos did you figure this out? I had a similar issue, and after adding the resume= bit to my grub config, I had to run dracut --regerate-all --force to make it work /shrug

    – Andbdrew
    May 1 '18 at 11:22

















Thank you very much for your answer! There was indeed an entry GRUB_CMDLINE_LINUX="rd.lvm.lv=fedora/root rd.lvm.lv=fedora/swap rhgb quiet" I will change it according to your answer! About the last step, how can I see whether I have UEFI or legacy system?

– Thanos
Jan 29 '18 at 11:39





Thank you very much for your answer! There was indeed an entry GRUB_CMDLINE_LINUX="rd.lvm.lv=fedora/root rd.lvm.lv=fedora/swap rhgb quiet" I will change it according to your answer! About the last step, how can I see whether I have UEFI or legacy system?

– Thanos
Jan 29 '18 at 11:39













I did [$ sudo efibootmgr and the output was EFI variables are not supported on this system. so I guess I will have to run # grub2-mkconfig -o /etc/grub2.cfg.

– Thanos
Jan 29 '18 at 11:43





I did [$ sudo efibootmgr and the output was EFI variables are not supported on this system. so I guess I will have to run # grub2-mkconfig -o /etc/grub2.cfg.

– Thanos
Jan 29 '18 at 11:43













This didn't work. Laptop is still not suspending.

– Thanos
Jan 31 '18 at 6:14





This didn't work. Laptop is still not suspending.

– Thanos
Jan 31 '18 at 6:14













@Thanos did you figure this out? I had a similar issue, and after adding the resume= bit to my grub config, I had to run dracut --regerate-all --force to make it work /shrug

– Andbdrew
May 1 '18 at 11:22





@Thanos did you figure this out? I had a similar issue, and after adding the resume= bit to my grub config, I had to run dracut --regerate-all --force to make it work /shrug

– Andbdrew
May 1 '18 at 11:22


















draft saved

draft discarded




















































Thanks for contributing an answer to Unix & Linux Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f414297%2ffedora-27-laptop-wont-suspend-when-closing-lid%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Taj Mahal Inhaltsverzeichnis Aufbau | Geschichte | 350-Jahr-Feier | Heutige Bedeutung | Siehe auch |...

Baia Sprie Cuprins Etimologie | Istorie | Demografie | Politică și administrație | Arii naturale...

Nicolae Petrescu-Găină Cuprins Biografie | Opera | In memoriam | Varia | Controverse, incertitudini...