Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Change Swapfile from 2.1KiB to 16.0KiB
#1
Hello All,

I have had some slowness and temp stops with the last two Ubuntu LTS programs.  (1604-1804)
Can anyone tell me how to increase my Swapfile from 2.1 to 16.0KiB which I have on my Motherboard.
I use Ubuntu Mate 18.04.1 With an I-5 Intel CPU, and Kernel 4.15.0.32.

    Thanks In Advance, mapcap2001
Reply
#2
Code:
shell> sudo dd if=/dev/zero of=/swapfile1 bs=1024 count=16
shell> sudo chown root:root /swapfile1
shell> sudo chmod 0600 /swapfile1
shell> sudo mkswap /swapfile1
shell> sudo swapon /swapfile1
shell> sudo echo "/swapfile1 none swap sw 0 0" >> /etc/fstab

A few things:

1) Copy /etc/fstab
shell> sudo cp /etc/fstab /etc/fstab-preswapedit
2) This is only for 16K as requested (that is ultra small)
3) The above assumes you don't have a file named swapfile1 in your root filesystem. If so you'll need to alter the name.
4) You need to remove the entry in /etc/fstab to your current file. Reboot. Then delete the old file. REBOOT FIRST!!! Your system will be using that file. You could use the swap disable command and then remove the file. Still rebooting will test your setup.
Jeremy (Mr. Server)

* Desktop: Ubuntu MATE
* Windows are for your walls, Apple is for your health, Linux is for your computer
Reply
#3
(08-20-2018, 09:00 PM)mapcap2001 Wrote: Hello All,

I have had some slowness and temp stops with the last two Ubuntu LTS programs.  (1604-1804)
Can anyone tell me how to increase my Swapfile from 2.1 to 16.0KiB which I have on my Motherboard.
I use Ubuntu Mate 18.04.1 With an I-5 Intel CPU, and Kernel 4.15.0.32.

    Thanks In Advance, mapcap2001


Can you explain the "increase my Swapfile from 2.1 to 16.0KiB which I have on my Motherboard." comment?   This is very puzzling to me.    

There are many resource constraints that can cause system slowness.  On a single user desktop or laptop the primary culprits are cpu utilization, memory pressure, and I/O bottlenecks.   And resolving one bottleneck can uncover additional bottlenecks.  Have you tried any performance monitor to help identify any resource bottlenecks like free -ht, vmstat, or top.

Providing a system hardware overview might help with further troubleshooting in the forum. 

CPU 
memory
hdd/sdd
typical application load

A free -ht, vmstat, and top screen shots during the slow down.
Idea Give a person a fish, and you feed them for a day. Teach a person how to fish, and you feed them for a lifetime. ✝️ Proverbs 4:7 Wisdom is the principal thing; therefore get wisdom: and with all thy getting get understanding.  (Linux Mint 19 XFCE)
Reply
#4
Typing HTOP in terminal also works nicely.
Reply
#5
(08-21-2018, 04:11 PM)rjs1943 Wrote: Typing HTOP in terminal also works nicely.

# Yes htop is good, but glances is better in this case. It gives more information.

sudo apt install glances && glances

# I use both htop and glances depending on the situation.
A computer without Microsoft is like a piece of chocolate cake without ketchup and mustard.


Telegram @eliasw4u
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)