Cloudshell XU4 SSD and trim

Have some feedback, questions, suggestions, or just fancy a chat? Pop it in here.
Post Reply
User avatar
johnvick
Legend
Posts: 693
Joined: Wed Jun 08, 2016 11:53 am
Location: New Zealand

Cloudshell XU4 SSD and trim

Post by johnvick »

I have a Cloudshell with 240 GB Crucial BX200 SSD - do I need to worry about trim?

On an SSD equipped BananaPi (OS is most recent Bananian 16.04 r01) I run this script in cron.daily:

#!/bin/sh
LOG=/var/log/trim.log
echo "*** $(date -R) ***" >> $LOG
fstrim -v / >> $LOG

When I use this on the XU4 I get the message " the discard operation is not supported". The log just states the date. On the BananaPi it tells you how many bytes were trimmed.

I don't know much about this so any help appreciated.
User avatar
Fourdee
Site Admin
Posts: 2782
Joined: Tue Feb 06, 2007 1:36 pm

Re: Cloudshell XU4 SSD and trim

Post by Fourdee »

Hi John,

Just wondering if you need to add the "discard" option to filesystem mount options in /etc/fstab
eg:

Code: Select all

/dev/MyRootFilesystem  /               ext4    defaults,noatime,discard 
Either way, can you possibly paste the results of the following on both your XU4 and BPi so I can compare:

Code: Select all

cat /etc/fstab
If you find our project or support useful, then we’d really appreciate it if you’d consider contributing to the project however you can.
Donating is the easiest – you can use PayPal or become a DietPi patron.
User avatar
johnvick
Legend
Posts: 693
Joined: Wed Jun 08, 2016 11:53 am
Location: New Zealand

Re: Cloudshell XU4 SSD and trim

Post by johnvick »

Here's the fstab files. Not much in the Bpi one. It boots from the SD and the files system is on an SSD and neither appear in the fstab but I don't claim to fully understand this.

BPi fstab

# UNCONFIGURED FSTAB FOR BASE SYSTEM

# 512 MB swapfile
/swapfile1 swap swap defaults 0 0

192.168.1.4:/pi /mnt/pi nfs rsize=8192,wsize=8192,timeo=14,intr 0 0
192.168.1.4:/Multimedia /mnt/Multimedia nfs rsize=8192,wsize=8192,timeo=14,intr 0 0


XU4 fstab

proc /proc proc defaults 0 0
UUID=96C3-9298 /boot vfat defaults,noatime,discard 0 2
UUID=ff31ef97-52c2-4ac4-95c8-20e0d3ca064f / ext4 defaults,noatime,discard 0 1 #SSD

UUID=7f7a5a95-abd7-4360-8141-74a5199bdfba /mnt/usb_1 ext4 defaults,noatime,nofail 0 0 #USB flash drive

tmpfs /tmp tmpfs defaults,noatime,nodev,nosuid,mode=1777 0 0
tmpfs /var/log tmpfs defaults,size=20m,noatime,nodev,nosuid,mode=1777 0 0
tmpfs /DietPi tmpfs defaults,size=10m,noatime,nodev,nosuid,mode=1777 0 0

192.168.1.4:/pi /mnt/pi nfs rsize=8192,wsize=8192,timeo=14,intr 0 0
192.168.1.4:/Multimedia /mnt/Multimedia nfs rsize=8192,wsize=8192,timeo=14,intr 0 0

Thanks for your help with this.
User avatar
Fourdee
Site Admin
Posts: 2782
Joined: Tue Feb 06, 2007 1:36 pm

Re: Cloudshell XU4 SSD and trim

Post by Fourdee »

Hi John,

Yep, same issues on my XU4 with EMMC and usb drive.

Did some Googling, looks like it might be a XU3/4 specific hardware "issue" or missing feature. Could even be kernel is missing a setting, but unsure at the moment: http://forum.odroid.com/viewtopic.php?f=99&t=7884

XU4 EMMC, sda is 500GB Hitachi platter (No trim support):

Code: Select all

root@DietPi-XU4:~# cat /sys/block/mmcblk0/queue/discard_max_bytes
0
root@DietPi-XU4:~# cat /sys/block/sda/queue/discard_max_bytes
0
C2 EMMC:

Code: Select all

root@DietPi:~# cat /sys/block/mmcblk0/queue/discard_max_bytes
2199023255040
RPi 3 (seems my 32GB USB pen drive doesnt support trim):

Code: Select all

root@DietPi:~# cat /sys/block/mmcblk0/queue/discard_max_bytes
612368384
root@DietPi:~# cat /sys/block/sda/queue/discard_max_bytes
0
If you find our project or support useful, then we’d really appreciate it if you’d consider contributing to the project however you can.
Donating is the easiest – you can use PayPal or become a DietPi patron.
User avatar
Fourdee
Site Admin
Posts: 2782
Joined: Tue Feb 06, 2007 1:36 pm

Re: Cloudshell XU4 SSD and trim

Post by Fourdee »

Thanks to you John :):
I'am adding a cron.daily TRIM for DietPi v121. Won't work for XU4 (yet), but other devices using flash memory should benefit from it:

This will trim all capable drives (via a list of all mount points):

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
If you find our project or support useful, then we’d really appreciate it if you’d consider contributing to the project however you can.
Donating is the easiest – you can use PayPal or become a DietPi patron.
User avatar
johnvick
Legend
Posts: 693
Joined: Wed Jun 08, 2016 11:53 am
Location: New Zealand

Re: Cloudshell XU4 SSD and trim

Post by johnvick »

Great thanks having just upgraded to 120 (all good so far) I'm looking forward to 121.

John
User avatar
johnvick
Legend
Posts: 693
Joined: Wed Jun 08, 2016 11:53 am
Location: New Zealand

Re: Cloudshell XU4 SSD and trim

Post by johnvick »

Hi Fourdee,

Up to 122 - thanks for the update. I have just tried the trim script and the result is the same - " the discard operation is not supported".

Any ideas?
User avatar
Fourdee
Site Admin
Posts: 2782
Joined: Tue Feb 06, 2007 1:36 pm

Re: Cloudshell XU4 SSD and trim

Post by Fourdee »

johnvick wrote:Hi Fourdee,

Up to 122 - thanks for the update. I have just tried the trim script and the result is the same - " the discard operation is not supported".

Any ideas?
Hi John,

Unfortunately, not at the moment.
Its either a XU4 hardware limitation, or, a possible kernel feature for TRIM/discard is disabled. Unsure.

I've created a post on the Odroid forum to ask Meveric this question, if anyone knows, he will: http://forum.odroid.com/viewtopic.php?f ... 02#p149502
If you find our project or support useful, then we’d really appreciate it if you’d consider contributing to the project however you can.
Donating is the easiest – you can use PayPal or become a DietPi patron.
Post Reply