LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 04-11-2022, 12:36 PM   #1
arubin
Senior Member
 
Registered: Mar 2004
Location: Middx UK
Distribution: Slackware64 15.0 (multilib)
Posts: 1,350

Rep: Reputation: 75
Is it possible to install Slackware without swap?


I am not convinced that I will need swap as I don't generally run may programs at the same time. Is it possible to get through the installation process without adding a swap partition?
 
Old 04-11-2022, 12:42 PM   #2
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,058

Rep: Reputation: Disabled
This is possible, but not recommended. If you do not want to set a swap partition, you could set instead a swap file after installation.
 
2 members found this post helpful.
Old 04-11-2022, 01:05 PM   #3
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
Quote:
Originally Posted by arubin View Post
I am not convinced that I will need swap as I don't generally run may programs at the same time. Is it possible to get through the installation process without adding a swap partition?
Swap is not a requirement, but it is still recommended... even with high RAM systems.

As Didier mentioned, you can even do a swapfile instead of a completely separate partition.
 
1 members found this post helpful.
Old 04-11-2022, 01:06 PM   #4
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,337

Rep: Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548
Quote:
Originally Posted by arubin View Post
I am not convinced that I will need swap as I don't generally run may programs at the same time.
Swap is used for a few other functions beside taking care of a memory overload. It is also used for the sleep and hibernate functions. If you use one of these functions then you need a swap file a little bigger than your memory size.
 
Old 04-11-2022, 02:17 PM   #5
LuckyCyborg
Senior Member
 
Registered: Mar 2010
Posts: 3,505

Rep: Reputation: 3320Reputation: 3320Reputation: 3320Reputation: 3320Reputation: 3320Reputation: 3320Reputation: 3320Reputation: 3320Reputation: 3320Reputation: 3320Reputation: 3320
Quote:
Originally Posted by jailbait View Post
Swap is used for a few other functions beside taking care of a memory overload. It is also used for the sleep and hibernate functions. If you use one of these functions then you need a swap file a little bigger than your memory size.
Technically, the swap image is saved in a compressed form, then if you use the memory almost at max without going into swap, you can still hibernate well in a swap partition with half of size of memory - tested by myself with great success in the last 10 years or so.

This is my personal and well tested recipe for the swap partition size: half of memory size.

Last edited by LuckyCyborg; 04-11-2022 at 02:20 PM.
 
Old 04-11-2022, 02:50 PM   #6
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
Quote:
Originally Posted by LuckyCyborg View Post
Technically, the swap image is saved in a compressed form, then if you use the memory almost at max without going into swap, you can still hibernate well in a swap partition with half of size of memory - tested by myself with great success in the last 10 years or so.

This is my personal and well tested recipe for the swap partition size: half of memory size.
Does this require certain things like zswap or does hibernation automatically compress the memory contents without any tweaks needed?

(I've never set up hibernation as all my systems basically run 24/7.)
 
Old 04-11-2022, 02:53 PM   #7
marav
LQ Sage
 
Registered: Sep 2018
Location: Gironde
Distribution: Slackware
Posts: 5,366

Rep: Reputation: 4081Reputation: 4081Reputation: 4081Reputation: 4081Reputation: 4081Reputation: 4081Reputation: 4081Reputation: 4081Reputation: 4081Reputation: 4081Reputation: 4081
Quote:
Originally Posted by LuckyCyborg View Post
Technically, the swap image is saved in a compressed form, then if you use the memory almost at max without going into swap, you can still hibernate well in a swap partition with half of size of memory - tested by myself with great success in the last 10 years or so.

This is my personal and well tested recipe for the swap partition size: half of memory size.
I always follow (more or less) RH recommendations:
https://access.redhat.com/documentat...e/ch-swapspace
 
1 members found this post helpful.
Old 04-11-2022, 03:35 PM   #8
hitest
Guru
 
Registered: Mar 2004
Location: Canada
Distribution: Void, Debian, Slackware, VMs
Posts: 7,342

Rep: Reputation: 3746Reputation: 3746Reputation: 3746Reputation: 3746Reputation: 3746Reputation: 3746Reputation: 3746Reputation: 3746Reputation: 3746Reputation: 3746Reputation: 3746
Quote:
Originally Posted by Didier Spaier View Post
This is possible, but not recommended. If you do not want to set a swap partition, you could set instead a swap file after installation.
Agreed! I would set up a small swap partition during installation or afterwards as Didier mentioned. Once in a while you may be doing some high memory intensive activities like compiling a giant application on SBo. Hard drives these days are huge so setting aside a 2 GB swap file will not impact your day to day computer usage. It's better to have swap and not need it than to need swap and and have your PC run out of memory.
 
Old 04-11-2022, 03:37 PM   #9
LuckyCyborg
Senior Member
 
Registered: Mar 2010
Posts: 3,505

Rep: Reputation: 3320Reputation: 3320Reputation: 3320Reputation: 3320Reputation: 3320Reputation: 3320Reputation: 3320Reputation: 3320Reputation: 3320Reputation: 3320Reputation: 3320
Quote:
Originally Posted by bassmadrigal View Post
Does this require certain things like zswap or does hibernation automatically compress the memory contents without any tweaks needed?

(I've never set up hibernation as all my systems basically run 24/7.)
No special configuration is needed. The data from swap image is compressed (and decompressed) automatically.

RE: the ZSWAP - it's an entire another thing. Yet, quite useful. Practically, you know that any partition device (excluding the Linux swap) uses an in-memory cache of disk operations, to speedup the things and asynchronous save the data on disk.

The ZWAP basically adds a (compressed) cache for the swap partitions and the effects are great, greatly improving the behavior at heavy memory load.

I for one I use ZWAP on all my systems, no matter if they are Slackware, Ubuntu or openSUSE. BUT, it requires some configuration in the kernel command like. Personally, I use
Code:
zswap.enabled=1 zswap.compressor=lzo zswap.max_pool_percent=20 zswap.zpool=z3fold

Last edited by LuckyCyborg; 04-11-2022 at 03:39 PM.
 
1 members found this post helpful.
Old 04-11-2022, 03:58 PM   #10
Regnad Kcin
Member
 
Registered: Jan 2014
Location: Beijing
Distribution: Slackware 64 -current .
Posts: 663

Rep: Reputation: 460Reputation: 460Reputation: 460Reputation: 460Reputation: 460
Slackware will run just fine without a swap drive but it is a good idea to have one.
 
Old 04-11-2022, 04:05 PM   #11
Jan K.
Member
 
Registered: Apr 2019
Location: Esbjerg
Distribution: Windows 7...
Posts: 773

Rep: Reputation: 489Reputation: 489Reputation: 489Reputation: 489Reputation: 489
https://chrisdown.name/2018/01/02/in...e-of-swap.html
 
3 members found this post helpful.
Old 04-11-2022, 04:47 PM   #12
yvesjv
Member
 
Registered: Sep 2015
Location: Australia
Distribution: Slackware, Devuan, Freebsd
Posts: 566

Rep: Reputation: Disabled
Just like everyone else, I seriously recommend swap.
My systems have standard 32G of memory... and swap is still used.
 
Old 04-11-2022, 05:07 PM   #13
arubin
Senior Member
 
Registered: Mar 2004
Location: Middx UK
Distribution: Slackware64 15.0 (multilib)
Posts: 1,350

Original Poster
Rep: Reputation: 75
Thanks for the replies.

As a follow-up is swap actually needed for sleep as opposed to hibernation?
 
Old 04-11-2022, 05:35 PM   #14
wainamoinen
Member
 
Registered: Sep 2009
Location: Belgium
Distribution: Slackware
Posts: 32

Rep: Reputation: 24
Short answer: yes

I'm always concern with high performance, so my view has a bias.

I've not used swap for the last 10 years. No issues at all. In fact I always mount /tmp as a tmpfs (to use more the RAM), this makes things like compiling really fast. Why, just because now computers have a lot of RAM.

I don't hybernate my laptop. My laptop can be suspended for a couple days without problem. If I'm going to power it off for more time I just shut it down, but I don't remember the last time I needed to do that.

Yes, swap can save you if your programs are allocating a lot of memory and the physical memory is full, but even my laptop with 16GB of memory that almost never happened to me (well I'm using LXDE and not KDE).

RAM is at least 100 times faster than a SATA SSD, why whould I want to slow down the data access. RAM access is also parallel (because of the different cache levels), SATA SSD access is sequential.

In the past I had servers that went unresponsive because they have a process using all memory and started to move data to swap. The only solution was to kill the process that was eating the memory. If you don't have swap the "Linux Out-Of-Memory Killer" just kills the process that is causing the problem sooner, no need to try to save it by dumping memory to the swap partition, just to have a slow death.

At work we have servers with 1TB of RAM and 4TB of SSD, what amount of swap would make sense, that is not a waste of disk?

My two cents.
 
Old 04-11-2022, 05:49 PM   #15
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,780

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
Quote:
Originally Posted by wainamoinen View Post
At work we have servers with 1TB of RAM and 4TB of SSD, what amount of swap would make sense, that is not a waste of disk?
About 1GB of disk swap is useful to hold those pages that various long-running daemon processes use during startup and never reference again. Eventually, those will migrate out to swap. Leaving them in memory is just a waste of RAM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Triple-boot Mac/Win/Linux: Possible to boot from, or install swap partition on second drive? endgame Linux - Newbie 14 02-18-2017 06:07 AM
How to install slackware to two partitions (One for Slackware and one for swap) sycho123321 Linux - Newbie 13 11-24-2013 09:31 AM
How to unmount actual swap and mount a new(bigger) swap space? isaac Linux - Newbie 1 06-06-2004 01:23 AM
Slackware 9 Creating new swap partitions after installation without destroying data MegaGeoff Linux - Newbie 1 01-18-2004 08:44 PM
Difference between Swap Virtrual memory and Swap Parition Nappa Slackware 4 11-27-2003 07:58 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 09:16 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration