Gave up waiting for suspend/resume device ubuntu 22 framework 12 gen

It seems to be a known issue with some nvme drives, especially when becoming hot/under load.

There is a possible workaround for some drives using nvme_core.default_ps_max_latency_us=0 but that doesn’t solve the problem that the drive is not responding correctly.

I would check if the drive termals are fine and if you have a spare around check if it happens with that one as well.

1 Like

thanks @Anachron , great catch, i don’t believe i got any heat sinks…

but… how would it explain the fact that when booting into windows or resuming from hibernate on Ubuntu i never experienced the issue what so ever …

i guess hibernation would naturally cool down the system after a while, but windows?

Guide is forth coming for Ubuntu users, but here is a sneak peak at how I personally use hibernate on 11th gen - tested on 22.04.1 as working flawlessly on a vanilla CLEAN installation. I can not make promises for any tweaked/customized setups.

This will be part of a larger Knowledge Base article in the near future.

But this absolutely works, test after test. This guide is not official yet, but it’s coming and yes, it works on:

Ubuntu 22.04 unencrypted, 11th Gen Framework.


Suspend on Linux isn’t going to match Windows. And some modules will draw power even when in a deep suspend state.

There is a solution and it works very well. It’s called “suspend-then-hibernate” and once configured, is wonderful.

Now you’re going to be asked to paste in some things and also look for some things. It’s not difficult, but it will take you a few minutes to get set up.

The advantage is once configured, you can set a time to remain in deep suspend state for say, one hour. Mine is set for half an hour as I know myself if my Framework laptop isn’t used from a suspend state for 30 minutes, I want my laptop to be saved and then turned off (hibernate).

Then if the laptop is still untouched, it will then automatically go into hibernation mode which is powered off…but will remember your exact state it was suspended in. Since it’s saving this to
disk, it’s going to mean you won’t need to worry about draining the battery.

Let’s get started. Remember, you can simply copy and paste these commands into the terminal.

  1. First, let’s clear old swap file, if this is a default Ubuntu installation:

sudo swapoff -v /swapfile

Then:

sudo rm -f /swapfile

  1. Now create a new swapfile that is of this recommended size - yes, it’s large…but it means we know that it will remember to store anything you’re throwing at it.

sudo dd if=/dev/zero of=/swapfile count=37000 bs=1MiB

  1. Now let’s set up our new swapfile.

sudo chmod 600 /swapfile

Then:

sudo mkswap /swapfile

Then:

sudo swapon /swapfile

  1. Now let’s make sure the entry in fstab is correct.

sudo gedit /etc/fstab

If you’re seeing this below inside of your fstab (and you likely are):

/swapfile none swap sw 0 0

…then this file is ready to be saved. If you see no mention of /swapfile or something else referring to swap, please take a screenshot and refer it back to me for help.

Ordinarily on a default installation, it should be all set up like above already.

Now let’s get your boot up sequence ready for your new hibernation abilities.

  1. Let’s find the UUID via command using blkid. This will be the main drive, so look for the
    drive with:

blkid

My results gave me a /dev/ device and then the UUID. We want to copy that UUID as follows:

Your UUID will have different numbers and letters, so just grab what appears in the similar format as above with a copy/paste.

  1. Open a text file, paste in that UUID for later - we’re using it in a second.

  2. Still with me? Great! Now let’s get the offset number.

sudo filefrag -v /swapfile

Scroll all the way back up to the top. See the image below? See the highlight? Your number will differ, but this is the number we want. Mine was 7802880. So look for yours, same location, copy it to that open note file I had you open previously.

Let’s add these changes to your grub boot up sequence.
We’re merely going to append the new details to the existing grub entry. It will not overwrite what was done previously.
Using your touchpad/mouse, simply highlight the bolded areas and replace them with the correct information reflecting your own configuration.

sudo sed -i '/^GRUB_CMDLINE_LINUX_DEFAULT/ s/"$/
resume=UUID=b432a6a4-6663-45e6-9b4f-93eaf69ba9a0 resume_offset=7802880"/'
/etc/default/grub

The bold areas need to be replaced with your UUID and your offset that you pasted into that text
file from earlier.

Now that you’ve updated the above command with your UUID and your offset information, paste the newly changed command into the terminal and press enter.

With that done, you can now update grub.

sudo update-grub

And now reboot!

Awesome, so now after reboot…the nuts and bolts of getting suspend-then-hibernate are all set.

Now to get this working on 11th gen with the lid close, there is a bit more work to do. We’re almost done, though! Good news is the rest of this part is easy. In a terminal again:

sudo gedit /etc/systemd/sleep.conf

Ctrl F and look for:

#HibernateDelaySec=

Make sure to remove any # in front of it so it goes from:

#HibernateDelaySec=

Into:

HibernateDelaySec=

Also this is the cool part where you decide how long you’d like to suspend for. What this means is, how long you’d like the suspended state to run until it automatically goes to hibernation.

I usually recommend 30 minutes, but some people prefer 60 minutes before it slides out of the suspended state and goes to hibernation.

HibernateDelaySec=30min

Great, we’ve made our change. Let’s save the file.

  1. Now let’s make it work with the Framework Lid close.

sudo gedit /etc/systemd/logind.conf

Ctrl F to find HandleLidSwitch=

#HandleLidSwitch=suspend

Into (removing the # again):

HandleLidSwitch=suspend-then-hibernate

And save the file. Reboot.

2 Likes

Thanks for this @Matt_Hartley. This is for an unencrypted setup, correct? You might want to note that in case anyone tries to set it up with an encrypted drive.

I use the a similar setup (suspend then hibernate), but with a twelve hour delay, so it usually won’t hit hibernate overnight. I have it set up with an encrypted drive and encrypted swap partition. My recollection is that it was an involved process, but didn’t involve anything crazy.

1 Like

Noted, and marked accordingly now.

Yeah, there are additional steps. It’ll be part of the Knowledge Base article once it’s ready.

1 Like

Continuing the original topic…

Another incident of hanging boot just occurred on a cold start.
I believe the overheating SSD / NVME drive theory which i am sure is valid, does not apply in my situation as this evidence says.

In fact i experimented more by removing optional extensions (micro sd adapter) and managed to keep a clean boot up track record for a while. So my hunch is that the USB bus is somehow interfering with the device during a non-hibernated boot.

I’ve asked for your ticket @Maciek_Kolesnik I’m out of the office tomorrow, but will be returning Thurs. I will have some steps to try then.

In the meantime, do you have your provided FW charger and are the results the same with it?

thanks. the problem happens without the charger. I typically don’t boot on the charger

i usually don’t use the loaptop on the charger. I charge it up to full then use always on the battery.

so to answer the question, i dont have F/W charger. and never tried booting on my (apple 96W) charger.