[SOLVED-REEDITED] How to trim my SSD using DietPi Topic is solved

Have some feedback, questions, suggestions, or just fancy a chat? Pop it in here.
Post Reply
skyfly555
Posts: 81
Joined: Tue Nov 17, 2015 12:16 pm

[SOLVED-REEDITED] How to trim my SSD using DietPi

Post by skyfly555 »

Hello,

I've installed DietPi on my Atom miniPC. Now I have bought a Kingston A400 SSD and I have cloned using clonezilla DietPi on it: I get speeds of about Write = 120 MB/s | Read = 310 MB/s.

The question: Do I need to trim?
I've found this answer by @Fourdee in a post related to SSD+XU4: viewtopic.php?f=9&t=493&p=2231&hilit=trim#p2161 (year 2016).

This is the script he created then:

Code: Select all

#TRIM drives (all mount points)
	df -P | awk '{print $6}' | tail -n +2 > /tmp/.dietpi-cron-daily_trim

	echo -e "$(date)\nDietPi Cron Daily | Filesystem trim"
	while read -r line
	do
		fstrim -v "$line" >> /var/log/dietpi_cron_daily_trim.log

	done < /tmp/.dietpi-cron-daily_trim
	rm /tmp/.dietpi-cron-daily_trim

	cat /var/log/dietpi_cron_daily_trim.log
Can I use it with my Atom miniPC? Is it OK? Or is there another version of the script implemented on DietPi now?

I have created and executed the script once: this is what I've got:

Code: Select all

Wed 20 Mar 18:22:11 CET 2019
DietPi Cron Daily | Filesystem trim
fstrim: /dev: the discard operation is not supported
fstrim: /run: the discard operation is not supported
fstrim: /: the discard operation is not supported
fstrim: /dev/shm: the discard operation is not supported
fstrim: /run/lock: the discard operation is not supported
fstrim: /sys/fs/cgroup: the discard operation is not supported
fstrim: /mnt/4062566C625666A6: the discard operation is not supported
fstrim: /boot/efi: the discard operation is not supported
fstrim: /mnt/0286573B86572E83: the discard operation is not supported
fstrim: /mnt/DE4C-9FB9: the discard operation is not supported
fstrim: /tmp: the discard operation is not supported
fstrim: /var/log: the discard operation is not supported
fstrim: /DietPi: the discard operation is not supported

Thank you very much for your help,

EDIT-SOLUTION:
1- FALSE -->It seems Kingston's firmware does "trim" by default: it's called Garbage Collection https://www.kingston.com/es/ssd/enterpr ... collection.
*NEW EDIT* E-mail received from eu_technical@kingston.eu: "Garbage Collection is the actual activity of the SSD to clean up the cells. In order to use Garbage Collection the SSD needs a command from the operating system (TRIM). Without this command, Garbage Collection will not be applied."
2- fstrim doesn't support Kingston SSD drives.
3- The typical SSD recomendations are done by DietPi out-of-the-box: ramdisks, noatime option in /etc/fstab...

DietPi is great!
Post Reply