Here are some good recommendations:
/etc/rc.local
and append fstrim -v /
(and for any other SSD mount points except swap)fstrim -a
see heresudo mount -a
# SSD tweak : temporary directories as tmpfs tmpfs /tmp tmpfs defaults,noatime,mode=1777,size=20% 0 0 tmpfs /var/tmp tmpfs defaults,noatime,mode=1777 0 0 tmpfs /var/spool tmpfs defaults,noatime,mode=1777 0 0 # SSD tweak : log directory as tmpfs tmpfs /var/log tmpfs defaults,noatime,mode=0755 0 0 tmpfs /var/lock tmpfs defaults,noatime,mode=0755 0 0 tmpfs /dev/shm tmpfs defaults,size=20% 0 0
mkdir /hd; mkdir /hometmp
ls -l /dev/disk/by-uuid
/etc/fstab
noatime
to SSD entries#/dev/sdb3 UUID=db9908b0-b762-43bc-bade-bff060d5d2ad swap swap defaults 0 0 #/dev/sdb2 UUID=5717e073-0576-4ae6-b519-35404f16806e /hd xfs defaults 1 2 #sdb vg:sv7 /dev/sv7/home /hometmp ext4 defaults 1 2
mount -a swapon -a cat /proc/swaps #check swap swapoff <if original swap>
mount /dev/sda2 /mnt mkdir /ohome; mount /dev/sda3 /ohome mkdir /nhome; mount /dev/sv7/home /nhome cp -a /ohome/* /nhome/
mkdir /hd; mount /dev/sdb2 /hd dir=var/log; mv /mnt/$dir /hd/; mkdir /mnt/$dir dir=var/tmp; mv /mnt/$dir /hd/; mkdir /mnt/$dir dir=var/spool; mv /mnt/$dir /hd/; mkdir /mnt/$dir dir=var/lock; mv /mnt/$dir /hd/; mkdir /mnt/$dir dir=dev/shm; mv /mnt/$dir /hd/; mkdir /mnt/$dir dir=tmp; mv /mnt/$dir /hd/; mkdir /mnt/$dir
/hd/var/log /var/log none bind 0 0 /hd/var/tmp /var/tmp none bind 0 0 /hd/var/spool /var/spool none bind 0 0 /hd/var/lock /var/lock none bind 0 0 /hd/dev/shm /dev/shm none bind 0 0 /hd/tmp /tmp none bind 0 0
vi /etc/cron.daily/trim
#!/bin/sh LOG=/var/log/trim.log echo "*** $(date -R) ***" >> $LOG fstrim -v / >> $LOG fstrim -v /root >> $LOG
sudo chmod +x /etc/cron.daily/trim