M
M
Mohn2015-02-20 13:10:58
linux
Mohn, 2015-02-20 13:10:58

How to assign a swap partition to Ubuntu?

Good day.
When installing Ubuntu 14.04, I did not create a swap partition, because 4gb is enough for most tasks.
And this was also done in order to save a longer life for the SSD.
But it turned out that there is not enough RAM to actively surf the Internet using Chromium + a certain number of running programs.
I know how to create a swap partition, but I don't know how to tell Ubuntu to use it?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
S
Spetros, 2015-02-20
@m0hn

man swapon

C
cssman, 2015-02-20
@cssman

swapon /filename ?
and specify swap in /etc/fstab

M
Mohn, 2015-02-20
@m0hn

Here's what I got:

swapon /dev/sda6
blkid /dev/sda6
echo "UUID=036bc5d0-f99a-4df9-a540-1c877e5c7916 none   swap    sw      0       0" >> /etc/fstab

S
steep-user, 2015-02-20
@steep-user

Why create a partition on a disk if the root is on ext3-4?

fallocate -l 2024M /swapfile
chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile
echo '/swapfile none swap defaults 0 0' >> /etc/fstab

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question