# How to Clone Pi OS from a microSD to an NVMe SSD

A concise guide for experienced users on migrating a Raspberry Pi OS installation from a microSD card to a high-performance NVMe SSD using Klon (a modern rpi-clone-inspired tool).

Published: 2025-11-29
Tags: raspberry-pi, nvme, linux, performance, klon

---
Migrating your Raspberry Pi's root filesystem from a microSD card to an NVMe SSD is one of the most significant performance upgrades you can make. It dramatically improves disk I/O, which in turn enhances overall system responsiveness, application load times, and file transfer speeds.

This guide provides a direct walkthrough for cloning your existing Pi OS setup to an NVMe drive using **Klon**, a tool I built after running into reliability issues with `rpi-clone` on modern SSD/NVMe setups.

### Prerequisites

*   Raspberry Pi 4 or 5.
*   An NVMe-compatible HAT or adapter.
*   An NVMe SSD installed and recognized by the Pi.

### Step 1: Identify the Source and Target Drives

First, ensure your system is up-to-date and the NVMe drive is visible.

```bash
sudo apt update && sudo apt upgrade -y
```

Next, identify the block devices. `mmcblk0` is typically the microSD card, and your NVMe will appear as `nvme0n1`.

```bash
lsblk
```

You should see an output similar to this, clearly distinguishing the source and destination:

```
NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
mmcblk0     179:0    0  59.5G  0 disk
├─mmcblk0p1 179:1    0   256M  0 part /boot
└─mmcblk0p2 179:2    0  59.2G  0 part /
nvme0n1     259:0    0 931.5G  0 disk
```

### Step 2: Install and Clone the System with Klon

`rpi-clone` is a great script, but it hasn’t aged well with newer device naming and some modern SSD/NVMe behaviors. Because of that, I created **Klon**: a Go-based cloning tool inspired by `rpi-clone`, with an explicit plan/confirm flow and better handling of current Linux disk conventions. Repo: https://github.com/woliveiras/klon

#### Install Klon (Raspberry Pi OS / Debian)

If you want the simplest path, install a prebuilt release:

```bash
sudo apt-get update
sudo apt-get install -y curl tar gzip dpkg
```

Download and install the binary (example for Raspberry Pi 4/5, usually `arm64`):

```bash
VERSION=vX.Y.Z
ARCH=arm64   # or amd64
curl -L -o klon_${VERSION}_linux_${ARCH}.tar.gz \
  https://github.com/woliveiras/klon/releases/download/${VERSION}/klon_${VERSION}_linux_${ARCH}.tar.gz
sudo tar -C /usr/local/bin -xzvf klon_${VERSION}_linux_${ARCH}.tar.gz klon
klon --version
```

#### Clone microSD → NVMe with Klon

Klon always shows you a clone plan first and asks for confirmation before it writes anything to the destination disk. For a brand-new SSD, you typically want an **initialize + sync** clone and then expand root to fill the disk:

```bash
sudo klon -f --expand-root nvme0n1
```

If you prefer the interactive mode (recommended), just run:

```bash
sudo klon
```

### Step 3: Configure the Boot Order

After the clone is complete, you must instruct the Raspberry Pi to boot from the new NVMe drive.

```bash
sudo raspi-config
```

Navigate to **Advanced Options** > **Boot Order** and select **B2 NVMe/USB Boot**.

### Step 4: Finalize and Reboot

Exit `raspi-config`, shut down the system, remove the microSD card, and power it back on. Your Raspberry Pi will now boot from the NVMe SSD.

```bash
sudo shutdown now
```

You can verify that the root filesystem (`/`) is mounted on the NVMe drive by running `lsblk` again. The output should now show `nvme0n1p2` as the root mountpoint.

### Troubleshooting

#### Mount Failure: "Can't lookup blockdev"

During the clone, you might encounter a mount failure:

```
Mounting /dev/nvme0n1p2 on /mnt/clone
mount: /mnt/clone: fsconfig() failed: ... Can't lookup blockdev.
Aborting!
```

This error typically means the kernel has not yet recognized the new partitions that were just created. You can manually force the kernel to re-read the disk’s partition table.

1.  Run `partprobe` targeting your NVMe disk:
    ```bash
    sudo partprobe /dev/nvme0n1
    ```

2.  Re-run the Klon command:
    ```bash
    sudo klon -f --expand-root nvme0n1
    ```