LoginSignup
0
0

Raspberry Pi 5をNVMe SSDで起動する

Last updated at Posted at 2024-04-02

日本国内でも発売されたRaspberry Pi5をNVMe接続のSSDで利用するための備忘録

購入したもの

購入品 販売店 価格 リンク
Raspberry Pi 5 Amazon ¥16,900 https://amzn.to/4aAyBMF
NVMe SSD 256GB Amazon ¥3,582 https://amzn.to/3U3Zbss
NVMe マウント基盤 Amazon ¥2,599 https://amzn.to/4cQZYEq
microSD(32GB) Amazon ¥640 https://amzn.to/3U17KUQ

組み立て

精密プラスドライバー1本が必要。特に何も考えずに組み立てて良い。NVMe SSDもこの時に装着する。

セットアップ

SSDへのRaspberry Pi OSの書き込み

  1. microSDをPCに接続
  2. Raspbery Pi OS Imagerを公式よりダウンロード
  3. microSDにOS書き込み
    OSは64 bit Desktop版(GUIあり)を選択。書き込む時にWiFiのSSID/PW, SSHのPWを入れておくと、モニターなどを繋がなくてもSSH接続で設定ができる。
  4. Pi5を起動し、SSH接続
sudo apt update
sudo apt upgrade

を実施。

5.PCIeポートをactivateする

sudo nano /boot/firmware/config.txt

最終行に次のコメントを加える

# Enable the PCIe External connector.
dtparam=pciex1
# This line is an alias for above (you can use either/or to enable the port).
dtparam=nvme

PCIe GEN3を指定すると、起動しなくなった。SSDとの相性問題?

sudo reboot

を実行して再起動
6. VNCで接続する(GUIを使えるようになる)
7. GUIでSD card copierを選択。SDカードの内容をNVMe SSDにコピーする
8. ShutdownしてSDカードを抜く。そのあと起動する。

SSD性能テスト

diskspd for linuxで速度測定を実施。
インストール方法はこちらを参照した。

sudo ./bin/diskspd -Sd -t2 -b4K -r4K -L -w30 /dev/nvme0n1p2

結果

Command Line: ./bin/diskspd -Sd -t2 -b4K -r4K -L -w30 /dev/nvme0n1p2

System info:
	processor count: 4

Input parameters:

	job:   1
	________
	duration: 10s
	warm up time: 5s
	measuring latency
	random seed: 0
	total threads: 2
	path: '/dev/nvme0n1p2'
		size: 255519449088B
		using O_DIRECT
		performing mix test (read/write ratio: 70/30)
		block size: 4096
		using random I/O (alignment: 4096)
		number of outstanding I/O operations: 2)
		thread stride size: 0
		threads per file: 2
		block device: nvme0n1
		device scheduler: none

Results for job 1:
test time:         10s
*****************************************************

 CPU  |  Usage  |   User  |  Kernel | IO Wait |   Idle 
-------------------------------------------------------
    0 |  29.02% |  19.08% |   9.93% |   0.00% |  70.98% 
    1 |  29.52% |  17.98% |  11.54% |   0.00% |  70.48% 
    2 |   0.00% |   0.00% |   0.00% |   0.00% | 100.00% 
    3 |   0.00% |   0.00% |   0.00% |   0.00% | 100.00% 
-------------------------------------------------------
 avg:	 14.64% |   9.27% |   5.37% |   0.00% |  85.36%

Total IO
thread |           bytes |         I/Os |       MB/s |  I/O per s | AvgLat(ms) | LatStdDev  | file
-------------------------------------------------------------------------------------------------------
     0 |      1129795584 |       275829 |     107.75 |   27582.90 |       0.073 |       0.064 | /dev/nvme0n1p2 (255519449088B)
     1 |      1129795584 |       275829 |     107.75 |   27582.90 |       0.073 |       0.064 | /dev/nvme0n1p2 (255519449088B)
-------------------------------------------------------------------------------------------------------
total:        2259591168 |       551658 |     215.49 |   55165.80 |       0.073 |       0.064 

Read IO
thread |           bytes |         I/Os |       MB/s |  I/O per s | AvgLat(ms) | LatStdDev  | file
-------------------------------------------------------------------------------------------------------
     0 |       791416832 |       193217 |      75.48 |   19321.70 |       0.080 |       0.067 | /dev/nvme0n1p2 (255519449088B)
     1 |       790519808 |       192998 |      75.39 |   19299.80 |       0.080 |       0.067 | /dev/nvme0n1p2 (255519449088B)
-------------------------------------------------------------------------------------------------------
total:        1581936640 |       386215 |     150.87 |   38621.50 |       0.080 |       0.067 

Write IO
thread |           bytes |         I/Os |       MB/s |  I/O per s | AvgLat(ms) | LatStdDev  | file
-------------------------------------------------------------------------------------------------------
     0 |       338378752 |        82612 |      32.27 |    8261.20 |       0.056 |       0.053 | /dev/nvme0n1p2 (255519449088B)
     1 |       339275776 |        82831 |      32.36 |    8283.10 |       0.055 |       0.049 | /dev/nvme0n1p2 (255519449088B)
-------------------------------------------------------------------------------------------------------
total:         677654528 |       165443 |      64.63 |   16544.30 |       0.056 |       0.051 


  %-ile |	Read (ms) | Write (ms) | Total (ms)
----------------------------------------------
    min |      0.023 |      0.023 |      0.023
   25th |      0.065 |      0.030 |      0.041
   50th |      0.074 |      0.041 |      0.071
   75th |      0.082 |      0.073 |      0.080
   90th |      0.105 |      0.084 |      0.100
   95th |      0.132 |      0.104 |      0.121
   99th |      0.386 |      0.225 |      0.344
3-nines |      0.780 |      0.671 |      0.759
4-nines |      1.003 |      0.914 |      0.979
5-nines |      5.945 |      1.155 |      5.939
6-nines |      6.111 |      6.111 |      6.111
7-nines |      6.111 |      6.111 |      6.111
8-nines |      6.111 |      6.111 |      6.111
9-nines |      6.111 |      6.111 |      6.111
    max |      6.111 |      6.111 |      6.111

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0