[mythtv-users] SSD disk for the frontend

Josu Lazkano josu.lazkano at gmail.com
Thu Apr 25 23:49:42 UTC 2013


Hello, thanks for the reply.

2013/4/25 Igor Cicimov <icicimov at gmail.com>:
>
> To optimize the SSD performance you need to enable TRIM for your SSD. You
> can check for it like this:
>
> # hdparm -I /dev/sdb | grep -i trim
>   * Data Set Management TRIM supported (limit 8 blocks)
>   * Deterministic read data after TRIM

This is the output of the command:

# hdparm -I /dev/sda | grep -i trim
  * Data Set Management TRIM supported (limit unknown)

Is this OK?

>
> Then you need to add the 'discard' option to the partitions on the SSD drive
> in /etc/fstab. On my system:
>
> # / was on /dev/sdb2 during installation
> UUID=7a71b85c-42e6-4135-b117-b4505cdbfd6e /               ext4
> errors=remount-ro,discard 0       1
> # /home was on /dev/sdb4 during installation
> UUID=0a7b2dec-a8e4-4634-bc3b-3f67bcb41443 /home           ext4
> defaults,discard        0       2
>
> but you need ext4 for this. You can also add 'noatime' too to the options to
> reduce the SSD writes and increase its lifetime. Then reboot the system.

This is my original fstab file:

# cat /etc/fstab
UUID=3d4a3495-832b-40eb-881a-ac77497feb30 /               ext4
errors=remount-ro 0       1
UUID=fda3b8ef-5fa0-49ee-a5ef-1a12e78f1db8 none            swap    sw
           0       0

I change it to this:

# cat /etc/fstab
UUID=3d4a3495-832b-40eb-881a-ac77497feb30 /               ext4
errors=remount-ro,discard,noatime 0       1
UUID=fda3b8ef-5fa0-49ee-a5ef-1a12e78f1db8 none            swap    sw
           0       0

Is this correct?

> To see the trimming in action you can run:
>
> # fstrim -v /
> # fstrim -v /home

I don't understand fstrim commands, this my output:

# fstrim -v /
/: 48443392 bytes were trimmed

What that is means? Is this correct?

> You can also set the above as a daily cronjob if you want to execute
> trimming on runtime apart from boot time.
>
>
> In case you have a bad inodes or any kind of filesystem corruption I would
> recommend to reset the SSD to factory settings. The SSD after booting is
> protected by the BIOS so you need to boot with the SSD disconnected (from
> live cd probably), then connect it and execute the following procedure
> (replace sdb with what ever it shows up on your system, run blkid to find
> it):
>
> # dcfldd if=/dev/zero of=/dev/sdb bs=4k
> # hdparm --user-master u --security-set-pass Eins /dev/sdb
> # hdparm --user-master u --security-erase Eins /dev/sdb
>
> and then set your fstab as above (and don't forget to replace sdb and UUID
> as appropriate for your case) and reboot.

If a do this steps, will I erase all data of the disk? Is this necessary?

> Hope this helps.
>
> Igor

Thank you very much for your great reply.

Best regards.

--
Josu Lazkano


More information about the mythtv-users mailing list