P
P
Prosecutorr2019-11-30 16:07:54
Debian
Prosecutorr, 2019-11-30 16:07:54

How to properly increase SWAP (partition)?

I'm trying to figure out how to enlarge the swap as a disk partition.
Now everything is broken like this

Disk /dev/nvme0n1: 894.3 GiB, 960197124096 bytes, 1875385008 sectors
Disk model: SAMSUNG MZQLB960HAJR-00007
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 739E4D85-0C1F-43F0-8732-94E6FDFE7DF2

Device              Start        End    Sectors   Size Type
/dev/nvme0n1p1       2048    1048575    1046528   511M EFI System
/dev/nvme0n1p2    1048576 1874327551 1873278976 893.3G Linux RAID
/dev/nvme0n1p3 1874327552 1875374079    1046528   511M Linux swap
/dev/nvme0n1p4 1875382272 1875384319       2048     1M Linux filesystem


Disk /dev/nvme1n1: 894.3 GiB, 960197124096 bytes, 1875385008 sectors
Disk model: SAMSUNG MZQLB960HAJR-00007
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 2BEA18CA-C2BD-4D51-8C16-46C616A34E37

Device              Start        End    Sectors   Size Type
/dev/nvme1n1p1       2048    1048575    1046528   511M EFI System
/dev/nvme1n1p2    1048576 1874327551 1873278976 893.3G Linux RAID
/dev/nvme1n1p3 1874327552 1875374079    1046528   511M Linux swap


Disk /dev/md2: 1.8 TiB, 1918236622848 bytes, 3746555904 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 524288 bytes / 1048576 bytes

I found many solutions on the Internet, but in the end I did not understand which option would be best. I'm confused, please help me.
As far as I understand, the best amount of swap for 32 GB of RAM will be 8-16 GB?
I am using Debian 10.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
P
paran0id, 2019-11-30
@paran0id

You can add another partition, or create a swap file on an existing file system.
As for the volume - if you use hibernation, then the swap should be the size of RAM. If not, then less, just as a safety net in case of out of memory.

V
Vladimir Korotenko, 2019-11-30
@firedragon

First check whether you need it or not
https://www.cyberciti.biz/faq/linux-check-swap-usa...
If you still need it. Make a backup, boot from a live flash drive with gpart om and compress the raid partition and re-create the swap partition

D
Dmitry, 2019-11-30
@Tabletko

Create a Linux Swap File

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question