# Swap on SSD, TRIM

## JanErik

I just ordered an SSD and will put my / and /home on it. 

Now I am wondering what to do with the swap, I am not worried about the drive wear, it will be a museum piece anyway before it wears out, but the TRIM functionality and performance impact.

If I put the swap as a partition, that will not be able to use TRIM, right? If I understand correctly, it would have to be made as a swap file on the ext4 partition, then it would utilize the TRIM - but is it only if the swap file is deleted? How about when a file is constantly changed?

----------

## s4e8

The first TRIM support in kernel is swap partition. The Adding swap dmesg will show flag "SS" if swap partition in SSD w/o TRIM, show "SSD" if w/ TRIM.

----------

## JanErik

Is this also supported if the swap is encrypted with dm-crypt?

----------

## alextz

Is there a flag which I should pass in /etc/fstab to enable TRIM on swap.

I have a swap partition on an SSD with TRIM but it shows SS.

----------

## Moonboots

Add  "discard" to your swap entry in fstab

----------

