TOPIC: [ULTRA] Installation of OpenElec EDEN built on SSD - TRIM - DISCARD Settings

[ULTRA] Installation of OpenElec EDEN built on SSD - TRIM - DISCARD Settings 1 year 2 months ago #1

  • Nitropenda
  • Nitropenda's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 22
  • Karma: 0
Hi all,

a lot of users currently switching from SATA hard disc drives to SATA Solid State Disc Drives.
So I also bought a Crucial M4 64GB SSD and installed OpenElec on it (Eden-built: OpenELEC-Ultra.x86_64-devel-20120302013700-r9963). As Skin I'm using the Back Row Skin which fits perfect to my Home-Cinema.

Now the question for me is how to activate TRIM on the SSD.
I searched the forum and found different answers and different settings.
Could someone help me in summarizing the stuff to get a general workflow for all OpenElec users?
In the Xtreamer Ultra BIOS I have switched the SATA support from "IDE" to "AHCI".

What I know so far:

1. The OpenElec kernel (in Dharma/Eden builts) is supporting TRIM/DISCARD, but it's not activated by default. The reason is not known to me.

2. I have to add TRIM/DISCARD commands/parameters somehow in a configfile, maybe autostart.sh.
autostart.sh is located in /storage/.config/autostart.sh. This should be equal to create a autostart.sh file in "\\OPENELEC\Configfiles" (in the windows explorer)

3. I found following autostart.sh commands so far:
#! /bin/sh
(sleep 30; mount -o remount,discard /storage )&
It was also mentioned to avoid the usage of the discard option and to use fstrim instead:
#! /bin/sh
(sleep 30; \ fstrim /storage \ )&

4. In another thread I found tunefs commands instead of the above autostart commands:
sudo tune2fs -o discard /dev/sdb1
sudo tune2fs -o discard /dev/sdb2

Now I have a lot of information but no exact way to activate TRIM.
Any ideas HOW activating TRIM on SSDs step by step?

Best regards,
Nitropenda
Last Edit: 1 year 2 months ago by Nitropenda.
The administrator has disabled public write access.

Aw: [ULTRA] Installation of OpenElec EDEN built on SSD - TRIM - DISCARD Settings 1 year 2 months ago #2

  • Muschl
  • Muschl's Avatar
  • OFFLINE
  • Senior Boarder
  • Deutscher Herbst
  • Posts: 112
  • Thank you received: 14
  • Karma: 2
Enable the Trim Support On setup via tunefs.
Some informations available in the Manual Installation Link in my signature.

Because you Need only to Set it One Time with this Solution .
Muschl


1.) ZBOX AD10 (PVR latest x86_64) - 4GB RAM - 4GB SD Card (System) - 1TB Samsung HDD (Storage) - Nova-T USB2 -

2.) ZBOX AD10 (PVR latest x86_64) - 4GB RAM - 4GB SD Card (System) - 128GB OCZ Agility (Storage) - Nova-TD -
The administrator has disabled public write access.

Re: [ULTRA] Installation of OpenElec EDEN built on SSD - TRIM - DISCARD Settings 1 year 2 months ago #3

  • devkid
  • devkid's Avatar
  • NOW ONLINE
  • Senior Boarder
  • Posts: 104
  • Thank you received: 5
  • Karma: 3
According to some benchmarks on the net the discard option *might* lead to some nasty performance drops on your fs in some cases. Some people say it may even damage the SSD (which I do not believe myself to be frankly). Thats probably also the reason why discard option is not used by default in most linux distros.
I guess the actual effects for you depend on your SSD-chipset/firmware and maybe other factors.
So I think the only way to know for sure if its ok for you to use the discard option without disadvantages is running some benchmarks yourself.

To be on the safe side I am personally using the method of running a manual fstrim on boot up like the second part of your point (3). I didnt encounter any drawbacks yet.

I guess you can ask 5 different people on that topic and you get 5 different answers. Some people even say that TRIM is not needed anymore for recent OSs/SSDs. So there is not THE right way I am afraid. You will have to decide for yourself.
The administrator has disabled public write access.

Re: [ULTRA] Installation of OpenElec EDEN built on SSD - TRIM - DISCARD Settings 1 year 2 months ago #4

  • Nitropenda
  • Nitropenda's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 22
  • Karma: 0
Thanks for both statements.

So it's possible to run a "manual" trim by unsing the fstrim command and add this to the autostart.sh.
To be on the safe side:
I open "\\OPENELEC\Configfiles" in the windows explorer and create the file autostart.sh with the following content:
#! /bin/sh
(sleep 30; \ fstrim /storage \ )&
But at which time fstrim is running then? At the startup procedure or later?
Is the sleep command necessary? Does this sleep command increase the boot-up time?

Nitropenda
Last Edit: 1 year 2 months ago by Nitropenda.
The administrator has disabled public write access.

Re: [ULTRA] Installation of OpenElec EDEN built on SSD - TRIM - DISCARD Settings 1 year 2 months ago #5

  • devkid
  • devkid's Avatar
  • NOW ONLINE
  • Senior Boarder
  • Posts: 104
  • Thank you received: 5
  • Karma: 3
Nitropenda wrote:
#! /bin/sh
(sleep 30; \ fstrim /storage \ )&
But at which time fstrim is running then? At the startup procedure or later?
Is the sleep command necessary? Does this sleep command increase the boot-up time?
It will run the fstrim once at system startup. The purpose of the sleep is to no interfere with all the other processes that start at the same time. So actually fstrim will be executed 30 seconds after the system startup.
It will not increase boot time because of the '&' at the end of the command. This tells the shell to execute it in the background (not blocking the executing shell). So if you execute the script yourself from the command line you should immediately return to the command line. When you look into your process list you will see a process that sleeps for 30 seconds and then executes the fstrim.

Btw I think I had the script wrong in the other thread, sorry. The actual script needs to look like this:
#! /bin/sh
(sleep 30;fstrim /storage)&
The administrator has disabled public write access.

Re: [ULTRA] Installation of OpenElec EDEN built on SSD - TRIM - DISCARD Settings 1 year 2 months ago #6

  • Jean-Max
  • Jean-Max's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 314
  • Thank you received: 7
  • Karma: 1
Hello,

I believed that TRIM was enabled by default if Openelec detects an ssd :
-> See 4th line in this post:
openelec.tv/forum/14-general-help-and-su...ssd-good-idea-#12132

So ?

Thanks :)
Jean-Max
- ZBOX HD-ID11 4Go Ram - Openelec EDEN ION 2.0 X86-64 (SSD Intel 40Go)
- ZBOX AD10 4Go Ram - Openelec EDEN FUSION 2.0 X86-64 (SSD Intel 40Go)
- XBMC Windows 13.0 Gotham A1 on 3 PC W7 + 1 PC XP
- Skin : Confluence-MOD 2
- 7To Thecus NAS Raid 5 (SMB shares)
- HDHomerun netw DVB-T tuner
...
Last Edit: 1 year 2 months ago by Jean-Max.
The administrator has disabled public write access.

Our Sponsors & Partners

arctic_logo