To make the life of a SSD longer, there are several rules to follow.
Stop writing a timestamp every time a file is accessed
Edit the /etc/fstab file and replace all the defaults strings by defaults,noatime.
/dev/mapper/rhel-root / xfs defaults 1 1
/dev/mapper/rhel-root / xfs defaults,noatime 1 1
Trim the SSD at boot
Edit the file /etc/rc.d/rc.local and paste the following lines:
/usr/sbin/fstrim / /usr/sbin/fstrim /home /usr/sbin/fstrim /boot
Make the file executable:
# chmod u+x /etc/rc.d/rc.local
Start the associated service:
# systemctl start rc-local
Note1: You don’t need to enable the rc-local service, it’s already done.
Note2: If you don’t regularly reboot your PC, execute the fstrim command through cron or a Systemd timer.
Limit swap use
Edit the /etc/sysctl.conf file and paste the following lines:
Make the changes active:
# sysctl -p
Use a SSD-friendly I/O scheduler
Edit the /etc/default/grub file and add elevator=deadline at the end of the GRUB_CMDLINE_LINUX variable.
Make the change active:
# grub2-mkconfig -o /boot/grub2/grub.cfg
Note: This can also be done on a per-disk basis (see How to configure I/O scheduler).
Source: Taken from JensD’s blog and slightly adapted to RHEL 7.
You can also read this article about SSD data recovery and TRIM feature.