Help with GParted -- no swap file after standard installation.

Straitsfan

New Member
Joined
Dec 13, 2021
Messages
25
Reaction score
6
Credits
283
Hi. Got a fresh install of Elementary OS on my Dell Latitude. Works just fine, but I chose to do a standard installation instead of a custom partitioning. I installed GParted and noticed that there's no swap file. I've attached the screenshot.

I'd like to know how to use Gparted to add a swap file. I'm not sure exactly what to d, and I don't want to eliminate any data, including any part of the OS itself, if that's possible to do. I haven't put any personal data on the machine yet. I thought the installation would set up a swap file, but I've only got 4MB of unallocated space, and I'm not sure how big to make the swap file.

Can anyone out there offer any tips/instructions, etc?

Thanks.
 

Attachments

  • Screenshot from 2025-02-23 14.10.13 -- GParted .png
    Screenshot from 2025-02-23 14.10.13 -- GParted .png
    37.5 KB · Views: 13


In terminal run the below and copy/paste the results back here, please

Code:
swapon
 
In addition to @Mike-W0BTU's question is your drive encrypted ?
 
The SSD is about 9 years old or so maybe a few years younger. But it still works.
 
How much ram does your pc have ?
 
I was afraid of that. I doubt that any SSD that old has wear leveling.

I suggest zram, if you have enough RAM.
 
Last edited:
A swap file is likely to significantly reduce the life of your SSD.
 
Here's some links I saved when I installed zram.



 
8 GB will do. I have Debian and Manjaro -both using KDE Plasma- on my computer. Zram is seldom written to, FWIW.

No swapfile or swap partition on my SSD.
 
Last edited:
if I am reading that correctly, it shows you have a swap file of 3.8GB, with none being used at that moment

NAME TYPE SIZE USED PRIO
/dev/dm-2 partition 3.8G 0B -2

Unless you are rendering videos and the like, that is more than enough

To give you a further idea, I run on 32GB of ram with zero swap
 
This makes for an interesting read: It comes from this site by @dos2unix

 
if I am reading that correctly, it shows you have a swap file of 3.8GB, with none being used at that moment

NAME TYPE SIZE USED PRIO
/dev/dm-2 partition 3.8G 0B -2

Unless you are rendering videos and the like, that is more than enough

To give you a further idea, I run on 32GB of ram with zero swap
when you say none being used, does that mean I have to sort of 'turn it on'? or does it mean that it just doesn't need to be used at the moment but will be when necessary?
 
Go with a swap file.

You can go without one, but they still use swap for a variety of reasons. Swap is not just a place the kernel stuffs things when you're low on RAM, it does quite a bit more to improve performance.
 
Go with a swap file.

You can go without one, but they still use swap for a variety of reasons. Swap is not just a place the kernel stuffs things when you're low on RAM, it does quite a bit more to improve performance.
Can you tell me how to make a swap file, if there isn't one there? or does Condobloke have it correct?
 
Until we know the make and model of your SSD, I strongly suggest that you neither create a swap file nor a swap partition.

That will tell us if it has built-in wear leveling.

Many early SSDs without it had their lives prematurely shortened by using a swapfile or swap partition. Sorry I don't have time to go into any more details right now.
 
the hard disk I think is a SANDISK, but I can't tell the model number. It's a 2.5 inch SATA drive if that makes any difference.

I ran the lsblk command and this is what I got:

NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
sda 8:0 0 931.5G 0 disk
├─sda1 8:1 0 1.2G 0 part /boot
└─sda2 8:2 0 930.3G 0 part
├─data-root 252:0 0 926.5G 0 lvm /
└─data-swap 252:1 0 3.8G 0 lvm
└─cryptswap 252:2 0 3.8G 0 crypt [SWAP]
sdb 8:16 1 29.8G 0 disk
└─sdb1 8:17 1 29.8G 0 part /media/christopherlaurenzano/SANDISK
sr0 11:0 1 1024M 0 rom


I don't know if this helps, but maybe it does. I got the computer from my mother who didn't need it any more, and she had a new SSD installed after the other one gave out. I'm not sure if the place that put it in would have her record, but I can try and get back to you.
 


Staff online


Latest posts

Top