<p dir="ltr"><br>
On 26/04/2013 9:49 AM, &quot;Josu Lazkano&quot; &lt;<a href="mailto:josu.lazkano@gmail.com">josu.lazkano@gmail.com</a>&gt; wrote:<br>
&gt;<br>
&gt; Hello, thanks for the reply.<br>
&gt;<br>
&gt; 2013/4/25 Igor Cicimov &lt;<a href="mailto:icicimov@gmail.com">icicimov@gmail.com</a>&gt;:<br>
&gt; &gt;<br>
&gt; &gt; To optimize the SSD performance you need to enable TRIM for your SSD. You<br>
&gt; &gt; can check for it like this:<br>
&gt; &gt;<br>
&gt; &gt; # hdparm -I /dev/sdb | grep -i trim<br>
&gt; &gt;   * Data Set Management TRIM supported (limit 8 blocks)<br>
&gt; &gt;   * Deterministic read data after TRIM<br>
&gt;<br>
&gt; This is the output of the command:<br>
&gt;<br>
&gt; # hdparm -I /dev/sda | grep -i trim<br>
&gt;   * Data Set Management TRIM supported (limit unknown)<br>
&gt;<br>
&gt; Is this OK?<br>
&gt;<br>
Yes</p>
<p dir="ltr">&gt; &gt;<br>
&gt; &gt; Then you need to add the &#39;discard&#39; option to the partitions on the SSD drive<br>
&gt; &gt; in /etc/fstab. On my system:<br>
&gt; &gt;<br>
&gt; &gt; # / was on /dev/sdb2 during installation<br>
&gt; &gt; UUID=7a71b85c-42e6-4135-b117-b4505cdbfd6e /               ext4<br>
&gt; &gt; errors=remount-ro,discard 0       1<br>
&gt; &gt; # /home was on /dev/sdb4 during installation<br>
&gt; &gt; UUID=0a7b2dec-a8e4-4634-bc3b-3f67bcb41443 /home           ext4<br>
&gt; &gt; defaults,discard        0       2<br>
&gt; &gt;<br>
&gt; &gt; but you need ext4 for this. You can also add &#39;noatime&#39; too to the options to<br>
&gt; &gt; reduce the SSD writes and increase its lifetime. Then reboot the system.<br>
&gt;<br>
&gt; This is my original fstab file:<br>
&gt;<br>
&gt; # cat /etc/fstab<br>
&gt; UUID=3d4a3495-832b-40eb-881a-ac77497feb30 /               ext4<br>
&gt; errors=remount-ro 0       1<br>
&gt; UUID=fda3b8ef-5fa0-49ee-a5ef-1a12e78f1db8 none            swap    sw<br>
&gt;            0       0<br>
&gt;<br>
&gt; I change it to this:<br>
&gt;<br>
&gt; # cat /etc/fstab<br>
&gt; UUID=3d4a3495-832b-40eb-881a-ac77497feb30 /               ext4<br>
&gt; errors=remount-ro,discard,noatime 0       1<br>
&gt; UUID=fda3b8ef-5fa0-49ee-a5ef-1a12e78f1db8 none            swap    sw<br>
&gt;            0       0<br>
&gt;<br>
&gt; Is this correct?<br>
&gt;<br>
Yes but you need remount/reboot for that to take effect.</p>
<p dir="ltr">&gt; &gt; To see the trimming in action you can run:<br>
&gt; &gt;<br>
&gt; &gt; # fstrim -v /<br>
&gt; &gt; # fstrim -v /home<br>
&gt;<br>
&gt; I don&#39;t understand fstrim commands, this my output:<br>
&gt;<br>
&gt; # fstrim -v /<br>
&gt; /: 48443392 bytes were trimmed<br>
&gt;<br>
&gt; What that is means? Is this correct?<br>
&gt;<br>
Means trimming is working.</p>
<p dir="ltr">&gt; &gt; You can also set the above as a daily cronjob if you want to execute<br>
&gt; &gt; trimming on runtime apart from boot time.<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; In case you have a bad inodes or any kind of filesystem corruption I would<br>
&gt; &gt; recommend to reset the SSD to factory settings. The SSD after booting is<br>
&gt; &gt; protected by the BIOS so you need to boot with the SSD disconnected (from<br>
&gt; &gt; live cd probably), then connect it and execute the following procedure<br>
&gt; &gt; (replace sdb with what ever it shows up on your system, run blkid to find<br>
&gt; &gt; it):<br>
&gt; &gt;<br>
&gt; &gt; # dcfldd if=/dev/zero of=/dev/sdb bs=4k<br>
&gt; &gt; # hdparm --user-master u --security-set-pass Eins /dev/sdb<br>
&gt; &gt; # hdparm --user-master u --security-erase Eins /dev/sdb<br>
&gt; &gt;<br>
&gt; &gt; and then set your fstab as above (and don&#39;t forget to replace sdb and UUID<br>
&gt; &gt; as appropriate for your case) and reboot.<br>
&gt;<br>
&gt; If a do this steps, will I erase all data of the disk?<br>
&gt; <br>
Yes</p>
<p dir="ltr"> &gt; Is this necessary?<br>
&gt;<br>
Only if you think you have corrupt file system.</p>
<p dir="ltr">&gt; &gt; Hope this helps.<br>
&gt; &gt;<br>
&gt; &gt; Igor<br>
&gt;<br>
&gt; Thank you very much for your great reply.<br>
&gt;<br>
&gt; Best regards.<br>
&gt;<br>
&gt; --<br>
&gt; Josu Lazkano<br>
&gt; _______________________________________________<br>
&gt; mythtv-users mailing list<br>
&gt; <a href="mailto:mythtv-users@mythtv.org">mythtv-users@mythtv.org</a><br>
&gt; <a href="http://www.mythtv.org/mailman/listinfo/mythtv-users">http://www.mythtv.org/mailman/listinfo/mythtv-users</a><br>
</p>