デシリットルの野望

何でも知りたい。そんな野望を抱いています。「ですます調」と「だである調」が混在しているのは仕様。

Raspberry Piで使うSDカードについて公式ガイドラインを読む!

Raspberry Piで使うSDカードなんて、容量がデカけりゃなんでもいいよ」

そう思っていた私が、公式のガイドラインを読んで得た知識を記録します。 念の為最初に書いておきますが、推奨されるSDカードの仕様は公式ガイドライン内では厳密には明示されていませんでした。 あくまで、「ガイドラインを読んだ!」という内容の記事ですので悪しからず。

公式ガイドライン

何よりもマズ見るべきは公式が公開している資料。Raspberry Pi FoundationがSDカードに関するガイドラインを公開しています。当然ながら英語です。機械翻訳を駆使しながら一生懸命読みます。

SD cards - Raspberry Pi Documentation

まずは容量について

上記のウェブサイトより引用

For installation of Raspberry Pi OS with desktop and recommended software (Full) via NOOBS the minimum card size is 16GB. For the image installation of Raspberry Pi OS with desktop and recommended software, the minimum card size is 8GB. For Raspberry Pi OS Lite image installations we recommend a minimum of 4GB. Some distributions, for example LibreELEC and Arch, can run on much smaller cards. If you're planning to use a card of 64GB or more with NOOBS, see this page first.

Note: Only the Raspberry Pi 3A+, 3B+ and Compute Module 3+ can boot from an SD card larger than 256 GB. This is because there was a bug in the SoC used on previous models of Pi.

要約するとこんな感じ(になると思うけど自信は無い)

  • NOOBSを使ってRaspberry Pi OS (Full)をインストールする場合は最低16GBの容量が必要
  • Raspberry Pi OS(Full)のイメージを直接書き込む場合は最低8GB
  • Raspberry Pi OS Liteのイメージを直接書き込む場合は最低4GB
  • LibreELECやArchなどのいくつかのディストリビューションはより小さい容量のSDカードでも動作する
  • 64GB以上のSDカードでNOOBSを使用する場合はこのページを最初に読め
  • Raspberry Pi 3より前のモデルでは使用しているSocにバグがあるので256GBよりも大きい容量のSDカードは使用できない
    • 64GB以上の容量だと何かマズいらしい

"このページを最初に読め"だそうなので、見てみると以下の様に説明されていました。

According to the SD specifications, any SD card larger than 32GB is an SDXC card and has to be formatted with the exFAT filesystem. This means the official SD Formatter tool will always format cards that are 64GB or larger as exFAT.

The Raspberry Pi's bootloader, built into the GPU and non-updateable, only has support for reading from FAT filesystems (both FAT16 and FAT32), and is unable to boot from an exFAT filesystem. So if you want to use NOOBS on a card that is 64GB or larger, you need to reformat it as FAT32 first before copying the NOOBS files to it.

例によって乏しい英語力で訳すとこんな感じ

  • SDカードの仕様上、32GBよりも大きい容量を持つSDカードはSDXCカードであり、exFATでフォーマットされている必要がある
  • つまり64GB以上の容量をもつSDカードは公式(SDアソシエーション)のフォーマッターを使用するとexFATでフォーマットされる事になる
  • Raspberry PiブートローダーはFAT16FAT32しかサポートしていないので、exFATファイルシステムからはブートできない
  • なのでもし64GB以上の容量をもつSDカードでNOOBSを使用するなら、NOOBSのファイルをコピーする前にFAT32にフォーマットしなおす必要がある

 これはガイドラインを読まなきゃ分からない事だな・・・

SDカードのクラスはどう選ぶべきか

ガイドラインには一般論しか書かれておらず、どのクラスを選ぶべきか明示されていませんでした。

The card class determines the sustained write speed for the card; a class 4 card will be able to write at 4MB/s, whereas a class 10 should be able to attain 10 MB/s. However, it should be noted that this does not mean a class 10 card will outperform a class 4 card for general usage, because often this write speed is achieved at the cost of read speed and increased seek times.

物理的なサイズは?

ガイドラインを引用する程の事ではありませんが、RaspberryPi Model AとRaspberry Pi Model BはフルサイズのSDカードで、Raspberry Pi Model B+以降のモノはmicroSDカードを使用するそうです。

The original Raspberry Pi Model A and Raspberry Pi Model B require full-size SD cards. From the Model B+ (2014) onwards, a micro SD card is required.

結局どのSDカードを選べば良い?

ガイドラインのTroubleshootingにこう書いてありました

We recommend buying the Raspberry Pi SD card which is available here, as well as from other retailers; this is an 8GB class 6 micro SD card (with a full-size SD adapter) that outperforms almost all other SD cards on the market and is a good value solution.

  • Raspberry Pi SDカードを購入するのを推奨する
  • これは8GBでClass6のフルサイズへのアダプタ付きSDカードである

直リンクは避けますが、ガイドラインから販売ページへのリンクが張られていました。ガイドライン上は8GBとされていましたが、販売されていたものは32GBと64GBのものでした。また販売ページにはSDカードのクラスが明示されていませんでした。

どう判断すれば良いんだ…

結論

 冒頭で記した通り結論としては『推奨されるSDカードの仕様は公式ガイドライン内では厳密には明示されていない』です。用途に応じて、サイズやスピードクラスを判断する必要がありそうです。

あたりまえか。

(参考)相性問題があるらしい

 Web上の情報によると、どうやらRPiとSDカードの間に相性問題が存在するらしく、elinux.orgに海外のユーザらによる検証結果がまとめられています。

 一般ユーザによる報告である点については留意する必要がありますが、検証結果が「nok」となっている製品については避けた方が無難でしょう。

RPi SD cards - eLinux.org

以上