[solved] how to make swap partition permanet

Archived topics about LMDE 1 and LMDE 2
Locked
Linux n00b

[solved] how to make swap partition permanet

Post by Linux n00b »

I have a large swap partition, but LMDE doesn't use it. If I set swap on after boot, it will use for the session only. I suspect this is the problem.

If I run sudo vim /etc/fstab, I can see this:

# swap was on /dev/sda2 during installation
UUID=c6876978-438f-4a1e-ae53-dacdf22d1e4a none swap sw 0 0

The UUID doesn't math any I can find. I know my swap partition is /dev/sda2, if I replace the UUID with /dev/sda2, would it fix the problem?
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Aging Technogeek

Re: how to make swap partition permanet

Post by Aging Technogeek »

Ideally, your OS will not use swap at all. The swap space is there as a place to temporarily store data and instructions if the available ram is all in use. Using swap will slow down your computer .

If you have a newer computer with over a GigaByte of ram, your system should seldom, if ever, use the swap space. Many people with multi GB of ram, do not even install a swap space. I'm sort of a traditionalist. On my desktop with 8 GB of ram I have a token swap space of 256 MB. This is never used, and everything works well.
Linux n00b

Re: how to make swap partition permanet

Post by Linux n00b »

my test laptop is not ideal. It has only 1G RAM, and sometimes OS has to swap (eg. I have multiple tasks running). I already have a partition there, I'd like to use it. Plus, I trust swap partition better than swap file in this case.
User avatar
tdockery97
Level 14
Level 14
Posts: 5058
Joined: Sun Jan 10, 2010 8:54 am
Location: Mt. Angel, Oregon

Re: how to make swap partition permanet

Post by tdockery97 »

I believe the way you mentioned will work. What I personally to is open gparted, right-click the swap partition and select "information". It will display the UUID. I just replace the old bad number in fstab with this number and it works from then on.
Mint Cinnamon 20.1
asymmetros

Re: how to make swap partition permanet

Post by asymmetros »

I just added that line

/dev/sda2 none swap sw 0 0

in the end of fstab file and it just worked.
Nothing else needed.

Also, the # symbol in front of a line, "deletes" it, inactivates it by turning it in a comment.
But as i just said, dont bother with this, add the line i suggested and reboot
Linux n00b

Re: how to make swap partition permanet

Post by Linux n00b »

Thanks, it did the trick.
Locked

Return to “LMDE Archive”