• How to create a swapfile

    Home » Forums » AskWoody support » Linux for the Home user » Linux Mint » How to create a swapfile

    Author
    Topic
    #2441561

    I need info. on how to use the “mkswap” command.  Does it allow you create a swapfile that is the size and location you dictate?  Also, if you don’t want the swapfile, how do you get rid of it?  I have Linux Mint Cinnamon 19.1.  Thanks.

    Being 20 something in the 70's was far more fun than being 70 something in the insane 20's
    Viewing 2 reply threads
    Author
    Replies
    • #2441564
      1 user thanked author for this post.
      • #2441568

        That looks like exactly what I need!  Thank you DrB.  Now why couldn’t they have put this info. in the Linux book I have.  (Rhetorical question)

        Being 20 something in the 70's was far more fun than being 70 something in the insane 20's
        1 user thanked author for this post.
        • #2441600

          What, you want your computing life to be easy??!! (another rhetorical question).

          I’m assuming you’re trying to speed up FF?

          • #2441894

            Yes, and it turns out that I already had a swapfile that Linux Mint installer set up.  It’s size is  2 GB with a swappiness factor of 60 (normal).  It’s located in the Root somewhere and I didn’t see it.

            Being 20 something in the 70's was far more fun than being 70 something in the insane 20's
            • #2441902

              You can also tell if you’ve got a swap file by going to System Monitor, Resources Tab. You’ll see RAM usage and next to that some swap file info.

            • #2441907

              Yeah, I’ve done that and it did show a swapfile that was not being used at all.  I even started Firefox and LibreOffice Writer in addition to the System Monitor, and the swapfile stayed at 0 bytes (0.0%) of 2 GB.  RAM use went up though.

              I guess you have use all your RAM before the swapfile cuts in, which is good.

              Being 20 something in the 70's was far more fun than being 70 something in the insane 20's
      • #2441700

        Install enough RAM so you won’t need a swap file which takes valuable storage space, performs excessive read/writes on HDDs/SSDs..

        • #2441898

          Trying to find RAM for a 2007 Sony Vaio VGN-NR285E is no longer possible (I don’t think) and I’m not a fan of buying from Ebay.  This laptop came with 2 GB of RAM, and it has worked great with everything except the last few update versions of Firefox, which is running a bit slower (another topic).

          Being 20 something in the 70's was far more fun than being 70 something in the insane 20's
          • #2441901

            Try Crucial (Crucial.com I think) You can enter your make, moel number etc. and they’ll tell you if they’ve got it. I’ve found some for as early as a 2009 Acer Aspire laptop.

            1 user thanked author for this post.
    • #2441653

      How can I create a swap file on a Linux system?

      • #2441669

        The makeuseof.com link above tells you how to make a swap file.

      • #2441900

        First make sure you don’t already have one like I did.  Bring up a Terminal window and type – swapon.  That Makeuseof website DrBonzo recommended above gives you all the info. you should need on swapfiles on Linux.

        Being 20 something in the 70's was far more fun than being 70 something in the insane 20's
    • #2441846

      ? says:

      another great topic for linux users!

      i used to do the >sudo swapoff /swapfile, sudo rm /swapfile when using ubuntu 14 and 16, however; on the newer versions the memory is also auto “Cached.” i just leave it alone now because it never swaps when using 4gb or more memory.

      >swapon
      NAME      TYPE SIZE USED PRIO
      /swapfile file 1.3G   0B   -2

      >free -h
      total        used        free      shared  buff/cache   available
      Mem:          3.5Gi       1.2Gi       1.6Gi        17Mi       795Mi       2.1Gi
      Swap:         1.3Gi          0B       1.3Gi

       

      
      
      1 user thanked author for this post.
    Viewing 2 reply threads
    Reply To: How to create a swapfile

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: