Repository navigation
Raspberry Pi Storage
🌐 Language: EN · DE · FR · ES · TR · EL
SD cards and 24/7 server operation are a bad combination. This page explains why, and guides you to the right alternative for your setup — step by step.
Modern SD cards survive 3,000–10,000 write cycles per block. That sounds like a lot. It isn't.
| What writes to the SD card? | How often? |
|---|---|
| Docker container logs | Multiple times per minute |
| SQLite database (trips, charging sessions) | Every 30–60 seconds |
System logs (/var/log) |
Continuously |
| OS swap | Under memory pressure |
Realistic outcome: Under Tesla Carview's write load, a typical SD card lasts 3–18 months, then:
- Filesystem corruption → system won't boot
- Data lost (backups help, but the damage is done)
- Worst case: silent, undetected data corruption
Bottom line: SD card is fine for a quick test. For permanent operation, always switch to SSD.
What Raspberry Pi do you have?
│
├── Raspberry Pi 5
│ ├── Want the best performance and longest life?
│ │ → Option B: NVMe SSD via M.2 HAT+ ⭐ recommended
│ └── Simple, cheap, no assembly?
│ → Option A: USB SSD (also excellent on Pi 5)
│
├── Raspberry Pi 4
│ ├── Homelab with Gigabit LAN + existing server?
│ │ → Option C: PXE network boot (no local storage at all)
│ └── Normal home network?
│ → Option A: USB SSD (simplest solution)
│
└── Raspberry Pi 3 or older
→ No longer supported (32-bit ARM). Tesla Carview requires
a Pi 4 or 5 — see Installation.
What you need: A portable SSD or a 2.5" SATA SSD + USB adapter.
| Product | Approx. price | Notes |
|---|---|---|
| Samsung T7 (500 GB) | ~€55 | Great, but Pi 4 needs quirk fix (→ below) |
| Crucial X6 (500 GB) | ~€45 | Reliable, no quirks |
| WD My Passport SSD (500 GB) | ~€50 | Well tested on Raspberry Pi OS |
| 2.5" SATA SSD + UGREEN USB 3.0 adapter | ~€35–50 | Very reliable for Pi 4 |
Avoid cheap no-name USB-SATA adapters — they often have UASP compatibility issues on Pi 4. Brand adapters (UGREEN, Inateck) are more reliable.
- Download Raspberry Pi Imager and install it on your regular computer
- Connect the SSD via USB to your regular computer
- Open Imager:
- Device: choose Raspberry Pi 4 or 5
- OS: Raspberry Pi OS Lite (64-bit) — no desktop, more resources for Docker
- Storage: your SSD
- Click the ⚙️ gear icon → pre-configure:
- Hostname: e.g.
tesla-pi - Enable SSH: yes
- Wi-Fi credentials (if not using Ethernet)
- Username + password
- Hostname: e.g.
- Click Write — done in ~5 minutes
Pi 5 boots from USB out of the box. Pi 4 needs a one-time bootloader update:
# Boot from an SD card briefly, then run:
sudo raspi-config
# → Advanced Options → Boot Order → USB Boot → Finish → RebootThen: remove the SD card, plug in the SSD, power on → Pi boots from SSD.
If your Pi 4 gets stuck with the Samsung T7 (flashing red LED, won't boot):
# Open this file — must remain a single line!
sudo nano /boot/firmware/cmdline.txt
# Append at the end of the line (space before it):
usb-storage.quirks=04e8:4001:u
# Save (Ctrl+O, Enter, Ctrl+X), then reboot:
sudo rebootThis disables UASP for the T7 only. Performance is still 5–10× better than an SD card.
curl -fsSL https://raw.githubusercontent.com/KnevS/Tesla-Carview/main/deploy/setup.sh | bashThe Pi 5 has a PCIe connector. With an M.2 HAT you get NVMe speeds of 400–900 MB/s — vs. ~20–90 MB/s for SD cards.
| Component | Recommendation | Approx. price |
|---|---|---|
| Raspberry Pi 5 (4 GB or 8 GB) | — | from €60 |
| Official Raspberry Pi M.2 HAT+ | 2230 or 2242 form factor | ~€15 |
| or Pimoroni NVMe BASE | Compact, no spacers | ~€20 |
| or Pineberry HatDrive Bottom | Mounts under the Pi | ~€25 |
| NVMe SSD M.2 2230 or 2242 | WD SN350, Kingston NV2, Samsung PM991 | €25–60 |
Form factor is critical: The official M.2 HAT+ supports only 2230 and 2242 (short SSDs). Standard 2280 SSDs (the common long ones) don't fit. Third-party HATs often support 2280 — check before buying.
- Slide SSD into the M.2 slot at an angle, then press flat
- Secure with the included screw
- Connect the FFC ribbon cable (HAT ↔ Pi 5 PCIe connector)
- Mount HAT onto the Pi 5 GPIO header
Easy method: Boot from SD card, then write to NVMe from there:
sudo apt update && sudo apt install rpi-imager -y
rpi-imager
# Select NVMe SSD as target → writeAlternative: Use a USB-NVMe adapter on a regular computer and use Raspberry Pi Imager as in Option A.
sudo raspi-config
# → Advanced Options → Boot Order → NVMe/USB Boot
# → Finish → RebootRemove SD card → Pi boots from NVMe.
Pi 5 defaults to Gen 2 (~400 MB/s). Gen 3 (~900 MB/s) is unofficial but usually stable:
sudo nano /boot/firmware/config.txt
# Add at end:
dtparam=pciex1_gen=3PXE boot means the Pi has no local storage at all — it boots entirely over the network from a central server. Great when:
- You manage multiple Pis
- A NAS (Synology, TrueNAS) or mini PC is already on your network
- You prefer centralised backups and management
Requirements:
- Gigabit Ethernet (Wi-Fi is too slow/unreliable for PXE)
- An existing server on the network that can run DHCP + TFTP + NFS
- Raspberry Pi 4 or 5
On the PXE server (Debian/Ubuntu):
sudo apt install dnsmasq nfs-kernel-server -y
sudo mkdir -p /srv/tftp /srv/nfs/rpi
# Add to /etc/exports:
echo "/srv/nfs/rpi *(rw,sync,no_subtree_check,no_root_squash)" | sudo tee -a /etc/exports
sudo exportfs -ra/etc/dnsmasq.conf (proxy DHCP — works alongside your existing router):
port=0
dhcp-range=192.168.1.0,proxy
log-dhcp
enable-tftp
tftp-root=/srv/tftp
pxe-service=0,"Raspberry Pi Boot"The full rootfs-copy and NFS configuration is extensive — follow the official guide: Raspberry Pi PXE boot documentation
Is PXE worth it for you? Only if you already run a homelab with central storage. For a single Pi, USB SSD or NVMe is simpler and equally robust.
Already running Tesla Carview on an SD card? You can migrate in about 20 minutes without losing any data.
# Connect SSD via USB to the running Pi
# Identify the target disk (usually /dev/sda):
lsblk
# Clone (Pi can keep running):
sudo dd if=/dev/mmcblk0 of=/dev/sda bs=4M status=progress conv=fsync
# Resize the partition to use the full SSD:
sudo parted /dev/sda resizepart 2 100%
sudo resize2fs /dev/sda2Enable USB boot as described in Option A, Step 2, then remove the SD card.
findmnt /
# Should show /dev/sda2 or nvme0n1p2, NOT mmcblk0p2| SD card | USB SSD | NVMe (Pi 5) | PXE | |
|---|---|---|---|---|
| Longevity | ❌ Months | ✅ Years | ✅ Years | ✅ No local wear |
| Setup effort | ✅ Minimal | ✅ Low | 🟡 Medium (HAT assembly) | ❌ High |
| Cost | ✅ ~€10 | 🟡 ~€35–60 | 🟡 ~€50–100 | ✅ €0 (if server exists) |
| Read speed | 20–90 MB/s | 200–500 MB/s | 400–900 MB/s | LAN speed |
| Recommended for | Testing only | Pi 4 permanent use | Pi 5 permanent use | Homelabs |
Pi 4: Yes — if the SD card isn't bootable, the Pi ignores it and boots from USB. Pi 5: Yes — after boot order configuration, NVMe/USB takes priority.
60–120 GB is plenty. The Tesla Carview database grows to a few hundred MB over years. Buying slightly larger is cheap and gives the SSD controller more blocks for wear levelling → longer life.
Technically yes, but not recommended. Flash drives have no wear levelling — they die faster than SD cards. The price difference to a cheap SSD is minimal.
SSDs are more resilient than SD cards during sudden power loss, but not immune. Use the built-in backup: Admin → Data → Backup regularly, or enable automated nightly backups.
- Raspberry Pi Imager
- Official M.2 HAT+ documentation
- Raspberry Pi PXE boot guide
- raspberry.tips: Boot Pi 4 from USB SSD
- raspberry.tips: Pi 5 NVMe setup + benchmarks
→ Installation | Network-Access | Home
🇬🇧 Home · Installation · Troubleshooting · License | 🇩🇪 Startseite · Installation · Fehlerbehebung | 🇫🇷 Accueil | 🇪🇸 Inicio | 🇹🇷 Ana Sayfa | 🇬🇷 Αρχική
GitHub Repository · Report an Issue
Tesla Carview — non-commercial, self-hosted Tesla data logger · © Sven Krische
🇬🇧 English
🚀 Getting Started
🌐 Network & Infrastructure
⚙️ Configuration
🔐 Security
📱 Reference
🇩🇪 Deutsch
🚀 Einstieg
🌐 Netzwerk & Infrastruktur
⚙️ Konfiguration
🔐 Sicherheit
📱 Referenz
🇫🇷 Français
🚀 Démarrage
🌐 Réseau & Infrastructure
⚙️ Configuration
🔐 Sécurité
📱 Référence
🇪🇸 Español
🚀 Primeros pasos
🌐 Red & Infraestructura
⚙️ Configuración
🔐 Seguridad
📱 Referencia
🇹🇷 Türkçe
🚀 Başlarken
🌐 Ağ & Altyapı
⚙️ Yapılandırma
🔐 Güvenlik
📱 Başvuru