You are not logged in.

#1 2015-09-02 11:11:11

5ulo
Member
From: Slovakia
Registered: 2012-05-04
Posts: 100

TRIM via fstrim Vs mount flag

According to the Wiki I applied periodic TRIM via fstrim. But at the end of the article in the section Choice of filesystem is mentioned this:

... ext4 users must explicitly enable the TRIM command support using the discard mount option in fstab (or with tune2fs -o discard /dev/sdaX) ...

So now I'm completely lost. What should I use - fstrim or mount flag discard??
Thanks

Offline

#2 2015-09-02 11:25:30

frostschutz
Member
Registered: 2013-11-15
Posts: 1,647

Re: TRIM via fstrim Vs mount flag

Let's say you deleted your photo collection by accident.

discard mount option: your photos are gone instantly and not coming back
fstrim: you can probably photorec as long as the cronjob didn't run yet, but they're gone if it already ran [so if you have an accident the first thing you should do is disable the fstrim job]
none: photorec might get some them back even after considerable time has passed

fstrim is a best of both worlds (theoretical SSD performance improvement vs. data safety/remanence); I run it in a monthly cron job.

If you do use TRIM (regardless which flavour of it), you should know that backups are even more important for SSD than they were for HDD, because SSD have this inherent ability to throw away all of your data in zero time

If the wiki says "must ... enable ... discard" the Wiki is very wrong. TRIM is entirely optional, if not to say superfluous. Many people don't use it and never have any issues because of it, whereas there have been lots of trim related bugs.

Last edited by frostschutz (2015-09-02 11:28:31)

Offline

#3 2015-09-02 12:43:57

5ulo
Member
From: Slovakia
Registered: 2012-05-04
Posts: 100

Re: TRIM via fstrim Vs mount flag

Thanks frostschutz, I was lost because of the note for ext4. It sounds to me like the ext4 isn't supported by fstrim and therefore i have to move to discard. I'm glad I don't need to move from fstrim smile

Offline

#4 2015-09-02 13:08:19

frostschutz
Member
Registered: 2013-11-15
Posts: 1,647

Re: TRIM via fstrim Vs mount flag

you can test whether it works like this http://unix.stackexchange.com/a/85880/30851

Offline

Board footer

Powered by FluxBB