Announcement

Collapse
No announcement yet.

Small swap partition and missing Hibernate option

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Small swap partition and missing Hibernate option

    Hello,

    I don't understand why by default I only got a swap partition of 2G. That is not enough and didn't find no easy way to change its size during installation. I could have made my own partition table but I didn't find any way to create my own partition table with encryption of my / partition.

    I wanted some enough swap to activate hibernate for which I found a tutorial:
    https://ubuntuhandbook.org/index.php...-ubuntu-21-10/

    I created a 19G swap file and followed the step "Enable Hibernate on Swap File" which worked very fine on my Kubuntu 23.04.

    And I feel like I lost the 2G of the swap partition created by the installer.

    Also, I would like to know why the hibernate mode is not enabled by default on Kubuntu, it's really working fine. As far as I know it's enabled on openSUSE tumbleweed by default.

    Despite these inconveniences, I find Kubuntu to be an excellent distribution.


    Thanks,
    Vincent.

    #2
    Ubuntu uses a swap file as opposed to a partition, and has for quite some time now disabled hibernation by default as it it still works like crap in too many cases.
    This is arguable, but I am not sure how many distros do something similar.


    If you happen to have two swap files now (unlikely, as your how-to uses the same name and location for the file), you can delete the smaller one.
    If you actually had a partition, you could use Partition Manager or gparted to remove it and re-size another to fill the space.
    This is best done from a live-USB session.

    Comment


      #3
      Hibernation is one of the first things I disable after installing Linux (or Windows) if it is active (e.g. in openSUSE).

      IMHO the only benefit of hibernation is to save some energy for Laptops - which might be worth it in some cases.
      Additionally one also has to have a swap (file) for hibernation that is at least as big as the computer's physical memory.
      Suspend to RAM is faster and does not kill your SSDs in the long run (but uses a bit more energy, of course).
      And hibernation with a HDD is painfully slow.

      I guess the things above are the reason why hibernation is disabled in Kubuntu by default.

      What can work in an operating system also often depends on the UEFI/BIOS (settings) of one's computer, btw.
      Last edited by Schwarzer Kater; May 22, 2023, 01:13 PM.
      Debian KDE & LXQt • Kubuntu & Lubuntu • openSUSE KDE • Windows • macOS X
      Desktop: Lenovo ThinkCentre M75s • Laptop: Apple MacBook Pro 13" • and others

      get rid of Snap scriptreinstall Snap for release-upgrade scriptinstall traditional Firefox script

      Comment


        #4
        Originally posted by Schwarzer Kater View Post
        I guess the things above are the reason why hibernation is disabled in Kubuntu by default.
        It was disabled by Ubuntu with 11.10 or Precise 12.04. I vaguely recall some discussion on this at the Ubuntu Developer Summit back then, or other chatter around that time. Basically, hibernation was so bad, it seemed to be the minority that had good experience with it.
        The topic does come back every now and again, but if the kernel developers and whoever else is involved can't or don't spend much time on it, the distros can't really do much other than collect bug reports that can't be closed, or are difficult to troubleshoot.

        https://discourse.ubuntu.com/t/re-vi...ubuntu/15953/3
        https://bugs.launchpad.net/ubuntu/+s...es/+bug/812394
        among others.


        I imagine if KDE ever included a settings option to enable/disable it, Kubuntu obviously would have it.

        But this post from a Gnome dev also sheds some light

        The Linux kernel developers do not consider hibernation a stable feature, which means hibernation can break between kernel updates. Additionally, hibernation does not work with secure boot, and has issues with encrypted partitions.
        Last edited by claydoh; May 22, 2023, 01:58 PM.

        Comment


          #5
          Thanks for clearing this up.
          Debian KDE & LXQt • Kubuntu & Lubuntu • openSUSE KDE • Windows • macOS X
          Desktop: Lenovo ThinkCentre M75s • Laptop: Apple MacBook Pro 13" • and others

          get rid of Snap scriptreinstall Snap for release-upgrade scriptinstall traditional Firefox script

          Comment


            #6
            Thank you all for your feedback and clarification on hibernation. Personally, I put my laptop into hibernation mode every night and never shut it down. The restart on my encrypted SSD is very fast.

            Even with these multiple applications opened: Brave, Chromium, Chrome, Thunderbird, Emacs, LibreOffice, WinSCP (with Wine), Joplin, Nginx, MySQL, and sometimes Gimp, I have configured a large swap file to ensure that all these applications can be stored into the swap. At the boot this morning:
            Code:
            free -h
                           total        used        free      shared  buff/cache   available
            Mem:            15Gi       7,6Gi       6,4Gi       1,9Gi       3,6Gi       7,8Gi
            Swap:           19Gi       3,2Gi        16Gi
            When I start my machine, it's truly a pleasure to have all my applications opened with their files, even though the laptop was physically turned off! As for secure boot, I don't see its necessity since the root partition is fully encrypted.

            Personally, I am able to configure hibernation, but I find it unfortunate that less experienced users may never have this option since a hibernation-supported configuration is not offered during installation.

            I have not encountered any bugs in using hibernation and I cannot generalize my case, it's possible that it may be buggy on other hardware configurations.

            Comment


              #7
              Most users suspend to RAM, or "sleep", and restarting is a second or two, basically the time for monitors to power up. Hibernation is more robust in the event of power cuts, or cleaners unplugging things, and a laptop will slowly run down its battery in the sleep state. I went to the bother of setting up hibernation 10 years or so ago, but I hardly used it, so haven't since.

              I tend to regard suspending to RAM or to storage as necessary in the days of spinning rust, but unnecessary now if sessions work properly. My old desktop only needs seconds to boot.
              Regards, John Little

              Comment


                #8
                Originally posted by jlittle View Post
                ... and a laptop will slowly run down its battery in the sleep state.
                Thank you for your response, that's exactly it. Nowadays, most Kubuntu users have laptops, and constantly using the battery because we never turn them off is really bad for the battery life. I have a Lenovo Yoga 720, and my battery has swollen, causing a slight bulge near the trackpad. It's not certain whether it's due to putting it to sleep rather than shutting it down, but it's not a possibility to dismiss.

                Of course, we're told to shut down the laptop every night, but being human, we prefer to put it to sleep to avoid having to restart all our applications the next day and reopen all the files we were working on.

                So one could say that hibernation causes crashes, but since we're lazy and never turn off our laptops, in the end, not using hibernation drains the batteries!

                Comment


                  #9
                  OT:

                  Originally posted by Adamy View Post
                  […] I have a Lenovo Yoga 720, and my battery has swollen, causing a slight bulge near the trackpad. […]
                  Then it is high time to replace the battery before something worse happens! Seriously.
                  Debian KDE & LXQt • Kubuntu & Lubuntu • openSUSE KDE • Windows • macOS X
                  Desktop: Lenovo ThinkCentre M75s • Laptop: Apple MacBook Pro 13" • and others

                  get rid of Snap scriptreinstall Snap for release-upgrade scriptinstall traditional Firefox script

                  Comment


                    #10
                    Originally posted by Schwarzer Kater View Post
                    OT:

                    Then it is high time to replace the battery before something worse happens! Seriously.
                    It's like that since last summer, maybe happened in august. I noticed the slight bump one day when I tried to close it!

                    I don't have the courage to open this Lenovo laptop, I've watched videos and it seems a bit complicated to me. I'm afraid to do the replacement not correctly! But indeed I have to think seriously about it...

                    Comment


                      #11
                      still OT:
                      If you want to replace it yourself, better use an official Hardware Maintenace Manual from Lenovo and not some random Youtube video (just an example, I don't know if this is your exact Laptop model):
                      https://download.lenovo.com/consumer...hmm_201702.pdf

                      And speaking with several decades of experience repairing computers I suggest not to buy the cheapest battery from China on eBay (nothing against products from China or eBay per se), but something from e.g. iFixit.com or another trustworthy shop (or you will probably buy twice… ).
                      Last edited by Schwarzer Kater; May 23, 2023, 07:21 AM.
                      Debian KDE & LXQt • Kubuntu & Lubuntu • openSUSE KDE • Windows • macOS X
                      Desktop: Lenovo ThinkCentre M75s • Laptop: Apple MacBook Pro 13" • and others

                      get rid of Snap scriptreinstall Snap for release-upgrade scriptinstall traditional Firefox script

                      Comment

                      Working...
                      X