Sunday 8 July 2018

Use of 32GB+ SD/micro SD cards with the Raspberry Pi

Introduction

The SD and micro SD card are now nearly ubiquitous. Every year the size and speed improve (while the cost only fluctuates).
I use a GoPro camera that takes SD cards, and have recently started to use 64GB cards as that means that I only have to worry about battery life and not running out of storage.
My desktop computer happily reads the cards and allows me to view the photographs and video. While I am away, I take a Raspberry Pi as an entertainment system and to back up my videos. I discovered that my new 64GB card was not visible to the Pi.

SDXC cards (greater than 32GB capacity)

SDXC (Secure Digital eXtended Capacity) extended the capacity of SD format cards beyond the 32GB limit of the previous SDHC (Secure Digital High Capacity) standard. However, they are supplied and assumed to use the proprietary exFAT file system.
Some card readers will always assume that the card will be exFAT format and will treat any other format as defective. This can lead to data loss

Raspberry Pi reading exFAT SDXC cards

Out of the box the Raspbian cannot read SDXC cards formatted with the exFAT filesystem. Due to the patented technologies inherent in any implementation of exFAT, it is not possible to include solutions capable of implementing exFAT in Linux.
However there are solutions within the official repository for Raspbian (and most other Linux distributions).
At the command line or open a terminal window and use the following
Sudo apt-get install exfat-fuse exfat-utils
Restart and you will be able to read your SDXC card and look at the photographs from your camera.

Booting from a 32GB+ SD/Micro SD card

The Raspberry Pi Bootloader can only read FAT and FAT32 cards, and as noted above 64GB and above cards are supplied with the exFAT format.
To use a 64GB card as a boot card it needs to be formatted to FAT32.
The built in disc formatting tools on Linux and MACOS are quite capable of formatting the cards. Make sure to select the FAT32 format.
The case with Windows is slightly different, a third party producr will need to be used as the Windows disc formatter will only format cards greater thn 32GB to exFAT.



References

https://en.wikipedia.org/wiki/Secure_Digital#SDXC
https://en.wikipedia.org/wiki/ExFAT
https://en.wikipedia.org/wiki/ExFAT#Reimplementations
https://www.raspberrypi.org/documentation/installation/sdxc_formatting.md