[kwlug-disc] SMART for SSDs

Khalid Baheyeldin kb at 2bits.com
Fri Jul 31 10:28:32 EDT 2015


On Fri, Jul 31, 2015 at 1:38 AM, B.S. <bs27975 at yahoo.ca> wrote:

> Be fair ... article notes bug presents itself 'if the system is using
> linux md raid with raid0 or raid10'.
>
> [From bug fix patch: This fixes a data corruption bug when using discard
> on top of MD linear,
> raid0 and raid10 personalities.]
>

The point here is that for the longest of time, it was thought that the
issue was within the Samsung drive, when it was not. To the extent that
drivers block certain drives based on such assumptions.

See below re: man page for fstrim-all.


> From my reading when I first got my SSD, fstab has
> "defaults,noatime,nodiratime,discard" (ext4).
>

How long have you been running with this?
And what drive model?
Does hdparm -I /dev/sdX say it has TRIM support?


> Reading further, now, http://linux.die.net/man/8/mkfs.ext3, looks like
> discard is the default. (discard feels trim related.) I also see that mkfs
> defaults come from /etc/mke2fs.conf
>

Actually, "discard" is an option for mount

http://linux.die.net/man/8/mount

But fstrim is enabled by default in Ubuntu 14.04 and its variants. Look
what is in /etc/cron.weekly/fstrim, and you will see fstrim-all.

If you check the man page for it:

http://manpages.ubuntu.com/manpages/trusty/man8/fstrim-all.8.html

You will see:

This only runs on Intel and Samsung SSDs as some SSDs with faulty firmware
may encounter data loss problems when running fstrim  under  high  I/O  load

So we are back to this selectivity per vendor thing, in utilities and in
kernel drivers.

As for what is the best way to trim, this guy summarizes things well:

https://sites.google.com/site/easylinuxtipsproject/ssd#TOC-Preferred-method:-by-rc.local

You will see that he recommends running fstrim in rc.local, so it runs once
at boot time.

He then recommends that you disable the weekly fstrim that is enabled by
default in 14.04.

And for machines that are always on, he recommends a daily fstrim.

He also says that discard is not advised.

Now, is that the final word on the matter? Who knows? Information conflicts
from various sources, and that is why I am asking the list what their
experience is.

Topically, given meeting (btrfs) context ...
>

Skipping btrfs stuff since I am not using it yet. Still on ext4.


> A related thing I have recently come across, interesting for those of you
> still using 12.04 ...


On some of the servers, I am still using 12.04 because of the PHP version
that comes with it and it being compatible with Drupal 6.

On the laptop, where the SSD is now, I am on 14.04.
-- 
Khalid M. Baheyeldin
2bits.com, Inc.
Fast Reliable Drupal
Drupal optimization, development, customization and consulting.
Simplicity is prerequisite for reliability. --  Edsger W.Dijkstra
Simplicity is the ultimate sophistication. --   Leonardo da Vinci
For every complex problem, there is an answer that is clear, simple, and
wrong." -- H.L. Mencken
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://kwlug.org/pipermail/kwlug-disc_kwlug.org/attachments/20150731/20da768a/attachment.htm>


More information about the kwlug-disc mailing list