Page 1 of 1

Do I have a swap file / partition? SOLVED

Posted: Sat Jun 29, 2019 10:25 am
by benchrest
I intended to have a swap file when I installed 19 but on reviewing / updating my installation documentation I am not sure. I have 8 GB ram and
I have never seen much more than half used. So having swap maybe mute. Using "top" command I see:
Screenshot from 2019-06-29 09-04-07.png
edit: apparently I can't figure out how to post a screenshot.

This shows I have 2 GB of swap space I believe with zero used. I believe this is what I would have set.

However sudo fdisk -l shows no swap partition. This device is a 256 GB SSD:

Disk /dev/sda: 238.5 GiB, 256060514304 bytes, 500118192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 0020BF61-531E-4B5E-8150-EAA228A949D9

Device Start End Sectors Size Type
/dev/sda1 2048 1050623 1048576 512M EFI System
/dev/sda2 1050624 500117030 499066407 238G Linux filesystem

fstab shows:

# /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/sda2 during installation
UUID=db4d8d86-d2a2-43db-9a75-5e954f012489 / ext4 errors=remount-ro 0 1
# /boot/efi was on /dev/sda1 during installation
UUID=9996-2DFF /boot/efi vfat umask=0077 0 1
/swapfile none swap sw 0 0

I'm not sure what this tells me about my swap space.
Do I have swap but it is in the /boot/efi partition? I have been running like this for probably 4 months or so. I am not new to linux, have been running LM since about 2010 and have never installed without swap before. I have never seen fdisk without showing a swap partition.
Rich

Re: Do I have a swap file / partition?

Posted: Sat Jun 29, 2019 10:42 am
by rjsrjs
If you don't have it, install HTOP in terminal, run it from terminal, type in htop ,and in the top section it will show your swap file and how much is being used. :)

Re: Do I have a swap file / partition?

Posted: Sat Jun 29, 2019 10:44 am
by athi
benchrest wrote:
Sat Jun 29, 2019 10:25 am
I intended to have a swap file when I installed 19 but on reviewing / updating my installation documentation I am not sure. I have 8 GB ram and
I have never seen much more than half used. So having swap maybe mute. Using "top" command I see:

Screenshot from 2019-06-29 09-04-07.png edit: apparently I can't figure out how to post a screenshot.

This shows I have 2 GB of swap space I believe with zero used. I believe this is what I would have set.

However sudo fdisk -l shows no swap partition. This device is a 256 GB SSD:

Disk /dev/sda: 238.5 GiB, 256060514304 bytes, 500118192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 0020BF61-531E-4B5E-8150-EAA228A949D9

Device Start End Sectors Size Type
/dev/sda1 2048 1050623 1048576 512M EFI System
/dev/sda2 1050624 500117030 499066407 238G Linux filesystem

fstab shows:

# /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/sda2 during installation
UUID=db4d8d86-d2a2-43db-9a75-5e954f012489 / ext4 errors=remount-ro 0 1
# /boot/efi was on /dev/sda1 during installation
UUID=9996-2DFF /boot/efi vfat umask=0077 0 1
/swapfile none swap sw 0 0

I'm not sure what this tells me about my swap space.
Do I have swap but it is in the /boot/efi partition? I have been running like this for probably 4 months or so. I am not new to linux, have been running LM since about 2010 and have never installed without swap before. I have never seen fdisk without showing a swap partition.
Rich
Mint 19 uses swap file instead of swap partition by default. If you did not create a swap partition, Mint will automatically create a swap file for you. that is why you cannot see a swap partition.

There were several posts about need for a swap file/partition, I have 16Gb of ram and still create a swap partition. Here is link to one of the post
viewtopic.php?f=90&t=295720&hilit=swap

Re: Do I have a swap file / partition?

Posted: Sat Jun 29, 2019 10:57 am
by trytip
free the basic memory command in Terminal will tell you. you can also open system monitor and check in resources under swap

Re: Do I have a swap file / partition? SOLVED

Posted: Sat Jun 29, 2019 11:05 am
by benchrest
Thanks for your answers. So I am not completely crazy, I did set swap to 2 GB. I don't remember seeing anything about this in the release notes. I ran
sudo swapon --show
which shows I have 2 GB active with zero used.
I have also change swappiness from 60 to 10
Thanks again, Rich

Re: Do I have a swap file / partition? SOLVED

Posted: Sat Jun 29, 2019 1:27 pm
by DAMIEN1307
The "system monitor" on the "resources" tab in the middle right side graph screen also shows any swap usage in real time...i also have an Intel 15 quad core CPU as well as 8 gigs ram...it has never used the swap file at all even when playing 1080p at 60 fps videos movies etc...you should be just fine...DAMIEN