Announcement

Collapse
No announcement yet.

Kubuntu 22.04 does not create swap automatically

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Kubuntu 22.04 does not create swap automatically

    Guys, I have a strange problem here, I had a Linux mint 21 installation on my notebook, it has 8gb of ram. Installing mint created a 2GB swap file for this machine.
    Everything running beautifully. Over the weekend I decided to install Kubuntu 22.04 but it didn't automatically create a swap file. I discovered this by using the browser with several tabs open and out of nowhere the browser closed, I went to look at the memory, it was at 100% without using swap. I also put Kubuntu on a stationary notebook that I have here, it has 4GB of ram. And the same thing happened, the swap was not created.

    Do you know if ubuntu or kubuntu took the initiative to not enable swap automatically? Or did I forget to mark something at the time of installation? Or would it be a bug I should report?

    Wow guys.



    #2
    Kubuntu should be creating a swap file (not a partition). You can check quite easily.
    Code:
    $ swapon --show
    NAME    TYPE   SIZE   USED    PRIO
    /swapfile file       2G      0B         -2


    Originally posted by kelvinarruda View Post
    I discovered this by using the browser with several tabs open and out of nowhere the browser closed,
    Now, THAT is probably from the kernel's OOM killer just doing its job properly.
    You might have already been into your swap, or FF tried to grab ALL of it, when it was killed, instead of bringing your whole desktop and OS to a grinding halt.


    Comment


      #3
      I usually follow this guide to create a swap file in Neon:

      https://www.linuxuprising.com/2018/0...d-of-swap.html
      Constant change is here to stay!

      Comment


        #4
        Hey, Thanks for the quick feedback.
        I ran the command in the terminal and got no response. My installs did not generate swapfiles.


        I will create the swapfiles manually.​. But I would like to understand if this is a bug, it possibly affects other people.
        Was the swapfiles created on your installations? Am I doing something wrong in the installation?​

        --
        I will download another ISO for testing.

        See you soon.​

        Comment


          #5
          Originally posted by kelvinarruda View Post
          I will create the swapfiles manually.​. But I would like to understand if this is a bug, it possibly affects other people.
          Was the swapfiles created on your installations? Am I doing something wrong in the installation?​
          it might be a bug, I have a swap file in my Kubuntu installs, as expected.
          My systems are bone stock, with automatic partitioning.
          I wonder if doing manual partitioning doesn't create a swap, which I imagine would be appropriate.Swap isn't mandatory, and can be a separate partition instead of a file.

          Comment


            #6
            All my installations are manually partitioned. I don't create swap partitions because Ubuntu and derivatives create the swapfile.

            I did a test on version 18.04 and the swapfiles were created normally with manual partitioning.

            I'm running a test on version 20.04 at the moment.

            All installations are via ISO. I haven't done any version updates. I'm thinking of testing this.

            Upgrade from 20.04 to 22.04 with manual partitioning to see what happens.

            See you later.

            Comment


              #7
              My tests demonstrate that the swapfiles configuration is not being filled in /etc/fstab.

              On ubuntu 18.04 after installation with manual partitioning and ISO installation, no swap partition creation

              Code:
              $ cat /etc/fstab
              
              # /etc/fstab: static file system information.
              #
              # Use 'blkid' to print the universally unique identifier for a
              # device; this may be used with UUID= as a more robust way to name devices
              # that works even if disks are added and removed. See fstab(5).
              #
              # <file system> <mount point> <type> <options> <dump> <pass>
              # / was on /dev/sda7 during installation
              UUID=b28c932e-bb9e-4d64-8eef-3837490dff87 / ext4 errors=remount-ro 0 1
              # /boot/efi was on /dev/sda2 during installation
              UUID=EE8E-1053 /boot/efi vfat umask=0077 0 1
              /swapfile none swap sw 0 0
              automatic SWAPFILE in fstab.


              On ubuntu 22.04 after installation with manual partitioning and ISO installation, no swap partition creation

              Code:
              $ cat /etc/fstab
              
              # /etc/fstab: static file system information.
              #
              # Use 'blkid' to print the universally unique identifier for a
              # device; this may be used with UUID= as a more robust way to name devices
              # that works even if disks are added and removed. See fstab(5).
              #
              # <file system> <mount point> <type> <options> <dump> <pass>
              # / was on /dev/sda5 during installation
              UUID=06ce5c0c-f1a9-4ab3-a847-ff5204829f65 / ext4 errors=remount-ro 0 1
              No automatic SWAPFILE in fstab.​

              Comment


                #8
                Makes sense, since it is manual partitioning , after all.
                I would say that 18.04's creation of a swap file on a manual drive setup might be the bug, to be honest.

                Not a definitive answer, but here is a lonely bug report for example.
                I can't find reference to a change in behavior, but I didn't dive very deeply.

                Comment


                  #9
                  Originally posted by kelvinarruda View Post
                  Upgrade from 20.04 to 22.04 with manual partitioning to see what happens.
                  An upgrade is not going to add, remove, or change swap files or partitions at all.

                  Comment


                    #10
                    I always do manual installs, and as a part of that I assume that my assumptions and developer's assumptions will not agree. My manual installs always include a swap partition. Again, assumptions ...

                    "Always" means once every two years - unless something leads me to believe that there are problems afoot. So far, so good
                    The next brick house on the left
                    Intel i7 11th Gen | 16GB | 1TB | KDE Plasma 5.27.11​| Kubuntu 24.04 | 6.8.0-31-generic



                    Comment


                      #11
                      Having a smallish swap file that won't normally be used can be nifty. Running free you can see if the swap has been touched:
                      • If the dreaded oom (out of memory) killer has struck, or is about to, there's not much evidence, but one can see if the swap file has been, or is being, used.
                      • If a system should not be ever short of memory, seeing any swap usage is a warning, perhaps well after the event.
                      Regards, John Little

                      Comment


                        #12
                        Originally posted by claydoh View Post
                        Makes sense, since it is manual partitioning , after all.
                        I would say that 18.04's creation of a swap file on a manual drive setup might be the bug, to be honest.

                        Not a definitive answer, but here is a lonely bug report for example.
                        I can't find reference to a change in behavior, but I didn't dive very deeply.
                        I understand, but since Ubuntu started using swapfiles instead of swap partitions, I always selected "manual partition" defining partition "/" and Ubuntu automatically created swapfiles. And was it a bug since the swapfiles deployment?

                        Do I have to change behavior now? Create swap partitions when selecting "manual partition" in installation ?​
                        ----

                        In another test I did, I installed kubuntu 20.04 and the swapfiles were created automatically using "manual partition".
                        I upgraded via the package manager to kubuntu 22.04 and the swapfiles remained.
                        Last edited by kelvinarruda; Sep 07, 2023, 05:08 PM.

                        Comment


                          #13
                          Or create the swap file manually post install?......

                          I still have no idea which is the intended behavior, or if/when it changed. But changes are not uncommon

                          But feel free to report a bug on Launchpad, I only found the one I linked to on this topic.

                          Comment


                            #14
                            Thanks,

                            Ok, I made the report on launchpad. I'm going back to using the swap partition instead of swapfiles.
                            So I keep this partition created for all my operating systems.

                            See you later.​

                            Comment

                            Working...
                            X