1

I'm on Fedora 23, Dell OptiPlex 745, Core 2 Duo, 2.13 GHz, 1066 MHz FSB and 4 gig of RAM; the drive is a Samsung 840 EVO solid state drive.

The swap file is currently at 4 gig. How can I change this size? I'd like to go to 8 Gig.

Janning
  • 21

1 Answers1

3

The proper way to go would be to resize some of the partitions and create additional swap partition or increase the one that you already have but with SSD drive the following should also work fine.

  1. Open terminal and switch to root:

    sudo -i
    
  2. Check how much swap space you currently have:

    swapon -s
    
  3. Create a file that will work as you swap file. dd will do this for us (create a file made of zeros). The file will have 4GB.

    dd if=/dev/zero of=/my4GBswap bs=1M count=4096
    
  4. Change permissions:

    chmod 600 /my4GBswap
    
  5. And make swap:

    mkswap /my4GBswap
    
  6. And enable it:

    swapon /my4GBswap
    
  7. Almost there. Now we need to make the changes persistent after reboots. So let's add this to fstab:

    echo "/my4GBswap swap swap defaults 0 0" >> /etc/fstab
    
  8. Make sure that it worked:

    swapon -s
    
BenMorel
  • 1,011
morholt
  • 88