Comment by timcambrant

Comment by timcambrant 6 days ago

12 replies

I have had very mixed experiences when suspending a laptop using Windows, various Linux distributions, MacOS and Windows 7-11. MacOS is the most polished yet, but Linux (kernel 2.4 to 6.8) has never nailed this. Often times the kernel refuses to sleep and the laptop will hotbox in the bag until the battery runs out. The same has happened on the other OSes, but less often.

It looks like this particular FreeBSD installation (we don't know if it's out of the box or customized, and haven't seen it side by side with another hardware setup) works very well. Wonder if the results are the same if they closed the lid rather than remembering to press the button. Also, I wonder why this doesn't trigger any authentication when starting back up. Anyone could snatch that laptop and still be logged in.

vermaden 6 days ago

Hi,

> It looks like this particular FreeBSD installation (we don't know if it's out of the box or customized, and haven't seen it side by side with another hardware setup) works very well.

All the settings I use are documented here - and its nothing special really - most people using FreeBSD on laptops use them:

- https://vermaden.wordpress.com/2022/04/14/freebsd-13-1-on-th...

- https://vermaden.wordpress.com/2018/11/28/the-power-to-serve...

> Wonder if the results are the same if they closed the lid rather than remembering to press the button.

I often just close the lid and DO NOT want the laptop to go to sleep - that is why I do not use it - but it works the same with hw.acpi.lid_switch_state=S3 in /etc/sysctl.conf file - it does not matter for FreeBSD if zzz(8) commands triggers S3 state or something else.

> Also, I wonder why this doesn't trigger any authentication when starting back up. Anyone could snatch that laptop and still be logged in.

The purpose of this videos were to show only the suspend/resume process of FreeBSD system.

In my daily life I have two shortcuts related to this:

- [SUPER] + [L] - locks the system and leaves it running - and it requires to enter password

- [SUPER] + [CTRL] + [ALT] + [L] - locks the system AND PUTS IT INTO S3 SLEEP - and it requires to enter password if you wake it up

Hope that helps.

Regards,

vermaden

yjftsjthsd-h 6 days ago

To echo the other comments - I'm reasonably confident that the Linux kernel is perfectly capable of handling sleep, the problem is varied hardware support. Consider that every Chromebook and Android device on the planet is running a Linux kernel, and they have no trouble. Likewise, I don't think I've ever had Linux struggle with sleeping on a thinkpad, and the best suspend/resume experience I've ever had was Linux on a random Lenovo laptop a while back.

johnea 6 days ago

Having been on linux laptops for ~20 years, I've found this to be really h/w dependent.

I've mostly run thinkpads, and they've mostly worked. My current T16 not only suspendds/resumes well, I also successfully use full disk encryption recovery on boot from hibernate.

  • jandrese 6 days ago

    This is my experience too. Even though we don't hand off control to the (often buggy) BIOS anymore, there is still a fair bit of hardware support that needs to be in place to have a smooth suspend/resume. Even on the Windows install that shipped with the laptop I've had machines that fail to suspend properly and turn into bagwarmers or that fail to restore the graphics when waking back up or any number of potential issues. I've even had machines that brick their SSDs the first time you put them to sleep. Permanently bricked, can't even be wiped or factory reset bricked.

  • bityard 6 days ago

    Concur. I have seen issues with suspend on Linux in the past, but my last three Dell laptops suspend just fine. Usually the only weirdness is with laptops that don't have an S3 state anymore, or when you add/remove hardware in between being awake and asleep.

    That said (and it pains me to say it), the experience is still nowhere near as flawless as MacOS on Silicon hardware.

  • vermaden 6 days ago

    For the record - this FreeBSD installation from videos also uses Full Disk Encryption in the form of GELI under the ZFS - its really brain dead simple to setup - just use 'Auto (ZFS)' option in the FreeBSD bsdinstall(8) installer and set Encrypt Disks to YES - nothing else required.

    • BSDobelix 5 days ago

      > set Encrypt Disks to YES - nothing else required.

      Plus "Encrypt Swap" should ~always be used even on non Root-GELI-Systems ;)

    • palata 6 days ago

      I thought root-on-ZFS did not work well with hibernate, for some reason? Did I misunderstand something?

      • vermaden 6 days ago

        FreeBSD - from what I know - does not support Hibernation (S4) - it supports Suspend/Resume (S3) - as shown in video.

        The difference:

        Suspend/Resume (S3)

        CPU is powered off. RAM maintains power and data. Very low power usage. Sometimes referred to as 'Save to RAM' or 'Standby'.

        Hibernation (S4)

        CPU is powered off. RAM is powered off. Data/RAM/files wrote to disk. Power is off. Sometimes referred to as 'Save to Disk'.

prmoustache 5 days ago

> Wonder if the results are the same if they closed the lid

This is a default setting that I never understood.

Nearly all laptops/keyboard have a sleep button, power button is often configured by default to also go to sleep. Additionnally you can configure to go automatically to sleep if inactive and on battery for a few minutes. Why would I want my laptop to go to sleep immediately when I close the lid?

Half of the time when I am closing the lid, it is to move from one space/room to another. I don't want my git pull/push, my music or my video call to stop for 20-30 seconds because I am just going from my sofa to my kitchen or from my desk to a meeting room.

And I don't want to be that dummy project manager who moves awkwardly from one place to another with his coffee cup in one hand and an opened laptop on the other hand nearly hitting everyone or the office plants in the process just because he is too dumb to configure his laptop correctly.