「ソリッドステートドライブ/NVMe」の版間の差分

提供: ArchWiki
ナビゲーションに移動 検索に移動
(→‎インストール: add == Management == (from English))
(→‎管理: 警告の和訳)
(同じ利用者による、間の4版が非表示)
15行目: 15行目:
 
サポートされているファイルシステム、パフォーマンスの最適化・ディスクの読み書きの最小化などは[[ソリッドステートドライブ]]を見てください。
 
サポートされているファイルシステム、パフォーマンスの最適化・ディスクの読み書きの最小化などは[[ソリッドステートドライブ]]を見てください。
   
== Management ==
+
== 管理 ==
   
{{Note|This section was adapted from [https://nvmexpress.org/open-source-nvme-management-utility-nvme-command-line-interface-nvme-cli/].}}
+
{{Note|この章は [https://nvmexpress.org/open-source-nvme-management-utility-nvme-command-line-interface-nvme-cli/] を元にしています。}}
   
  +
接続されているすべての NVMe SSD の名前、シリアル番号、サイズ、LBAフォーマット、シリアルを一覧表示します:
List all the NVMe SSDs attached with name, serial number, size, LBA format and serial:
 
   
 
# nvme list
 
# nvme list
   
  +
ドライブとドライブがサポートする機能に関する情報を、人間にわかりやすい方法で一覧表示します:
List information about a drive and features it supports in a human-friendly way:
 
   
 
# nvme id-ctrl -H /dev/nvme0
 
# nvme id-ctrl -H /dev/nvme0
29行目: 29行目:
 
{{Tip|In order to make sense of the abbreviations used, see reference section 5.15.2.2 ("Identify Controller data structure") in the relevant [https://nvmexpress.org/developers/nvme-specification/ NVMe spec], e.g. bottom of p. 172 for the latest 1.4a spec.}}
 
{{Tip|In order to make sense of the abbreviations used, see reference section 5.15.2.2 ("Identify Controller data structure") in the relevant [https://nvmexpress.org/developers/nvme-specification/ NVMe spec], e.g. bottom of p. 172 for the latest 1.4a spec.}}
   
  +
名前空間とそれがサポートする機能に関する情報を一覧表示します:
List information about a namespace and features it supports:
 
   
 
{{Note|Namespaces are the construct in NVMe technology that hold user data. An NVMe controller can have multiple namespaces attached to it. Most NVMe SSDs today just use a single namespace, but multi-tenant applications, virtualization and security have use cases for multiple namespaces.}}
 
{{Note|Namespaces are the construct in NVMe technology that hold user data. An NVMe controller can have multiple namespaces attached to it. Most NVMe SSDs today just use a single namespace, but multi-tenant applications, virtualization and security have use cases for multiple namespaces.}}
37行目: 37行目:
 
{{Tip|In order to make sense of the abbreviations used, see reference section 5.15.2.1 ("Identify Namespace data structure") in the relevant [https://nvmexpress.org/developers/nvme-specification/ NVMe spec] (e.g. p. 163 for the latest 1.4a spec).}}
 
{{Tip|In order to make sense of the abbreviations used, see reference section 5.15.2.1 ("Identify Namespace data structure") in the relevant [https://nvmexpress.org/developers/nvme-specification/ NVMe spec] (e.g. p. 163 for the latest 1.4a spec).}}
   
  +
NVMeエラーログページを表示します:
Output the NVMe error log page:
 
   
 
# nvme error-log /dev/nvme0
 
# nvme error-log /dev/nvme0
43行目: 43行目:
 
{{Tip|Look for output where error count does not equal 1 to find out if there are any errors in the error log.}}
 
{{Tip|Look for output where error count does not equal 1 to find out if there are any errors in the error log.}}
   
  +
名前空間を削除します:
Delete a namespace:
 
   
  +
{{Warning|このコマンドは、指定された名前空間のすべてのデータを削除します。注意して使用してください。}}
{{Warning|This command will delete all data on the specified namespace. Use with caution!}}
 
   
 
# nvme delete-ns /dev/nvme0n1
 
# nvme delete-ns /dev/nvme0n1
   
  +
新しい名前空間を作成します。例えば、より小さなサイズの名前空間を作成して、SSDをオーバープロビジョニングし、耐久性、パフォーマンスおよび遅延を改善します:
Create a new namespace, e.g creating a smaller size namespace to overprovision an SSD for improved endurance, performance, and latency:
 
   
 
# nvme create-ns /dev/nvme0
 
# nvme create-ns /dev/nvme0
   
  +
すべてのコマンドのリストと簡潔な説明については、{{ic|nvme help}} や {{man|1|nvme}} を参照してください。
See {{ic|nvme help}} and {{man|1|nvme}} for a list of all commands along with a terse description.
 
   
 
=== SMART ===
 
=== SMART ===
   
  +
健康状態、温度、耐久性などの NVMe SMART ログページを出力します:
Output the NVMe SMART log page for health status, temp, endurance, and more:
 
   
 
# nvme smart-log /dev/nvme0
 
# nvme smart-log /dev/nvme0
133行目: 133行目:
 
== 参照 ==
 
== 参照 ==
 
* [https://www.intel.com/content/dam/support/us/en/documents/ssdc/data-center-ssds/Intel_Linux_NVMe_Guide_330602-002.pdf Intel Linux NVMe ドライバーリファレンス]
 
* [https://www.intel.com/content/dam/support/us/en/documents/ssdc/data-center-ssds/Intel_Linux_NVMe_Guide_330602-002.pdf Intel Linux NVMe ドライバーリファレンス]
  +
* [https://nvmexpress.org/open-source-nvme-management-utility-nvme-command-line-interface-nvme-cli/ Open Source NVMe™ Management Utility – NVMe Command Line Interface (NVMe-CLI)]
  +
* [https://metebalci.com/blog/a-quick-tour-of-nvm-express-nvme/ A Quick Tour of NVM Express (NVMe)]

2020年8月19日 (水) 11:38時点における版

関連記事

NVM Express (NVMe) は PCI Express バスから SSD に接続するための規格です。論理デバイスインターフェイスとして NVM Express は新規に設計されています。PCI Express SSD の低遅延と並行性を活かすために、最新の CPU やプラットフォーム、アプリケーションの並列性を複製するように開発されました。

インストール

Linux の NVMe ドライバーはカーネルバージョン 3.3 から含まれています。NVMe デバイスは /dev/nvme* 下に認識されます。

NVMe のユーザースペースツールは nvme-cli または nvme-cli-gitAUR に含まれています。

サポートされているファイルシステム、パフォーマンスの最適化・ディスクの読み書きの最小化などはソリッドステートドライブを見てください。

管理

ノート: この章は [1] を元にしています。

接続されているすべての NVMe SSD の名前、シリアル番号、サイズ、LBAフォーマット、シリアルを一覧表示します:

# nvme list

ドライブとドライブがサポートする機能に関する情報を、人間にわかりやすい方法で一覧表示します:

# nvme id-ctrl -H /dev/nvme0
ヒント: In order to make sense of the abbreviations used, see reference section 5.15.2.2 ("Identify Controller data structure") in the relevant NVMe spec, e.g. bottom of p. 172 for the latest 1.4a spec.

名前空間とそれがサポートする機能に関する情報を一覧表示します:

ノート: Namespaces are the construct in NVMe technology that hold user data. An NVMe controller can have multiple namespaces attached to it. Most NVMe SSDs today just use a single namespace, but multi-tenant applications, virtualization and security have use cases for multiple namespaces.
# nvme id-ns /dev/nvme0n1
ヒント: In order to make sense of the abbreviations used, see reference section 5.15.2.1 ("Identify Namespace data structure") in the relevant NVMe spec (e.g. p. 163 for the latest 1.4a spec).

NVMeエラーログページを表示します:

# nvme error-log /dev/nvme0
ヒント: Look for output where error count does not equal 1 to find out if there are any errors in the error log.

名前空間を削除します:

警告: このコマンドは、指定された名前空間のすべてのデータを削除します。注意して使用してください。
# nvme delete-ns /dev/nvme0n1

新しい名前空間を作成します。例えば、より小さなサイズの名前空間を作成して、SSDをオーバープロビジョニングし、耐久性、パフォーマンスおよび遅延を改善します:

# nvme create-ns /dev/nvme0

すべてのコマンドのリストと簡潔な説明については、nvme helpnvme(1) を参照してください。

SMART

健康状態、温度、耐久性などの NVMe SMART ログページを出力します:

# nvme smart-log /dev/nvme0
ヒント: Use the -H option to output even more information, e.g. nvme smart-log -H /dev/nvme0.

NVMe support was added to smartmontools in version 6.5 (available since May 2016 in the official repositories).

ノート: smartmontools official wiki reports this support as experimental.

Currently implemented features (as taken from the wiki):

  • Basic information about controller name, firmware, capacity (smartctl -i)
  • Controller and namespace capabilities (smartctl -c)
  • SMART overall-health self-assessment test result and warnings (smartctl -H)
  • NVMe SMART attributes (smartctl -A)
  • NVMe error log (smartctl -l error[,NUM])
  • Ability to fetch any nvme log (smartctl -l nvmelog,N,SIZE)
  • The smartd daemon tracks health (-H), error count (-l error) and temperature (-W DIFF,INFO,CRIT)

See S.M.A.R.T. and the official wiki entry for more information, and see this article for contextual information about the output.

Secure erase

See Solid state drive/Memory cell clearing#NVMe drive.

パフォーマンス

セクタサイズ

Advanced Format#HDD が 4k セクタを使用しているかどうか判断する方法を見てください。

Discard

ノート: SSD では定期的な TRIM の適用を選択できる (推奨しません) のに反して、NVMe デバイスでは discard は実行するべきではありません

ext4LVM を使用する普通のセットアップではデフォルトで Discard は無効になりますが、ファイルシステムによっては明示的に無効化する必要があります。

SSD メーカーの Intel はファイルシステムレベルで discard を有効にすることを非推奨としており、代わりに fstrim で定期的に TRIM を適用する方法を提案しています [2]

エアフロー

NVMe SSD は負担時に高熱になることが知られており、特定の閾値に達すると性能が制限されます [3]

テスト

デバイスの性能テストは hdparm で実行できます:

# hdparm -Tt --direct /dev/nvme0n1

省電力 APST

NVME 省電力パッチ

Andy Lutomirski は Linux における NVMe デバイスの省電力機能を修正するパッチセットをリリースしています。メインラインカーネル v4.11 でパッチはマージされました。

NVME の電源管理が動作しているかテストするには、nvme-cli をインストールして # nvme get-feature -f 0x0c -H /dev/nvme[0-9] を実行してみてください:

# nvme get-feature -f 0x0c -H /dev/nvme0
get-feature:0xc (Autonomous Power State Transition), Current value:0x000001
        Autonomous Power State Transition Enable (APSTE): Enabled
        Auto PST Entries        .................

...

ASPT が有効になっている場合 Autonomous Power State Transition Enable (APSTE): Enabled と出力されます。表のエントリは各ステートに移行するときの待機時間を示しています。

ASPT が有効になっているのにステートが表に表示されない場合、高遅延のせいでデフォルトで有効になっていない可能性があります。# nvme id-ctrl /dev/nvme[0-9] を使うことで NVME コントローラの未使用のステートを確認できます。ステートの遅延の合計 (enlat + xlat) が 25000 (25ms) よりも大きい場合、有効にするにはブートパラメータを使って nvme_core カーネルモジュールdefault_ps_max_latency_us オプションで最低でもこれよりも高い値を渡す必要があります。ASPT が有効になり # nvme get-feature の表にエントリが表示されるようになります。

Linux 4.10 における Samsung ドライブのエラー

Linux 4.10 では、ドライブのエラーが発生してシステムが不安定になることがあります。省電力状態となったときにドライブが使えなくなるようです。カーネルパラメータ nvme_core.default_ps_max_latency_us=5500 は一番低い省電力ステートを無効にし、書き込みエラーを防止します [4][5]

参照