Automation

Moving my greenhouse Raspberry Pi 5 from an SD card to an M.2 SSD, without shutting the greenhouse down

A Raspberry Pi 5 built into an Argon NEO 5 case, with the clock battery stuck inside the lid

I grow strawberries in a greenhouse in Yokohama. A Raspberry Pi 5 records the sensors and runs the roof vents, CO2, circulation fans and mist. On 29 November 2026 I moved this Pi from an SD card to an M.2 SSD. I changed the case to an Argon NEO 5 M.2 NVMe and added the SSD and a clock battery. The Pi was stopped twice: about an hour for the first stop to build the new case, and about six minutes for the second to switch over. This is a record of how it went and how things looked a day later.

The Raspberry Pi 5 in its new case, on a shelf in the greenhouse
The Pi after the move, in an Argon NEO 5 M.2 NVMe case

Why I moved it

The Pi writes to its storage all day, so I was worried the SD card would wear out sooner or later. The control system itself is described in "One brain for the greenhouse".

The Raspberry Pi 5 in its old case
The old case. It ran from the SD card

What I used

  • Case: Argon NEO 5 M.2 NVMe. The SSD connects to the Pi 5's PCIe port with a flat cable
  • SSD: Samsung 970 EVO 500GB. It was one half of a two-drive RAID0 in my old PC. Half of a RAID0 cannot be read on its own, so I wiped it
  • Clock battery: the official Raspberry Pi RTC battery
Two Samsung 970 EVO 500GB drives side by side, with the label numbers blurred
The two 970 EVOs from my old PC. I used one of them

Before wiping the SSD, I read its health data (SMART). Percentage used was 1%, data written was 16.3 TB, power-on hours were 8,022, and media errors were 0. I kept these numbers so I can compare the wear later.

If you are buying an SSD for this

The only drive I used is the 970 EVO from my old PC. It was made in 2018 and is no longer sold new. I have not used any of the drives named below.

  • Speed: the Pi 5's PCIe port is a single Gen2 lane, with a limit of about 450 MB/s. I measured 410 MB/s writing and 449 MB/s reading. A fast Gen4 drive will not go past that limit, so an affordable M.2 NVMe drive (up to 2280) is enough
  • Size: after the move, the Pi uses about 10 GB of 457 GB (3%). Even as the records grow each year, 256 GB should be plenty. 500 GB was more than I needed
  • Model: the safest choice is a drive from the list Argon has tested with the NEO 5 (product page). It includes the WD Blue SN580, WD SN570, Samsung 980 (not the Pro) and the official Raspberry Pi SSD (2230 length)
  • Power: the Pi 5's PCIe port supplies up to 5 W. Argon notes that high-performance drives can go over this during heavy reads and writes and drop out
  • Even for models on the list, Argon's forum has a few reports of a different capacity not working. Large drives with parts on both sides of the board may not fit the case

A runbook with Claude first

I wrote the steps into a runbook with Claude Code before touching anything. Claude wrote it; I read it and made the decisions.

  • When to stop: we planned the evening, away from the irrigation hours (9:00 to 15:00) and the automatic backups. Stopping during the day resets the running total of sunlight that triggers irrigation, and the next watering comes late. On the day, though, I moved it forward to around 1 pm, so that any trouble would not drag on into the night. To make up for it, once the Pi was back I ran one irrigation by hand from its control screen (LUCERNA)
  • While the Pi is off: the greenhouse's own environment controller keeps running the roof vents on their last settings. We decided not to stop on a day with strong wind in the forecast
  • Before stopping: set a flag that pauses sending settings to the roof vents, so the Pi is never shut down in the middle of a send
  • Done in advance: the bootloader (EEPROM) update and the setting that makes it look for the SSD were done the week before, without stopping anything. The case manual offers a script that rewrites the settings in one go, but that means running something fetched from the internet as is. I did not use it and wrote only the settings I needed

The first stop (about an hour) was to put everything in the new case and boot from the SD card as before, to check that the SSD was visible. Then, with the Pi running, the data was copied to the SSD, which took about four minutes. In the second stop, the control software was off for about six minutes: the database was closed, only what had changed was copied, and the Pi was booted from the SSD.

Things to watch when building it

A flat cable plugged into the PCIe connector on the Raspberry Pi 5
The PCIe flat cable. Check which way the copper side faces

The PCIe flat cable is easy to put in the wrong way round. I checked the drawing in the manual for which way the copper side faces before plugging it in. The cable goes through the slot marked "PCIE" in the case.

The flat cable passing through the "PCIE" slot in the case
Through the slot marked PCIE

The SSD goes into the M.2 slot in the bottom of the case and is held with a screw.

The 970 EVO plugged into the bottom of the case and screwed down
The SSD screwed into the bottom of the case

I replaced the thermal pad on the SSD with the new one that came with the case.

A light blue thermal pad on the SSD in the bottom of the case
The thermal pad on the SSD
A ribbed metal cover over the SSD
Then the metal cover on top

The clock battery plugs into the "RTC" connector on the board and sticks to the inside of the lid.

The clock battery stuck inside the case lid, wired to the RTC connector
The clock battery goes inside the lid

How it turned out

A 4 GB read and write test gave 410 MB/s for writing and 449 MB/s for reading. That is close to the limit of the Pi 5's PCIe port.

The next day (30 November), I ran the SSD's extended self-test. It passed with no errors. Percentage used was still 1%, media errors were 0, and the temperature was 39°C.

The automatic backups, four a day, have all succeeded since the move: four out of four. Each takes about 178 seconds, almost the same as on the SD card (about 183 seconds). That is because the backup is deliberately slowed down so it does not get in the way of the greenhouse records.

The clock is fixed too. Without a battery, every boot started the clock at 1970 or at the time the Pi was shut down. With the battery, the time is right from the moment it boots. The one exception was the very first boot after fitting the battery: the battery clock was still empty, so the time started out wrong. Until it was corrected from the internet, the SwitchBot API, which checks a time-based signature, returned errors (401). From the second boot on, the time has been right from the start. A day later, the clock was 0 seconds off internet time and the battery read about 3.0 V. I also added the setting that charges the battery (`dtparam=rtc_bbat_vchg`). The official documentation says to use it only with the official rechargeable battery.

The boot order is now SSD, then SD, then USB (`BOOT_ORDER=0xf416`).

The SD card stays in, asleep

With the bottom plate closed, this case does not let you take the SD card out. So I left the SD card in as a backup and set the boot order to "SSD first, then SD". If the SSD fails, I can go back to the SD card without opening the case.

But if the SSD is not found, the Pi boots from the SD card, which still holds the old records and settings from the day of the move. If the control software started from there, it would cause trouble. So the control and backup jobs on the SD side are switched off, and only the watchdog is left. If the Pi ever boots from the SD card, I get a message on LINE, the messaging app most people use in Japan.

Not checked yet

To be sure the clock battery really works, I plan to unplug the Pi for about a minute, plug it back in and look at the time right after it boots. I will do that the next time the greenhouse can spare the Pi. I will also compare the SSD's health data with the numbers I took before the move, once it has been in use for a while.

If you try this on a weekend

  • If the Pi runs a greenhouse or a shop, decide first when it is safe to stop it, and how you will make up for it if the timing slips. I planned to avoid irrigation and backup times, moved it to midday on the day, and added one manual irrigation
  • Do the slow parts (copying the data, boot settings) before you stop anything
  • With a second-hand SSD, read its health data before use and keep a copy
  • If the Pi keeps records, fit a clock battery from the start