In 8 hours it uses 20% of the battery. When Windows or Mac are put to sleep, the damn things can sleep for a week! This is the case with Linux on multiple laptops.

Is there some kind of manipulation going by ring -1 that detects Linux is running? Is Linux not respecting some procedure and kissing a step?

  • parsimon@programming.dev
    link
    fedilink
    arrow-up
    15
    arrow-down
    1
    ·
    8 days ago

    I recommend using hibernate (suspend to disk): your computer will “sleep” for 10 years without draining. The only cost is about 7 seconds to boot on modern hardware. For short interruptions with instant wakeup, you can still use light sleep states.

    It combines perfectly with LUKS-encrypted root and swap partitions: your data is safe even if someone steals your computer and swakes it up.

    • Quailman@lemmy.world
      link
      fedilink
      arrow-up
      6
      arrow-down
      1
      ·
      7 days ago

      Hibernate doesn’t work with secure boot/kernel lockdown for $REASONS, a lot of folks can’t even use it. Supposedly if Linux can determine you’re resuming from an encrypted partition it will work, but I was never able to get it to work with a swap file on BTRFS on LUKS

      • deffard@lemmy.world
        link
        fedilink
        English
        arrow-up
        1
        ·
        7 days ago

        There’s only so much that can be done on the hardware/ firmware side, but his for me is the real gap that Linux can improve upon. Hibernate, disk encryption and secure boot/tpm unlock together have just worked for a long time on Mac and Windows.

        The kernel decisions seem hostile and hard code a big assumption that it’s always unsecure to restore from hibernate automatically. What’s more insecure is having to disable disk encryption entirely. Secure boot is often misunderstood, but for all its flaws it is better than nothing, and your average user does not want to manually enter a decryption key on top of their user login all the time.

        Because of this I feel a lot of software is not written and tested with hibernate in mind, so you also roll the dice on what works and what doesn’t when restoring today.

        Sleep for 1 hour and then auto hibernate after, in a working setup, meant this problem was solved - always enough battery to resume doing work, no user decision required, quick wake up if resuming a recent session.

        I’d love to see multi-user switch selectively suspending user processes and writing them to disk, so you can quickly restore state between users, and if one user left a browser or game running it’s not draining the battery on what are now known background tasks. No OS does this one well today.

      • parsimon@programming.dev
        link
        fedilink
        English
        arrow-up
        2
        ·
        7 days ago

        True, kernel developers should resolve the Secure Boot issue with hibernation, but the development focus is on servers, not laptop computers. Also, hibernation should probably use a dedicated hibernate image file instead of requiring a huge swap partition. That being said, it works regardless of hardware capabilities if you turn off secure boot and just configure a LUKS-encrypted SWAP partition. You should figure this out before you install the OS.

    • Ephera@lemmy.ml
      link
      fedilink
      arrow-up
      3
      ·
      8 days ago

      Unfortunately, hibernate does not work on all devices. I believe, it depends on the motherboard and BIOS…

    • rockerface🇺🇦@lemmy.cafe
      link
      fedilink
      English
      arrow-up
      3
      ·
      7 days ago

      I’ve found full shutdown and subsequent boot up on my current Bazzite setup takes less time then hibernate used to in Windows 10 on the same PC. Haven’t even felt the need to look into setting up swap (Bazzite uses zram by default).

      • MouldyCat@feddit.uk
        link
        fedilink
        arrow-up
        7
        ·
        7 days ago

        full shutdown and subsequent boot up on my current Bazzite setup takes less time than hibernate

        maybe, but a full shutdown and reboot does not restore all your apps, open documents, terminals etc exactly as they were.

    • onlinepersona@programming.devOP
      link
      fedilink
      arrow-up
      1
      ·
      7 days ago

      Hibernate with an encrypted swap and systemd boot takes forever for me. How do you manage in 7 seconds? How much RAM do you have?