6

I have gone through loads of articles about people telling to remove swap partitions to optimize SSDs. Looking at the upside of having swap utility , why not go for a swap file? What will be the difference?

0

2 Answers 2

2

There would be no real advantage/disadvantage.

They are two methods of accomplishing the same goal.

As to why we try to avoid it on an SSD, you might want to check out some possible duplicates:

Why no swap partitions on SSD drives?

On an SSD, are there any advantages to a swap partition over a swap file?

Do I need swap with new SSD?

1

I stopped using swap partitions with SSDs because of fstrim. fstrim can optimize the SSD if it's using a swapfile, but fstrim has no effect on an unmounted swap partition. Most Linux desktop computers these days have plenty of memory and rarely swap anyway. For example, the computer I'm using right now has 4gb of RAM and a 2gb swap file. The command 'vmstat -s' reports 0 K swap used:

  2097148 K total swap
        0 K used swap
  2097148 K free swap

I used to be a die hard swap partition user from the old Unix days. Sure, it made sense to put swap and user files on separate partitions, because the system would crash when the / partition got full. But these days, storage is more affordable and it's rare for / to fill up like it used to.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .