Questions tagged [swap]

Unix systems, and other Unix-like operating systems, use the term "swap" to describe both the act of moving memory pages between RAM and disk, and the region of a disk the pages are stored on. In some of those systems, it is common to use a separate whole partition of a hard disk for swapping. These partitions are called swap partitions.

Filter by
Sorted by
Tagged with
213 votes
9 answers
366k views

How do I add swap after system installation?

I did not create a swap partition during Ubuntu installation. Later, I freed up some space and made a swap partition. Now after each boot up, I am manually opening gparted to right-click the swap ...
user avatar
470 votes
3 answers
905k views

How do I configure swappiness?

I need a step-by-step, simple and easy way to configure swappiness.
One Zero's user avatar
  • 27.2k
363 votes
9 answers
570k views

How to increase swap space?

I have, by default, 250MB of swap space in Ubuntu, and I want to expand it to a larger size. I need 800MB, which I think will be enough to open several applications without having to hit the current ...
Bruno's user avatar
  • 3,817
320 votes
22 answers
485k views

I have 16GB RAM. Do I need 32GB swap?

I read many places that the rule of thumb for swap space is to double the amount of physical RAM. However, 32 GB does seem a LOT. Do I need that much? Do I need it at all with this high amount of ...
Tamás Szelei's user avatar
17 votes
2 answers
13k views

How much swap should I take for 1GB to 8TB of RAM on 14.04 or higher?

I'm going to install 64 bit 14.04 on a new machine with something like 1 to maybe 128GB RAM and even more RAM later. How much space should I allocate to the swap partition? And especially: WHY those ...
Tim's user avatar
  • 25.2k
51 votes
6 answers
74k views

Hibernate and resume from a swap file

I have configured a new Ubuntu installation in a Notebook to use a swap file, instead of using a swap partition. By default is not possible to get Ubuntu to hibernate using a swap file, so I tried ...
tfmoraes's user avatar
  • 534
180 votes
6 answers
185k views

How do I increase the size of swapfile without removing it in the terminal?

Is there a way to increase my existing "swapfile" without having to destroy and re-create it? I would like to up my swap space from 1GB to 2GB. Currently it is set up as such: $ sudo swapon -s ...
Dave's user avatar
  • 2,095
39 votes
2 answers
71k views

What to do about "the disk drive for /dev/mapper/cryptswap1 is not ready yet or not present"?

While booting Ubuntu 12.04, the disk drive for /dev/mapper/cryptswap1 is not ready yet or not present is showing. Why is this?
bittu's user avatar
  • 391
67 votes
1 answer
120k views

Adding a new swap file. How to edit fstab to enable swap after reboot?

I've deleted my existing swap partition due to some partitioning problem. I don't have a swap space now so I've created a swap file with: dd if=/dev/zero of=/root/myswapfile bs=1M count=1024 Here's ...
jojo's user avatar
  • 911
71 votes
1 answer
56k views

swap partition vs swap file

I was reading the new changes with Ubuntu 17.04 and one caught my eye which was moving from the typical swap partition model to a new swap file model for new installs. Are there benefits for using ...
Luis Alvarado's user avatar
136 votes
7 answers
219k views

Why are swap partitions discouraged on SSD drives, are they harmful?

I often read that one should not place swap partitions on a SSD drive, as this may harm the device. Is this true? Can you please explain the reason to me? Because I otherwise would have thought that ...
Byte Commander's user avatar
  • 108k
86 votes
7 answers
88k views

Why most people recommend to reduce swappiness to 10-20?

I have seen in several site which recommend to reduce swappiness to 10-20 for better performance. http://community.linuxmint.com/tutorial/view/998 https://sites.google.com/site/easylinuxtipsproject/...
Saeed Zarinfam's user avatar
304 votes
6 answers
316k views

Why is swap being used even though I have plenty of free RAM?

I thought the whole essence of swap was to act as a temporary storage safety net when RAM was full but my swap partition is constantly being used even though I sometimes have as much as 3GB free RAM. ...
Mysterio's user avatar
  • 12k
69 votes
2 answers
84k views

How do I increase swapfile in Ubuntu 18.04? [duplicate]

I have laptop with 8 GB RAM and 1TB HDD. I have swapfile which is 2 GB (Ubuntu 18.04 uses a swapfile instead of a separate swap partition by default) and I want to increase it to use hibernation. I ...
Miroslav's user avatar
  • 979
79 votes
3 answers
553k views

How do I resize partitions using command line without using a GUI on a server?

I only have access to the server via a terminal and I can't use graphical tools such as GParted! I want to create a new partition from a part of the root (about 768mb) for swap. # df -h Filesystem ...
hamidfzm's user avatar
  • 971
12 votes
1 answer
8k views

Ubuntu 18.04 error on waking up from sleep : Read-error on swap device

After the laptop has been in sleep mode for a couple of hours,when I try and resume my session I get the following error: Read-error on swap device It takes about 30 seconds for the login screen ...
Vedant's user avatar
  • 133
180 votes
8 answers
361k views

How do I disable swap?

I have some sensitive data in RAM that I prefer not to be on disk. How do I disable swap? I have more than enough RAM. If RAM consumption gets too high I have no problems with processes being ...
user avatar
52 votes
6 answers
108k views

Do we still need swap partitions on desktops?

I have read this question, but it was asked in the context of servers not desktops or notebooks. If a good amount of RAM is installed on a notebook, say 8 GB, do we still need a swap space?
pram's user avatar
  • 940
186 votes
16 answers
354k views

Slow boot - "a start job is running for dev-disk-by..."

I don't recall when the issue started to occur but it's likely when I moved my VMWare Ubuntu image to an external SSD so that I can use the OS on any of my PCs. There aren't many links on Google about ...
cpd1's user avatar
  • 2,393
30 votes
2 answers
35k views

How do I setup an encrypted swap file?

When I installed Ubuntu, I setup an encrypted home partition. Now I have come to an issue where I am running out of memory because I haven't setup swap. How can I setup an encrypted swap file? A ...
liamzebedee's user avatar
19 votes
3 answers
40k views

What is a "Swap Area"?

So I noticed this question has not been asked directly; What is this "Swap Area" people keep referring to when it comes to installing Ubuntu?
Anon's user avatar
  • 12.1k
119 votes
4 answers
310k views

kswapd0 is taking a lot of cpu

kswapd0 is taking 99.9% of my CPU as top shows me, the problem appeared today when gaming and first time it went away after 6 minutes and now it has been doing it for about 20 minutes. How is this ...
inimene's user avatar
  • 2,106
34 votes
6 answers
12k views

Importance of Swap Partition

What is the purpose of a swap partition? How do I know I have just enough swap partition? Not too much/little. My Ubuntu PC is used for typical stuff: Web (email, facebook, etc.) Some movies gaming ...
lamcro's user avatar
  • 1,056
28 votes
5 answers
28k views

Swap not working on clean 14.04 install using encrypted home

Update 3: I decided to reinstall the system from scratch to remove any old cruft lying around since I had been experiencing some other issues after the upgrade aswell. Howver, this issue persisted. ...
ajn's user avatar
  • 495
10 votes
1 answer
6k views

What is swap and how large a swap partition should I create? [duplicate]

I have a system with 4gb of RAM and Intel i5 processor. I want to know how much memory I should allocate to SWAP. Will allocating more memory help increase the system performance. In the past i have ...
PyariBilli's user avatar
3 votes
4 answers
9k views

How to recover data from NTFS partition that was made into a Swap partition?

I have extremely important stuff on my windows partition which during the ubuntu 10.10 installation,when it said that I should create something called swap space, I selected it to be a swap space (...
Raghav Mehta's user avatar
2 votes
1 answer
2k views

Swap partition to Swap file [duplicate]

I'm having Swap partition of 8 GB , how can i create a swap file from it ? Currently having three partitions root , home , swap . So if i create a swap file how do i create it and where do it get ...
Himanshu Verkiya's user avatar
109 votes
6 answers
147k views

How can I turn off swap permanently?

Swap makes my system all sluggish and turning it off makes everything smoother. I have 3.5 GB of RAM. I know how to turn swap off by entering sudo swapoff -a in the terminal, but that's just for the ...
Alex Li's user avatar
  • 1,291
51 votes
3 answers
95k views

Check if partition is encrypted

How do I check if a partition is encrypted? In particular I would like to know how I check if /home and swap is encrypted.
N.N.'s user avatar
  • 18.2k
489 votes
8 answers
683k views

How to empty swap if there is free RAM?

When I open a RAM-intensive app (VirtualBox set at 2GB of RAM), some swap space is generally used, depending on what else I have open at the time. However, when I quit that last application, the 2GB ...
jfoucher's user avatar
  • 23.6k
62 votes
3 answers
80k views

Is it safe to turn swap off permanently?

My system was getting slower, especially when I use browsers like Firefox / Chromium and Virtual Machines. I noticed that I've got at least 3.2 GB of free RAM (using Gnome system monitor) and there ...
One Zero's user avatar
  • 27.2k
24 votes
1 answer
33k views

Default 17.04 swap file location

I could not find any information on this anywhere (and I don't want to set up a new 17.04 installation just for that), what is the default location of the swap file in 17.04?
phk's user avatar
  • 391
15 votes
3 answers
15k views

Encrypted Swap Partition for 14.04

How can I produce an encrypted Swap Partition for 14.04 ? All the advices I saw here are for versions <14.04 and do not work for me. I tried a lot but nothing lasted longer than a reboot. On ...
michel's user avatar
  • 361
13 votes
2 answers
6k views

Increase size of encrypted swap

Ubuntu 18.04 is by default creating a random encrypted swap during each boot using dm-crypt/Swap encryption. For me, this is creating a 1gb swap but I cannot find where to increase the size of the ...
xendi's user avatar
  • 357
3 votes
1 answer
3k views

No swapping on LUbuntu at enabled swap

I have tablet with 4 GiB of RAM and SSD 128 GiB with LUbuntu 18.04. When the memory usage reaches approx. 3.9 G, the system hangs. Only the mouse pointer moves with lags. No reaction on Ctrl+Alt+Fx. ...
v_mil's user avatar
  • 489
43 votes
7 answers
27k views

Increase Swap in Ubuntu 18.04 Under Lvm and Encrypted File System

I did a clean install of Ubuntu 18.04 Desktop. I used the graphical installer and chose "Encrypt the new Ubuntu installation for security". It used by default LVM and created a partition for the ...
leviatan89's user avatar
39 votes
3 answers
59k views

Increase swap in 20.04

I'm running Ubuntu 20.04, and I'm trying to create a hibernate command. I'm following these instructions. Step 2 says Then check whether the swap memory you allocated is more than or at least equal ...
Yehuda's user avatar
  • 518
25 votes
5 answers
15k views

Does it make sense to create swap partitions for new installations nowadways?

For a desktop installation in a new and shiny laptop (let's say 16gb ram and ssd hd), does it make sense to have a swap partition?
Frey Olake's user avatar
22 votes
4 answers
121k views

How to decide on Swap size [duplicate]

I wanted to just confirm how much the size of Swap partition should be. Lots of places tell that the swap size should be twice the size of RAM. Somebody also told me that it shouldn't be more than 8 ...
Deepak Rajput's user avatar
20 votes
1 answer
23k views

Is it still bad to use swap on a modern SSD?

I have a Samsung 960 Pro SSD with Ubuntu 18.04 is it safe to put the swap file on there or would it hurt it in the long run, I heard some people saying that new SSDs don't suffer from that issue ...
H D's user avatar
  • 323
14 votes
5 answers
25k views

Unsafe swap space detected

So I had a Ubuntu 13.04 installation and I had encrypted my hard drive while I was doing installation. I was playing around and mistakenly deleted all the partitions, now I downloaded lUbuntu 13.10 ...
Django Anonymous's user avatar
4 votes
3 answers
36k views

Do I need a swap partition? [duplicate]

I have 4GB of RAM and I want to install Ubuntu. Do I need a to have a swap partition? Because my computer has 4GB RAM, I do not think it is necessary to have a swap partition. If I do need to have a ...
Bryan Marroquín's user avatar
24 votes
2 answers
50k views

How to disable cryptswap?

How can I disable cryptswap? I would like an unencrypted swap like before. This is on an ubuntu 9.10 system.
mit's user avatar
  • 2,131
18 votes
1 answer
39k views

How do I restore a swap partition I accidentally deleted?

I accidentally deleted my swap partition via gparted. (I'm still logged in the system so restoring should be easier) Can someone help me please? I'm not sure how to configure it because the Ubuntu ...
Adonis K. Kakoulidis's user avatar
14 votes
2 answers
20k views

Sharing of swap partiton between linux systems?

I have a laptop on which I have installed Ubuntu 12.04 and Windows Now just for learning purposes I am going to install Backtrack OS on it. My laptop has 4 GB of RAM so according to the ...
Null pointer's user avatar
  • 2,547
12 votes
4 answers
23k views

How to permanently enable compressed ram swap? What version to use?

EDIT: In precise there's now zram-config. It's an upstart job compressing up to half of your ram spread over $(number of CPU cores) swap devices. It didn't allways start at boot but issuing sudo ...
turbo's user avatar
  • 4,622
0 votes
1 answer
849 views

How can i increase size of swap file? [duplicate]

I'm new to Ubuntu . I need to increase size of swap file from 8 GB to 16 GB , how can i do it ? and is that in this file /etc/fstab ? by command free -h total used free ...
prog 's user avatar
  • 69
88 votes
2 answers
83k views

zram vs zswap vs zcache Ultimate guide: when to use which one

What the hell are they? how are they different (I've written my understanding in an answer below) In the Zswap system, when a page is evicted from the zswap to the actual swap is it stored in a ...
staticd's user avatar
  • 2,965
75 votes
8 answers
196k views

How do I find out if I have a swap partition on my hard drive?

I used the 12.04 live cd to install Ubuntu over my Windows 7 partition and deleted everything so I just have Ubuntu on my laptop. But since during the installer I chose the simple "erase entire disk" ...
dswhite85's user avatar
  • 1,194
40 votes
2 answers
16k views

fallocate vs dd for swapfile?

I'm wondering what the difference is between creating a swapfile with fallocate -l 1G /swapfile and dd if=/dev/zero of=/swapfile bs=1024 count=1024 both seem to work fine, but does one have an ...
user8292439's user avatar
  • 3,798

1
2 3 4 5 6