# How to increase swap space



## balanga (Mar 22, 2020)

If it looks like I am short on swap space is there any simple way to change partition sizes to create a bigger swap partition? Are there any other solutions available?


----------



## nunotex (Mar 22, 2020)

balanga said:


> If it looks like I am short on swap space is there any simple way to change partition sizes to create a bigger swap partition? Are there any other solutions available?



Hi,

11.12. Adding Swap Space


----------



## balanga (Mar 22, 2020)

So if I create a /usr/swap0 file, is this a replacement for my swap partition, or an extension to it?


----------



## T-Daemon (Mar 22, 2020)

An extension. Run swapinfo(8) -h .


----------



## balanga (Mar 22, 2020)

Just out of interest, if I can create a swapfile whenever I want, is there any need for a swap partition? 

Is one more efficient than the other?


----------



## zirias@ (Mar 22, 2020)

Sure a partition is more efficient, for swapping, abstractions of a filesystem are unnecessary. Also, a swap file can cause issues with filesystems that dynamically allocate memory for operations (like ZFS)


----------

