0

I'm not able to increase my swap file size, I watch a lot of article over internet & I tried as bellow but end of the day it shwoing 2GB only. Here the things that I tried. PLease give me a soluions for this or did I do anything wrong.

 mds@sefat:/$ sudo dd if=/dev/zero of=/swapfile bs=1M count=8192 status=progress
    8282701824 bytes (8.3 GB, 7.7 GiB) copied, 5 s, 1.7 GB/s
    8192+0 records in
    8192+0 records out
    8589934592 bytes (8.6 GB, 8.0 GiB) copied, 5.14598 s, 1.7 GB/s
    mds@sefat:/$ ls
    bin    etc    lib64   opt      run   studio-3t-linux-x64.sh  usr
    boot   home   libx32  Postman  sbin  swapfile                var
    cdrom  lib    media   proc     snap  sys
    dev    lib32  mnt     root     srv   tmp
    mds@sefat:/$ sudo chmod 600 /swapfile
    mds@sefat:/$ sudo mkswap /swapfile
    Setting up swapspace version 1, size = 8 GiB (8589930496 bytes)
    no label, UUID=dbd5b35c-c016-488c-aa09-ff90708bc1ed
    mds@sefat:/$ swapon
    NAME           TYPE      SIZE USED PRIO
    /dev/nvme0n1p2 partition   2G   2G   -2
    mds@sefat:/$ sudo dd if=/dev/nvme0n1p2 of=/swapfile bs=1M count=8192 status=progress
    1863319552 bytes (1.9 GB, 1.7 GiB) copied, 4 s, 466 MB/s
    2048+0 records in
    2048+0 records out
    2147483648 bytes (2.1 GB, 2.0 GiB) copied, 4.7347 s, 454 MB/s
    mds@sefat:/$ swapon
    NAME           TYPE      SIZE USED PRIO
    /dev/nvme0n1p2 partition   2G   2G   -2
    mds@sefat:/$ sudo dd if=/dev/nvme0n1p2 of=/swapfile bs=1M count=8192 status=progress
    1987051520 bytes (2.0 GB, 1.9 GiB) copied, 4 s, 497 MB/s
    2048+0 records in
    2048+0 records out
    2147483648 bytes (2.1 GB, 2.0 GiB) copied, 4.335 s, 495 MB/s
    mds@sefat:/$ swapon
    NAME           TYPE      SIZE USED PRIO
    /dev/nvme0n1p2 partition   2G   2G   -2
    mds@sefat:/$ 
  • You've provided no OS/product/release details; and most of your provided commands relating to creating a file of specified size, but not actually telling your system to use it as a swapfile. You may, or may not have done that, but we can only know if we're told - currently we don't even know what OS/release you're using, nor what swap partition/swapfile setup is expected. – guiverc Aug 03 '22 at 07:42
  • Related: https://askubuntu.com/q/1165477/968501 – Raffa Aug 03 '22 at 08:39
  • How much RAM? And why do you need more swap? Typically with new systems, swap is never used as you have enough RAM to run everything. Note that apps are cached in RAM, so RAM may fill but not really fully used. what does free -h show? – oldfred Aug 03 '22 at 13:36

0 Answers0