• Vehicles • Fashion • Recipes • Blogs • Hunt • Travels • Sport • Fun • Handmade • IT • Education
Mini-Games
x

x
zakruti.com » IT - Software » IT, programs, coding
Adding And Removing Swap Files Is Easy In Linux DistroTube

Adding And Removing Swap Files Is Easy In Linux DistroTube

FBTwitterReddit

video description

Rating: 4.0; Vote: 1
Adding And Removing Swap Files Is Easy In Linux DistroTube In this quick tutorial, I am going to create a swap file on my Linux desktop. I'm also going to show you how to remove a swap file. Below are the commands that I used in this video: - ADDING SWAP FILE - sudo dd if=/dev/zero of=/swapfile bs=1M count=1024 - sudo chmod 600 /swapfile - sudo mkswap /swapfile - sudo swapon /swapfile - swapon show Edit /etc/fstab and add: - /swapfile none swap defaults 0 0 REMOVING SWAP FILE - sudo swapoff -v /swapfile - sudo rm /swapfile Edit /etc/fstab and remove the entry for the swapfile
Date: 2022-03-30

Comments and reviews: 10


Hello DistroTube! One thing to consider. Having a swap file (or swap partition) can be beneficial from performance point of view even if you do not expect to exceed your RAM i any way. Generally speaking Linux kernel is pretty smart with regardst to managing memory and it can move currently unused memory pages to swap and then use regained ram for caching IO etc. There are many sources about that mechanism, I recommend diving a little bit deeper when it comes to the role of swap in mordern OSes.
reply

I asked for help in the archlinux telegram group
The first thing some person in there noticed was my swap because I made 16gb swapfile, ridiculed me and proceeded to ask me -why do you need 16gb of swapfile?-
Lmao, like what does it matter
Also, they all proceeded to just ignore me altogether, someone just told me to -refer to archwiki- which I did....for 5 hours for about a week
Yeah the community sucks, I-m so glad yours is fantastic so far

reply

Hey DT, why not trying Deepin v20 and review it ?
Im also not a big fan of Desktop environments and I've been living in various twm for a while now but this version of Deepin seems really polished and could be appealing to macOs users, it's generally the Gnome DE which fullfil this need but as you know it sometimes does a really poor job + their coc is .... wonderful.
Btw good luck I appreciate your work

reply

Before I go, you can use a safer alternative by setting the EDITOR env var and issuing -sudoedit - which uses a temp file like visudo for security purposes and when you save your changes tells you how many likes were changed or if you made any changes at all. That way if you made no changes but still try to save on exit you don't affect the mod timestamp. I feel safer using sudoedit.
reply

In case there is a memory leak and the RAM fills up, there are two possibilities. If there is no swapfile, the kernel will kill some running processes. If there is a swapfile, the kernel will dump memory contents onto the slow spinning drive, potentially resulting in the system trashing or freezing. Which one should I choose? Which one is worse?
reply

bs=block size. Not byte size. Also, for years, I've been told you must place the swap file in /. When asked why, the most common response is -because-. Me being me, I challenged that on my own system. I have a 10 year old laptop with 4G of RAM. My swap file exists at /home/swapfile, just because. And it works without issue.
reply

Derek, do not know if someone already told you but you are a great teacher!
Please keep continuing to create videos like this where you explain your actions (-you do that with this command which means that...-) as this approach is so easy to follow, especially for Win->Linux converts like myself.
Cheers!

reply

Unrelated but, did you install xmonad from the AUR, pacman or cabal? I can't seem to install it with cabal due to problems between my ghc version and xmobar (would be nice to have it compiled with all features) :(
reply

i keep getting a invalid argument when i try running swapon, im running on manjaro xfce
i followed all your instructions but when i tried the swapon /swapfile it said invalid argument

reply

In principle, the swap partition may already be outdated, or at least Linux was looking into the future until the moment when hdd disk storage will be the same in speed as at least RAMddr4.
reply
Add a review, comment






Other channel videos