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.
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.
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.
Open terminal and switch to root:
sudo -i
Check how much swap space you currently have:
swapon -s
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
Change permissions:
chmod 600 /my4GBswap
And make swap:
mkswap /my4GBswap
And enable it:
swapon /my4GBswap
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
Make sure that it worked:
swapon -s