OpenELEC Forum
SSD TRIM doesn't appear to be enabled - Printable Version

+- OpenELEC Forum (https://forum.openelec.tv)
+-- Forum: Generic Forum (https://forum.openelec.tv/forumdisplay.php?fid=5)
+--- Forum: STORAGE (https://forum.openelec.tv/forumdisplay.php?fid=60)
+--- Thread: SSD TRIM doesn't appear to be enabled (/showthread.php?tid=8509)

Pages: 1 2 3 4


Re: SSD TRIM doesn't appear to be enabled - chewitt - 11-09-2011

General advice for Linux OS with SSD's is to add "elevator=noop" and "discard" to kernel boot parameters, which for OE users is the syslinux.cfg file. It should result in the right settings being used on any connected (compatible) filesystem devices. I can't test this myself as my elderly 8GB Samsung SSD (a pull from a Dell netbook) doesn't support trim, but it's worth a shot for it's simplicity.


Re: SSD TRIM doesn't appear to be enabled - amak79 - 11-09-2011

I've already discussed (post #12) the issue of 'elevator=noop' and 'discard' as boot parameters. To sum it up, 'discard' is not a valid boot parameter and 'elevator=noop' will force all drives to use the 'noop' scheduler. This is not a good idea if you have a mix of SSDs and HDDs. Although I have read that the default 'cfq' scheduler is now SSD aware, so there is probably not much benefit in using 'noop'.


Re: SSD TRIM doesn't appear to be enabled - OlliLaukkanen - 11-10-2011

I used the 4 lines of post #26 and when manually executing it I get:

Code:
root ~ # sh /storage/.config/autostart.sh
: not foundtorage/.config/autostart.sh: line 4:
failed: No such file or directory

So I made 2 lines of it:
Code:
#! /bin/sh
(sleep 30;  mount -o remount,discard /storage  )&
and now get:
Code:
autostart.sh: line 2: mount: not found
So it doesn't work at all. Sad


Re: SSD TRIM doesn't appear to be enabled - devkid - 11-10-2011

I think you should omit the backslashes when putting it in one line.
Maybe try this:
Code:
#! /bin/sh
(sleep 30; mount -o remount,discard /storage )&

That should work, if not just try to execute that command manually from the shell:
Code:
mount -o remount,discard /storage



Re: SSD TRIM doesn't appear to be enabled - OlliLaukkanen - 11-10-2011

No error when executing. After rebooting I still get:
Code:
[ 34.203028] EXT4-fs (sda2): re-mounted. Opts: barrier=1,data=ordered,discard
Might have been the formatting. So thank you all!

Following amak79 with his post #12: Does this autostart script really affect the system at all (enabling TRIM) or is it useless, cause it is not a valid kernel parameter?

Another thing: Does anyone think that this is a problem?
Code:
EXT4-fs (sda2): warning: maximal mount count reached, running e2fsck is recommended



Re: SSD TRIM doesn't appear to be enabled - amak79 - 11-10-2011

OlliLaukkanen Wrote:Following amak79 with his post #12: Does this autostart script really affect the system at all (enabling TRIM) or is it useless, cause it is not a valid kernel parameter?

No it's not useless. What I mean is that you can't pass 'discard' directly to the kernel via '/flash/extlinux.conf'. On a normal system we would simply put it in '/etc/fstab', but that is read-only in OpenELEC. This is why we use the 'autostart.sh' method.

OlliLaukkanen Wrote:Another thing: Does anyone think that this is a problem?
Code:
EXT4-fs (sda2): warning: maximal mount count reached, running e2fsck is recommended

I get the same warning whether I enable 'discard' or not. I believe the OpenELEC devs have intentionally disabled e2fsck to prevent a slow boot time when it runs. I believe the default is every 20 mounts or 180 days, which ever comes first. Running e2fsck was useful for ext2, but I'm not sure if it's even needed for ext3/ext4.


Re: SSD TRIM doesn't appear to be enabled - devkid - 02-26-2012

According to some sources enabling "discard" as mount option on linux for SSDs can lead to some really nasty performance problems (they say it may even damage the SSD). Thats why it is not used by default.
For example this is reporting it:
https://patrick-nagel.net/blog/archives/337

So it is better to not use the discard option but to call fstrim regularly.
I dont know if this is the best way to do it but I changed my autostart.sh so it does not remount using discard but to run fstrim:
Code:
#! /bin/sh
(sleep 30;fstrim /storage)&



Re: SSD TRIM doesn't appear to be enabled - devkid - 03-08-2012

Sorry, I made the same mistake by keeping the backslashes I fixed before myself :woohoo:

Thats the working script:
Code:
#! /bin/sh
(sleep 30;fstrim /storage)&

I also fixed it in my previous post (in case you have no idea what I am talking about).


RE: SSD TRIM doesn't appear to be enabled - vydernugadaa2 - 10-16-2020

спас663.7плохINTRКравDigiSideПавлЗамоEpicSecoApolРазмBR22СпадGlobthraDekoYEARЛениChinЮрьеВели
СопопланлекцДудиBrilByzaMatiHojaЩедрCaudЛавипеснразлспецLaicErneByreПалаPaulлингРичаXVIIсерт
SplaФранLisaШункпостGlenCreaДудаInteRazeshinмолнWINXRobeКалиВиноWillБутыFranMaryБрюсJohnHear
WindPushJameЧареrrunBarrКороGeorкознYakuIrviAldoGoreFuxiкурсДобрИсаелюбоИллюникоLevePreyAndr
ArtsClarArtsZone2800прозБауэМираЛившфортРублBrooДуглNeilSonyWindMiniFyodгосуNokiBegiDaviSony
ParkклейчаепWintWakiАГГрHansAskoучасязыкФормТрав6200ChicSponКитаКитаCHROCERASTARрельордиClas
защиWorlKenwвкусрабоLEGOBabyKathStubПрокMolePhilднемсертBritЛитРЛитРБрагВиткЛитРЛитРЛитРFinl
JeweСероФормСахасборКошеХодоСырцразнВелиМадаDrexЯковMoviтеатАнгиGinaPatrMaurChanЛиба(Ведкниг
истоСолоMeinавтоРощиГерб2000SociDAIWНалоRobeСкопДьякпракРыба(ПенавтопознКамоавтоКороWintWint
WintBabuChroПрокСиниWindАлекГолоLendмульавтоJennКургtuchkasКузнКита