在 Ubuntu 16.04 上,使用 Samsung 850 EVO SSD,是否需要任何後期配置?

在 Ubuntu 16.04 上,使用 Samsung 850 EVO SSD,是否需要任何後期配置?

三星 Evo 850http://www.samsung.com/semiconductor/minisite/ssd/product/consumer/850evo.html

以下貼文建議在 Ubuntu 16.04 和 850 EVO 中,預設啟用 TRIM。

然而,

cat /etc/cron.weekly/fstrim

回報

#!/bin/sh
# trim all mounted file systems which support it
/sbin/fstrim --all || true

我在其他地方讀到過,最新的 Ubuntu 版本需要哪些 SSD 最佳化?,David Ambarsumov 的回答是,16.04 沒有 -all 選項。那麼每週 TRIM 有效嗎?我知道引用是 fstrim-all 不可用,但我不知道這是否相同,以及 fstrim --all 是否按預期工作(這可能只是我的緊張和對這方面缺乏了解) 。

其次,我在其他地方讀到應該在 /etc/fstab 中設定 noatime 選項。這仍然相關嗎?我目前在該文件中沒有看到 noatime 或 relatime ?

最後,我讀到,我認為這已經很舊了,應該選擇與預設調度程序不同的調度程序。這是真的嗎?

謝謝你的時間!關於 SSD 的許多資訊都是過時的,Linux 和 Ubuntu 在那段時間取得了很大的進步,所以有點令人困惑。

答案1

fstrim支援--allUbuntu 16.04 上的選項。

$ lsb_release -dirc
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.1 LTS
Release:        16.04
Codename:       xenial

$ fstrim --help

Usage:
 fstrim [options] <mount point>

Discard unused blocks on a mounted filesystem.

Options:
 -a, --all           trim all mounted filesystems that are supported
 -o, --offset <num>  the offset in bytes to start discarding from
 -l, --length <num>  the number of bytes to discard
 -m, --minimum <num> the minimum extent length to discard
 -v, --verbose       print number of discarded bytes

 -h, --help     display this help and exit
 -V, --version  output version information and exit

For more details see fstrim(8).

預設情況下,Ubuntu 16.04 掛載所有檔案系統relatime。這noatime比僅添加極少量的寫入操作要好得多。

不要弄亂 I/O 調度程式。

為了安心,您可以使用smartctl(如果需要,請安裝它sudo apt-get install smartmontools)不時檢查Life_Curve_StatusSSD_Life_LeftLifetime_Writes_GiB

$ sudo smartctl --all /dev/sda
...
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME      FLAG    VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
...
194 Temperature_Celsius 0x0022  047   063   000    Old_age   Always       -       47 (Min/Max 21/63)
...
230 Life_Curve_Status   0x0013  100   100   000    Pre-fail  Always       -       100
231 SSD_Life_Left       0x0013  100   100   010    Pre-fail  Always       -       0
...
241 Lifetime_Writes_GiB 0x0032  000   000   000    Old_age   Always       -       388
...

Life_Curve_Status並且SSD_Life_Left具有百分比值:當 SSD 減少到 20% 或 10% 以下時,您將需要更換 SSD。如果可以,請在運行之前將終端設定為 132 列smartctl。)

最後,請記住,850 EVO 是來自信譽良好的製造商的高品質昂貴 SSD。它具有彈性,使用壽命很長,可能比任何旋轉盤都長。三星承認,你能做的唯一有幫助的事情就是稍微過度配置,也就是說,在分區時留下大約 5% 的未分區空間。 (這將使內部重新映射/垃圾收集演算法更有效地工作;如果您決定這樣做,那麼僅當SSD 是新的或在全盤修剪或安全擦除之後才這樣做,以便過度配置的空間完全由區塊組成已知未使用。

相關內容