Announcement

Collapse
No announcement yet.

SWAP size inconsistencies

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

    [SOLVED] SWAP size inconsistencies

    I've done a fresh install of Kubuntu 18.04 and noticed something strange.
    The SWAP partition size is showing wrong in Task Manager.
    See screenshots

    GParted shows just over 30Gb
    System Monitor shows double the size...

    Is this a known bug or something?
    Kubuntu 18.04LTS~64bit|Plasma 5.12.9|KDE 5.47.0|QT 5.9.5|Linux 5.3.0.40~generic|M5A78L-M USB3|BIOS 2101|AMD PhenomII X4 965 3400+|P8H77-I Motherboard NIC|8.0GB PC3-10600 1333Mhz CL9 (9-9-9-24)DDR3

    #2
    What is the output of the command:
    Code:
    swapon --show

    Comment


      #3
      What's the swap line(s) in your /etc/fstab?

      Could be you have both a swap file and a swap partition.

      Please Read Me

      Comment


        #4
        Originally posted by oshunluvr View Post
        Could be you have both a swap file and a swap partition.
        "swapon --show" should tell us if that's the case

        Comment


          #5
          Yep, you win a prize...

          NAME TYPE SIZE USED PRIO
          /dev/sdb5 partition 30.5G 1M -2
          /dev/sda1 partition 30.5G 0B -3
          Last edited by pooky2483; Mar 09, 2020, 08:54 AM.
          Kubuntu 18.04LTS~64bit|Plasma 5.12.9|KDE 5.47.0|QT 5.9.5|Linux 5.3.0.40~generic|M5A78L-M USB3|BIOS 2101|AMD PhenomII X4 965 3400+|P8H77-I Motherboard NIC|8.0GB PC3-10600 1333Mhz CL9 (9-9-9-24)DDR3

          Comment


            #6
            You have two swap partitions, not the default swap file, on two separate hard drives. *buntu will automatically make use of any existing swap partition it finds during booting, say from another OS install. You can get rid of the one on the same drive as Kubuntu (delete and resize another partition), and have both OSs use the same swap partition.

            Comment


              #7
              I would check and possibly edit fstab first. AFAIK, the installer finds all your swap partitions at install time and add entries to fstab. You don't want to delete a swap partition before removing it from fstab or you might not be able to boot.

              Also, since we're on this topic - not that it's a big deal - but "swapon" without any options gives the same results as "swapon --show", at least it does on 18.04

              Please Read Me

              Comment


                #8
                My 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=a0207414-3a8a-4414-8b6a-3fa373ec8eca / ext4 errors=remount-ro 0 1
                # swap was on /dev/sda1 during installation
                UUID=8fa66fc7-5e92-466e-b69b-fc47e7aa206e none swap sw 0 0
                # swap was on /dev/sdb5 during installation
                UUID=db4a8f5c-eba4-4ded-a3b9-bdbfc4412beb none swap sw 0 0

                I have Kubuntu 16.04 on another HD
                Kubuntu 18.04LTS~64bit|Plasma 5.12.9|KDE 5.47.0|QT 5.9.5|Linux 5.3.0.40~generic|M5A78L-M USB3|BIOS 2101|AMD PhenomII X4 965 3400+|P8H77-I Motherboard NIC|8.0GB PC3-10600 1333Mhz CL9 (9-9-9-24)DDR3

                Comment


                  #9
                  After what you said, I believe it's safe to leave them, however, I did some digging and found that it's best not to have SWAP on a SSD.
                  Read the fist comment to this...
                  https://linuxize.com/post/how-to-add...#disqus_thread
                  Kubuntu 18.04LTS~64bit|Plasma 5.12.9|KDE 5.47.0|QT 5.9.5|Linux 5.3.0.40~generic|M5A78L-M USB3|BIOS 2101|AMD PhenomII X4 965 3400+|P8H77-I Motherboard NIC|8.0GB PC3-10600 1333Mhz CL9 (9-9-9-24)DDR3

                  Comment


                    #10
                    With 8G RAM, unless you do heavy-duty graphics/video editing, you're hardly ever going to use swap.
                    Unless, of course, if you hibernate/sleep etc.
                    So I guess you might as well keep it, "just in case".

                    If you'd like to know how much RAM you're using - without resorting to ksysguard and such - you could just have a a little conky on screen.
                    For real memory usage, I use - among other instructions:
                    ${execbar free -m | awk '/Mem:/ { printf ( $2-$7 ) /$2*100 }'}

                    [EDIT] If you'd like to see my conky, and what the other instructions are, it's here.
                    Last edited by Don B. Cilly; Mar 09, 2020, 03:11 PM.

                    Comment


                      #11
                      Originally posted by pooky2483 View Post
                      After what you said, I believe it's safe to leave them, however, I did some digging and found that it's best not to have SWAP on a SSD...
                      I disagree. SWAP is only used when your RAM is too full for what you are doing, which is rare unless you have a bare minimum of RAM or are a very heavy process user. Swapping RAM to a device makes access unbearably slow. What's the point of having a nice high-speed SSD if you're not going to take advantage of the speed? Modern (five years old or less) SSDs will last at least as long as any hard drive. So what are you "saving" the SSD for exactly? If you're using swap a lot you'd be much better off with more RAM and an SSD. The people who make these sort of claims are frankly just trying to make themselves sound important by quoting minute technical details and spreading FUD without any regard to actual normal usage. Most of us live in the real world, and in the real world, your computer and it's SSD will likely outlive it's usefulness so what's the point of not using the SSD to it's full extent?

                      Regardless, I agree with Don that you have way more swap than you'll ever need. But you are also correct that you're not hurting anything by leaving it alone. The general advice I give on SWAP size is SWAP should match the size of your RAM if you hibernate your computer, at least double if you have a small amount of RAM (4GB or less IMO), and half as much if you don't hibernate and have a lot of RAM (16GB or more). Then tune your swap (your link has some good pointers in that area).

                      Some other interesting thoughts on SWAP: If you have two swap partitions you can use them both in RAID0 style by mounting them with matching priority. If one is on SSD and the other on HDD, give the SSD swap higher priority. If you care to keep your TMPFS (temporary files) in RAM instead of on a drive (speeds access for a lot of operations), you can create a TMPFS size as large or even larger than your RAM, and it will use swap as your RAM fills - thus allowing you the best of both worlds - TMPFS in RAM until RAM starts to fill, then TMPFS moves to disk via SWAP to allow processes to use more RAM. I do this last one, but I also have an NVME drive and 16GB RAM along with some SSDs and HDDs. I can afford the space for swap on SSD

                      Please Read Me

                      Comment


                        #12
                        Originally posted by oshunluvr View Post
                        But you are also correct that you're not hurting anything by leaving it alone.
                        If the 16.04 install was hibernated, will using its swap as swap in 18.04 screw it up?
                        Regards, John Little

                        Comment


                          #13
                          Originally posted by jlittle View Post
                          If the 16.04 install was hibernated, will using its swap as swap in 18.04 screw it up?
                          More than likely.

                          And 60Gb is a ridiculous amount of swap (even if storage space is cheap). If you ever need as much, you'll have bigger problems than running out of swap space.

                          Comment

                          Working...
                          X