Dell Inspiron 17 7706, Mint 20 wakes up automatically from suspend

Questions about other topics - please check if your question fits better in another category before posting here
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
asdfuioda
Level 1
Level 1
Posts: 31
Joined: Wed Aug 31, 2016 8:34 pm

Re: Dell Inspiron 17 7706, Mint 20 wakes up automatically from suspend

Post by asdfuioda »

Did the 1 hour suspension test with the OEM kernel. No differences to the s2idle mode. From 55% to 46%, so 9%/hour.

I will note that the installation produced an error, so maybe it wasn't entire successful.

Code: Select all

emil@test ~ $ apt install linux-image-oem-20.04-edge
[sudo] password for emil:             
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  linux-image-5.10.0-1021-oem linux-image-oem-20.04b
  linux-modules-5.10.0-1021-oem
Suggested packages:
  fdutils linux-oem-5.10-tools linux-headers-5.10.0-1021-oem
The following NEW packages will be installed:
  linux-image-5.10.0-1021-oem linux-image-oem-20.04-edge
  linux-image-oem-20.04b linux-modules-5.10.0-1021-oem
0 upgraded, 4 newly installed, 0 to remove and 49 not upgraded.
Need to get 66,9 MB of archives.
After this operation, 311 MB of additional disk space will be used.
Do you want to continue? [Y/n] 
Get:1 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 linux-modules-5.10.0-1021-oem amd64 5.10.0-1021.22 [57,3 MB]
Get:2 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 linux-image-5.10.0-1021-oem amd64 5.10.0-1021.22 [9.674 kB]
Get:3 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 linux-image-oem-20.04b amd64 5.10.0.1021.22 [2.596 B]
Get:4 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 linux-image-oem-20.04-edge amd64 5.10.0.1021.22 [1.868 B]
Fetched 66,9 MB in 6s (11,7 MB/s)                
Selecting previously unselected package linux-modules-5.10.0-1021-oem.
(Reading database ... 446477 files and directories currently installed.)
Preparing to unpack .../linux-modules-5.10.0-1021-oem_5.10.0-1021.22_amd64.deb .
..
Unpacking linux-modules-5.10.0-1021-oem (5.10.0-1021.22) ...
Selecting previously unselected package linux-image-5.10.0-1021-oem.
Preparing to unpack .../linux-image-5.10.0-1021-oem_5.10.0-1021.22_amd64.deb ...
Unpacking linux-image-5.10.0-1021-oem (5.10.0-1021.22) ...
Selecting previously unselected package linux-image-oem-20.04b.
Preparing to unpack .../linux-image-oem-20.04b_5.10.0.1021.22_amd64.deb ...
Unpacking linux-image-oem-20.04b (5.10.0.1021.22) ...
Selecting previously unselected package linux-image-oem-20.04-edge.
Preparing to unpack .../linux-image-oem-20.04-edge_5.10.0.1021.22_amd64.deb ...
Unpacking linux-image-oem-20.04-edge (5.10.0.1021.22) ...
Setting up linux-modules-5.10.0-1021-oem (5.10.0-1021.22) ...
Setting up linux-image-5.10.0-1021-oem (5.10.0-1021.22) ...
I: /boot/vmlinuz.old is now a symlink to vmlinuz-5.8.0-49-generic
I: /boot/initrd.img.old is now a symlink to initrd.img-5.8.0-49-generic
I: /boot/vmlinuz is now a symlink to vmlinuz-5.10.0-1021-oem
I: /boot/initrd.img is now a symlink to initrd.img-5.10.0-1021-oem
Setting up linux-image-oem-20.04b (5.10.0.1021.22) ...
Setting up linux-image-oem-20.04-edge (5.10.0.1021.22) ...
Processing triggers for linux-image-5.10.0-1021-oem (5.10.0-1021.22) ...
/etc/kernel/postinst.d/dkms:
 * dkms: running auto installation service for kernel 5.10.0-1021-oem
Error! echo
Your kernel headers for kernel 5.10.0-1021-oem cannot be found at
/lib/modules/5.10.0-1021-oem/build or /lib/modules/5.10.0-1021-oem/source.
You can use the --kernelsourcedir option to tell DKMS where it's located.
   ...done.
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-5.10.0-1021-oem
W: Possible missing firmware /lib/firmware/i915/tgl_huc_7.5.0.bin for module i91
5
W: Possible missing firmware /lib/firmware/i915/tgl_huc_7.5.0.bin for module i91
5
I: The initramfs will attempt to resume from /dev/dm-2
I: (/dev/mapper/vgmint-swap_1)
I: Set the RESUME variable to override this.
/etc/kernel/postinst.d/zz-update-grub:
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/50_linuxmint.cfg'#########################........] 
Sourcing file `/etc/default/grub.d/init-select.cfg'####################################.........] 
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.10.0-1021-oem
Found initrd image: /boot/initrd.img-5.10.0-1021-oem
Found linux image: /boot/vmlinuz-5.8.18-050818-generic###################################################...........] 
Found initrd image: /boot/initrd.img-5.8.18-050818-generic
Found linux image: /boot/vmlinuz-5.8.0-49-generic
Found initrd image: /boot/initrd.img-5.8.0-49-generic
Found linux image: /boot/vmlinuz-5.8.0-48-generic
Found initrd image: /boot/initrd.img-5.8.0-48-generic
Found linux image: /boot/vmlinuz-5.4.0-70-generic
Found initrd image: /boot/initrd.img-5.4.0-70-generic
Found linux image: /boot/vmlinuz-5.3.18-050318-generic
Found initrd image: /boot/initrd.img-5.3.18-050318-generic
Adding boot menu entry for UEFI Firmware Settings
done
The update did not make any changes to the ability to do deep sleep, as far as I can tell:

Code: Select all

emil@test ~ $ cat /sys/power/mem_sleep
[s2idle]
emil@test ~ $ cat /sys/power/state
freeze mem disk
User avatar
SMG
Level 25
Level 25
Posts: 31776
Joined: Sun Jul 26, 2020 6:15 pm
Location: USA

Re: Dell Inspiron 17 7706, Mint 20 wakes up automatically from suspend

Post by SMG »

asdfuioda wrote: Tue Apr 13, 2021 9:52 pmMake swap file if you don't have one:
By default, Mint20 creates a swapfile when you install it, so you already had a swapfile. In addition, your data indicated you have a swap partition. One can either hibernate to a swap file or a swap partition. Since you have whole disk encryption and your swap partition is on the same encrypted drive, it's possible you could have accomplished the same end goal by just increasing your swap partition size.

Partition:
ID-1: / size: 3.66 TiB used: 364.94 GiB (9.7%) fs: ext4 dev: /dev/dm-1
ID-2: /boot size: 704.5 MiB used: 513.3 MiB (72.9%) fs: ext4
dev: /dev/nvme0n1p2
ID-3: swap-1 size: 976.0 MiB used: 0 KiB (0.0%) fs: swap dev: /dev/dm-2
asdfuioda wrote: Tue Apr 13, 2021 9:52 pmThe mkswap command also outputs an UUID, but it differs from the above for some reason.
Maybe you created a second swapfile (since your system had one before you ran the command)? I do not know how the system might handle that.
asdfuioda wrote: Tue Apr 13, 2021 9:52 pmNow you can maybe hibernate your system with:

Code: Select all

sudo systemctl hibernate
If this doesn't work, and gives an error:

Code: Select all

Failed to hibernate system via logind: Not enough swap space for hibernation
You may be getting the error because of the multiple swap file/partitions on your install. The system may be trying to use your swap partition which is not very large. I've seen this happen on other installs where there are multiple swap partitions (due to other disks installed on the system in that case).

The code you wrote told the system from where to resume, but I don't see where it told the system where to suspend. That may be the difference between your install and the guide you followed. Your install has a swap partition.
asdfuioda wrote: Tue Apr 13, 2021 11:04 pm Did the 1 hour suspension test with the OEM kernel. No differences to the s2idle mode.
I would not expect there to be any difference.

In one of the links you provided was the comment, "I have asked a member of the Dell Linux team about this issue. I got the following answer: "XPS 9310 only offers Modern Standby for Windows and Suspend to Idle for Linux." This means deep sleep is not supported by the firmware on this machine."

Firmware is BIOS/UEFI and is controlled by Dell.
Image
A woman typing on a laptop with LM20.3 Cinnamon.
asdfuioda
Level 1
Level 1
Posts: 31
Joined: Wed Aug 31, 2016 8:34 pm

Re: Dell Inspiron 17 7706, Mint 20 wakes up automatically from suspend

Post by asdfuioda »

Yeah, there is a 1 GB default one, which is too small for my 64GB RAM. You were right, disabling it makes the first command work.

Code: Select all

emil@test ~ $ swapon -s
Filename				Type		Size	Used	Priority
/dev/dm-2                              	partition	999420	0	-2
emil@test ~ $ sudo swapon /swapfile
[sudo] password for emil:             
emil@test ~ $ swapon -s
Filename				Type		Size	Used	Priority
/dev/dm-2                              	partition	999420	0	-2
/swapfile                              	file    	99999996	0	-3
emil@test ~ $ sudo swapoff /dev/dm-2
emil@test ~ $ swapon -s
Filename				Type		Size	Used	Priority
/swapfile                              	file    	99999996	0	-2
emil@test ~ $ sudo systemctl hibernate[
#system hibernates
I didn't want to bother resizing a swap partition, and also having to deal with encrypting it. By using a swap file inside my encrypted disk, everything is properly encrypted. When I resume from hibernation, it asks first for decryption key, and then resumes the system. tried a few times, and it works fine. Not as good as just having a normal laptop where one can just close the lid, but ... it is livable.

Finally, need the button enabled and automatic settings for hibernation to work. This post provides how to do this. https://unix.stackexchange.com/question ... 20-and-pre

With that done, I think we can finally marked this one as semi-resolved. Could not get the s2idle to not suck, probably due to Dell (per the quote), but hibernation working is pretty good.
User avatar
SMG
Level 25
Level 25
Posts: 31776
Joined: Sun Jul 26, 2020 6:15 pm
Location: USA

Re: Dell Inspiron 17 7706, Mint 20 wakes up automatically from suspend

Post by SMG »

asdfuioda wrote: Wed Apr 14, 2021 1:40 pmYeah, there is a 1 GB default one, which is too small for my 64GB RAM. You were right, disabling it makes the first command work.
It is my understanding that swap partition was created automatically because you have encryption. I do not know enough about how the encryption works to know for sure, but you may be messing with your ability to have the encryption work properly by "disabling" it.

Your set-up uses LVM which I understand to be technology which makes it easier to change partition sizes. You might want to keep in mind it might be better overall to expand the swap partition to a size you need rather than using a separate swap file for hibernation.
asdfuioda wrote: Wed Apr 14, 2021 1:40 pmI didn't want to bother resizing a swap partition, and also having to deal with encrypting it. By using a swap file inside my encrypted disk, everything is properly encrypted. When I resume from hibernation, it asks first for decryption key, and then resumes the system. tried a few times, and it works fine. Not as good as just having a normal laptop where one can just close the lid, but ... it is livable.
Your swap partition is on the same disk as your swap file. In fact, it is part of the LVM flex with your computer's root partition. I do not understand your comment about having to deal with encrypting the swap partition. My concern, and why I made the comment above, is what happens when you shut down and restart. Will the system see that swap partition properly so you can get into your drive. It might; I do not know.
asdfuioda wrote: Wed Apr 14, 2021 1:40 pmFinally, need the button enabled and automatic settings for hibernation to work. This post provides how to do this. https://unix.stackexchange.com/question ... 20-and-pre
Or you could have used the instructions on this forum. While they were created for LM19, they also work in LM20.
[GUIDE] How to hibernate to a swap file in Linux Mint 19.x
How to enable hibernation with swap partition on Linux Mint 19
Image
A woman typing on a laptop with LM20.3 Cinnamon.
Locked

Return to “Other topics”