[SOLVED]Swap space gone with the wind on 19.2

Quick to answer questions about finding your way around Linux Mint as a new user.
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
akstirling

[SOLVED]Swap space gone with the wind on 19.2

Post by akstirling »

As my laptop has a paltry 2GB RAM decided to explore increasing size of my swap file .... i tried a set of instructions which utilized the terminal but only got so far

before being pulled up by an error .... this approach involved deactivating my existing 2GB swapfile ..... so then tried creating a 6Gb swap partition using gparted,

the creation of which worked, but on reboot am still left with no swap (confirmed by System Monitor)......?
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.
WharfRat

Re: Swap space gone with the wind on 19.2

Post by WharfRat »

Check grep swap /etc/fstab

The 19 series of Mint switched to a swap file in lieu of a partition.

You will have to change the fstab entry to reference the new swap partition.
jglen490

Re: Swap space gone with the wind on 19.2

Post by jglen490 »

Correction, Mint ADDED swap file capability. At no time has Linux abandoned the use of SWAP partitions.
akstirling

Re: Swap space gone with the wind on 19.2

Post by akstirling »

Check grep swap /etc/fstab
Have run the command and got following:

Code: Select all

root@janal-Lenovo-ideapad-110S-11IBR:/home/janal# grep swap /etc/fstab
/swapfile                                 none            swap    sw              0       0
root@janal-Lenovo-ideapad-110S-11IBR:/home/janal# grep swap.*sw /etc/fstab
/swapfile                                 none            swap    sw              0       0
root@janal-Lenovo-ideapad-110S-11IBR:/home/janal# free -m
              total        used        free      shared  buff/cache   available
Mem:           1842        1039         324         162         478         498
Swap:             0           0           0

Code: Select all

root@janal-Lenovo-ideapad-110S-11IBR:/home/janal# sudo blkid
/dev/mmcblk0p1: UUID="66fa55fc-0abc-4d26-bc45-33c207870b15" TYPE="ext4" PARTUUID="eef1da41-4a09-49a4-b377-9c46d48ed75e"
/dev/sda1: UUID="cbe15a21-7a76-4c33-8c30-c317820fd2ec" TYPE="ext4" PTTYPE="dos" PARTUUID="e4b47560-01"
/dev/sda2: LABEL="SWAP" UUID="699982af-1ba9-4a4c-86dc-f432436b1896" TYPE="swap" PARTUUID="e4b47560-02"
/dev/mmcblk2p1: LABEL="bigmusic" UUID="4E040FAC040F95DD" TYPE="ntfs" PARTUUID="aa8e97fc-01"
/dev/sdb1: LABEL="TIMESHIFT" UUID="f4102f75-f22c-4c61-8bd0-bf4caf00ebce" TYPE="ext4" PARTUUID="6a61fc5a-01"
/dev/mmcblk0: PTUUID="9d6e2060-bdb4-4c7b-bf76-d7ff53d413ee" PTTYPE="gpt"
/dev/mmcblk2: PTUUID="aa8e97fc" PTTYPE="dos"
root@janal-Lenovo-ideapad-110S-11IBR:/home/janal#
so how do i access the fstab page i need to add the the swap partition to, and what syntax do i use??
decrepit
Level 5
Level 5
Posts: 858
Joined: Mon Dec 03, 2018 4:07 am
Location: Mandurah Western Australia

Re: Swap space gone with the wind on 19.2

Post by decrepit »

to edit /etc/fstab.

Code: Select all

sudo xed /etc/fstab
if you're using mate, other distro may have different editors, replace "xed" with your text editor.

So here's my /etc/fstab
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/sda1 during installation
UUID=0ad07873-0f81-4d07-aa21-913f888e8666 / ext4 noatime,errors=remount-ro 0 1
# /home was on /dev/sda2 during installation
UUID=9127e8d2-5030-4a42-8bf8-4ce38a60fad5 /home ext4 noatime,defaults 0 2
# swap was on /dev/sdb7 during installation
UUID=66772506-465f-4e0a-8ec6-2363bf17272e none swap sw 0 0
At the moment you have this as swap
/dev/sda2: LABEL="SWAP" UUID="699982af-1ba9-4a4c-86dc-f432436b1896" TYPE="swap" PARTUUID="e4b47560-02"
Do

Code: Select all

blkid
To get the UUID of your new swap partion, and change it for the one above.

BUT the best result would be if you can add more ram
akstirling

Re: Swap space gone with the wind on 19.2

Post by akstirling »

At the moment you have this as swap
no I have no swap as per:

# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/sda1 during installation
UUID=cbe15a21-7a76-4c33-8c30-c317820fd2ec / ext4 errors=remount-ro 0 1
/swapfile none swap sw 0 0

/dev/sda2: LABEL="SWAP" UUID="699982af-1ba9-4a4c-86dc-f432436b1896" TYPE="swap" PARTUUID="e4b47560-02"

is the partition created alongside my Linux partition, and for whatever reason did not activate .....
take your point re RAM but, courtesy of Lenovo's aversion to expandibility, a forced compromise ....
WharfRat

Re: Swap space gone with the wind on 19.2

Post by WharfRat »

akstirling,

You do have a swap file entry in fstab
/swapfile none swap sw 0 0

And you do have a swap partition
/dev/sda2: LABEL="SWAP" UUID="699982af-1ba9-4a4c-86dc-f432436b1896" TYPE="swap" PARTUUID="e4b47560-02"

If you ls -lh /swapfile you'll list the file.

To switch to the partition the fstab entry would have to be changed to

UUID=699982af-1ba9-4a4c-86dc-f432436b1896 none swap sw 0 0

Then reboot
User avatar
Rocky Bennett
Level 5
Level 5
Posts: 711
Joined: Tue May 12, 2015 6:22 pm
Location: New Mexico, USA

Re: Swap space gone with the wind on 19.2

Post by Rocky Bennett »

To the OP, I hope that you don't have an SSD. If you have an SSD then just add more RAM.
User avatar
zcot
Level 9
Level 9
Posts: 2838
Joined: Wed Oct 19, 2016 6:08 pm

Re: Swap space gone with the wind on 19.2

Post by zcot »

akstirling wrote: Sat Aug 17, 2019 5:26 am so how do i access the fstab page i need to add the the swap partition to, and what syntax do i use??

Code: Select all

xed admin:///etc/fstab
viewtopic.php?t=279102


to see what swap is active: swapon -s

you can turn off the original swap file if it is shown as still active with swapoff /swapfile and then you can remove it with sudo rm /swapfile. That will free the 2GB space back of the original file.

and get rid of this line in fstab or replace it as already mentioned below: /swapfile none swap sw 0 0

WharfRat wrote: Sat Aug 17, 2019 9:35 am To switch to the partition the fstab entry would have to be changed to

UUID=699982af-1ba9-4a4c-86dc-f432436b1896 none swap sw 0 0

Then reboot
jglen490

Re: Swap space gone with the wind on 19.2

Post by jglen490 »

Rocky Bennett wrote: Sat Aug 17, 2019 11:24 am To the OP, I hope that you don't have an SSD. If you have an SSD then just add more RAM.
Not sure what you are getting at - about the SSD comments :?:
User avatar
Rocky Bennett
Level 5
Level 5
Posts: 711
Joined: Tue May 12, 2015 6:22 pm
Location: New Mexico, USA

Re: Swap space gone with the wind on 19.2

Post by Rocky Bennett »

Having an old fashioned swap partition does a lot of writing/reading on to the storage device. For an SSD it drastically reduces the life expectancy.
decrepit
Level 5
Level 5
Posts: 858
Joined: Mon Dec 03, 2018 4:07 am
Location: Mandurah Western Australia

Re: Swap space gone with the wind on 19.2

Post by decrepit »

akstirling wrote: Sat Aug 17, 2019 7:10 am >>
no I have no swap as per:
>>>>
/swapfile none swap sw 0 0
>>
Yes this is confusing, unless taken in the fstab context. The "none" refers to no mount point, not that it's inactive.

And I was in a rush last night, so forgot to mention, swapfiles as mentioned above can have a very wearing effect on SSDs. Also swapping slows things down. If more ram isn't an option have a read of Pjor's guide to speeding up mint. There's things you can do to save ram, that are nice if you have an abundance of it, but slows things down if you haven't.

https://easylinuxtipsproject.blogspot.c ... t.html#ID5
Locked

Return to “Beginner Questions”