# Unable to clone OS to NVMe

**URL:** <https://dietpi.com/forum/t/unable-to-clone-os-to-nvme/24782>\
**Category:** Troubleshooting\
**Created:** [16 December 2025 00:04 UTC](https://dietpi.com/forum/t/unable-to-clone-os-to-nvme/24782 "2025-12-16T00:04:26Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![NinjaEule](https://dietpi.com/forum/user_avatar/dietpi.com/ninjaeule/32/8607_2.png) [@NinjaEule](https://dietpi.com/forum/u/NinjaEule)\
**Post date:** [16 December 2025 00:04 UTC](https://dietpi.com/forum/t/unable-to-clone-os-to-nvme/24782/1 "2025-12-16T00:04:26Z")

</div>

I have searched the existing open and closed issues

#### Required Information

- DietPi version | `Core:9 Sub:20 RC:1 branch:master owner:MichaIng`
- Distro version | `trixie`
- Kernel version | `Linux DietPi 6.1.115-vendor-rk35xx #1 SMP Mon Dec 1 08:58:34 UTC 2025 aarch64 GNU/Linux`
- Architecture | `arm64`
- SBC model | `ROCK 5B (aarch64)`
- Power supply used | 30 W (5V-3A 9V-3A 12V-2.5A 15V-2A 20V-1.5A)
- SD card used | Toshiba 4GB HC 4
- NVMe used | Kingston NV2 NVMe PCIe 4.0 1TB M.2 2280 -SNV2S/1000G

#### Additional Information

- Software title | rpi-clone
- freshly installed
- `lsblk command output: `  
`NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS`  
`mtddblock0 31:0 0 16M 0 disk`  
`mmcblk1 179:0 0 3.6G 0 disk`  
`L_mmcblk1p1 191:1 0 3,6G 0 part /`  
`nvme0n1 259:0 0 931.5G 0 disk`
- 
#### Steps to reproduce

`sudo rpi-clone nvme0n1`

#### Expected behaviour

The boot drive should be cloned to the NVMe

#### Actual behaviour

rpi-clone Version:2.0.26  
Unable to locate boot device

#### Extra details

- Since the read speed of the SD card slot of the ROCK 5B is quite slow, and I only have a 4GB SD card that’s not in operation, I wanted to clone the OS to the NVMe that I installed.
- I first tried to follow this [guide](https://docs.radxa.com/en/rock5/rock5b/getting-started/install-os/nvme) but since this is written for the Radxa OS it doesn’t work
- So I found this [question](https://dietpi.com/forum/t/dietpi-headless-install-on-raspberry-pi-5-nvme-drive/20087) with my problem as the solution
- Unfortunately, as seen above, rpi-clone doesn’t clone the OS to the NVMe as it’s unable to locate the boot device despite both the SD card and the NVMe showing up when using the lsblk command
- If you need more information, just tell me what you need and how I can provide it

---

<div class="post-metadata">

**Author:** ![Jappe](https://dietpi.com/forum/user_avatar/dietpi.com/jappe/32/1788_2.png) [@Jappe](https://dietpi.com/forum/u/Jappe)\
**Post date:** [16 December 2025 00:46 UTC](https://dietpi.com/forum/t/unable-to-clone-os-to-nvme/24782/2 "2025-12-16T00:46:07Z")

</div>

rpi-clone is for RPi, not for radxa devices.

On your device the boatloader need to be on the SD card or the SPI flash.  
You could clone your root path to the nvme and then flash the SPI (like described in the radxa guide you posted). Or leave the bootloader on NVME

---

<div class="post-metadata">

**Author:** ![WarHawk](https://dietpi.com/forum/user_avatar/dietpi.com/warhawk/32/21_2.png) [@WarHawk](https://dietpi.com/forum/u/WarHawk)\
**Post date:** [16 December 2025 03:16 UTC](https://dietpi.com/forum/t/unable-to-clone-os-to-nvme/24782/3 "2025-12-16T03:16:14Z")

</div>

right, initial “boot” stuff needs to reside on a cheap slower SD card (which must remain in the device), which then initiates the boot, loads the initial kernel yadda yadda, then points everything else to the MUCH faster NVME drive, just make sure you follow the directions  
[nice thing with this method, you clone the /boot SD card and keep the .img safe, if it ever corrupts or fries, just reimage and it will automatically come up like it never had a problem]

I also found this…but you might have to tweak it a little to ensure it does everything you need (it appears tailor built for “rasbian” but should work with almost all distro’s as long as they use the same type of filesystem and whatnot

> **[GitHub - benjamin-nose/Adafruit-Pi-ExternalRoot-Helper: A shell script to configure a USB drive as root...](https://github.com/benjamin-nose/Adafruit-Pi-ExternalRoot-Helper)**
>
> A shell script to configure a USB drive as root filesystem.

At least that is what I have been doing on many of my simple SBC’s…usually in the form of a larger faster Sandisk Ultrafit USB drive (many of my SBC’s don’t have NVME onboard)

---

<div class="post-metadata">

**Author:** ![NinjaEule](https://dietpi.com/forum/user_avatar/dietpi.com/ninjaeule/32/8607_2.png) [@NinjaEule](https://dietpi.com/forum/u/NinjaEule)\
**Post date:** [16 December 2025 16:46 UTC](https://dietpi.com/forum/t/unable-to-clone-os-to-nvme/24782/4 "2025-12-16T16:46:34Z")

</div>

Makes sense why it doesn’t work, then.

So how do I clone my root path to the nvme if I can’t use this program for that?

I have tried what WarHawk suggested but for some reason I get the error `-bash: git: command not found` when trying to install it with the command `git clone ``git@github.com``:adafruit/Adafruit-Pi-ExternalRoot-Helper.git` and if I instead use `sudo apt-get install adafruit-pi-externalroot-helper` from the tutorial I get this error `E: Unable to locate package adafruit-pi-externalroot-helper`. Is git not a standard command on dietpi? If so, how do I add it?

As for flashing the SPI, the tool [rsetup](https://docs.radxa.com/en/rock5/rock5b/radxa-os/rsetup) is only preinstalled on Raxda OS and I don’t know how to install it on dietpi `sudo apt-get install rsetup` results in another `E: Unable to locate package` error. Sorry if it’s a stupid question, but how can I install it on Dietpi? I’m still a beginner when it comes to Linux. If the bootloader has to stay on the SD card that’s not too big of a deal, but how do I check that once it boots it starts reading files from the NVMe not the SD card? Obviously bigger files on the NVMe will be loaded from there, but I would also like the system files to be loaded from the NVMe so the read and write speed isn’t a bottleneck during regular operation-

---

<div class="post-metadata">

**Author:** ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)\
**Post date:** [16 December 2025 17:02 UTC](https://dietpi.com/forum/t/unable-to-clone-os-to-nvme/24782/5 "2025-12-16T17:02:52Z")

</div>

> [@NinjaEule](#):
>
> `-bash: git: command not found`

You would need to install `git`

```auto
apt install git

```

---

<div class="post-metadata">

**Author:** ![NinjaEule](https://dietpi.com/forum/user_avatar/dietpi.com/ninjaeule/32/8607_2.png) [@NinjaEule](https://dietpi.com/forum/u/NinjaEule)\
**Post date:** [16 December 2025 18:03 UTC](https://dietpi.com/forum/t/unable-to-clone-os-to-nvme/24782/6 "2025-12-16T18:03:05Z")

</div>

Thanks, kind of embarrassing that I couldn’t come up with that myself.

I was able to install the program, but when I try to run `root@DietPi:~/Adafruit-Pi-ExternalRoot-Helper# -d /dev/nvme0n1`

after running `cd Adafruit-Pi-ExternalRoot-Helper`

I get `-bash: -d: command not found`

Is there some other program that need to install, or was there an issue while installing the program?

---

<div class="post-metadata">

**Author:** ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)\
**Post date:** [16 December 2025 20:19 UTC](https://dietpi.com/forum/t/unable-to-clone-os-to-nvme/24782/7 "2025-12-16T20:19:53Z")

</div>

Can you share the exact commands, one by one, you using

This is the example

```auto
cd Adafruit-Pi-ExternalRoot-Helper
sudo ./adafruit-pi-externalroot-helper -d /dev/xxx

```

---

<div class="post-metadata">

**Author:** ![NinjaEule](https://dietpi.com/forum/user_avatar/dietpi.com/ninjaeule/32/8607_2.png) [@NinjaEule](https://dietpi.com/forum/u/NinjaEule)\
**Post date:** [16 December 2025 20:49 UTC](https://dietpi.com/forum/t/unable-to-clone-os-to-nvme/24782/8 "2025-12-16T20:49:45Z")

</div>

Sorry, I was under the wrong impression that since `cd Adafruit-Pi-ExternalRoot-Helper` changes the directory to `./Adafruit-Pi-ExternalRoot-Helper ` the `./adafruit-pi-externalroot-helper` part of `./adafruit-pi-externalroot-helper -d /dev/xxx` from the [tutorial](https://learn.adafruit.com/external-drive-as-raspberry-pi-root/hooking-up-the-drive-and-copying-slash) was unnecessary. After using `sudo ./adafruit-pi-externalroot-helper -d /dev/nvme0n1` I got the response

```auto
Target drive = /dev/nvme0n1

[start] Will create new ext4 filesystem on /dev/nvme0n1

[start] If there is data on /dev/nvme0n1, it will be lost.

Really proceeed? (y)es / (n)o

```

After confirming with y it installed gdisk, rsync, & parted, and I then got this response

```auto
[fs create] Creating /dev/nvme0n11

[fs create] Creating ext4 filesystem on /dev/nvme0n11

mke2fs 1.47.2 (1-Jan-2025)

The file /dev/nvme0n11 does not exist and no size was specified.

```

What could be causing this?

---

<div class="post-metadata">

**Author:** ![Jappe](https://dietpi.com/forum/user_avatar/dietpi.com/jappe/32/1788_2.png) [@Jappe](https://dietpi.com/forum/u/Jappe)\
**Post date:** [16 December 2025 21:10 UTC](https://dietpi.com/forum/t/unable-to-clone-os-to-nvme/24782/9 "2025-12-16T21:10:22Z")

</div>

The script just appended `1` to the device name, but it should be `p1` if it created a partition beforehand.

This tool is unmaintained for 9 years, so probably some things have changed in the meanwhile.  
[https://github.com/adafruit/Adafruit-Pi-ExternalRoot-Helper](https://github.com/adafruit/Adafruit-Pi-ExternalRoot-Helper)

Oh look, somebody forked it and [in the issues of the adafruit repo somebody claims](https://github.com/adafruit/Adafruit-Pi-ExternalRoot-Helper/issues/16) it’s working, so you can try that instead  
[https://github.com/benjamin-nose/Adafruit-Pi-ExternalRoot-Helper](https://github.com/benjamin-nose/Adafruit-Pi-ExternalRoot-Helper)

---

<div class="post-metadata">

**Author:** ![NinjaEule](https://dietpi.com/forum/user_avatar/dietpi.com/ninjaeule/32/8607_2.png) [@NinjaEule](https://dietpi.com/forum/u/NinjaEule)\
**Post date:** [16 December 2025 22:33 UTC](https://dietpi.com/forum/t/unable-to-clone-os-to-nvme/24782/10 "2025-12-16T22:33:42Z")

</div>

I tried running the command `git clone ``git@github.com``:adafruit/Adafruit-Pi-ExternalRoot-Helper.git` before, but I got this response:

```auto
Cloning into ‘Adafruit-Pi-ExternalRoot-Helper’

error: cannot run ssh: No such file or directory

fatal: unable to fork

```

This is why I switched to `git clone ``https://github.com/adafruit/Adafruit-Pi-ExternalRoot-Helper.git`` ` from the tutorial.

Did I first have to install that one before I could install the forked version, or is the server for that down for whatever reason? I’m pretty sure that I didn’t make any spelling mistake, considering I checked it multiple times letter for letter.

Edit: shouldn’t `git clone ``https://github.com/benjamin-nose/Adafruit-Pi-ExternalRoot-Helper.git` work?

Also, I found [rsetup](https://github.com/radxa-pkg/rsetup/releases). Can I just install that to Flash the SPI, or doesn’t it work without an GUI?

---

<div class="post-metadata">

**Author:** ![Jappe](https://dietpi.com/forum/user_avatar/dietpi.com/jappe/32/1788_2.png) [@Jappe](https://dietpi.com/forum/u/Jappe)\
**Post date:** [16 December 2025 23:04 UTC](https://dietpi.com/forum/t/unable-to-clone-os-to-nvme/24782/11 "2025-12-16T23:04:22Z")

</div>

Remove the old folder (the one you cloned from the adafruit repo), then clone from the forked repo, cd into the newly cloned folder and execute the tool

```bash
rm -R Adafruit-Pi-ExternalRoot-Helper
git clone https://github.com/benjamin-nose/Adafruit-Pi-ExternalRoot-Helper.git
cd Adafruit-Pi-ExternalRoot-Helper
./adafruit-pi-externalroot-helper

```

---

<div class="post-metadata">

**Author:** ![WarHawk](https://dietpi.com/forum/user_avatar/dietpi.com/warhawk/32/21_2.png) [@WarHawk](https://dietpi.com/forum/u/WarHawk)\
**Post date:** [17 December 2025 03:21 UTC](https://dietpi.com/forum/t/unable-to-clone-os-to-nvme/24782/12 "2025-12-17T03:21:11Z")

</div>

Yeah, I for the longest used the “official” Adafruit one…it was bugged and I could NEVER get ahold of the original creator for a fix…then found the benjamin-nose version and it works on multiple SBC’s and multiple distros (both Orange Pi, Rasberry Pi’s, YouYeeToo X1, straight debian linux, the chinese built distro’s, ubuntu, and dietpi, USB drives, SSD’s, NVME drives) and it just works  
Just make sure:  
A. You leave the SD card in the SBC to “boot” the device (no need to flash the bios/firmware on the board, leave as “boot” from SD option (usually stock default on SBC’s)  
B. You make a backup of the SD card with whatever imager software you are comfortable with and keep handy in case it gets corrupted

---

<div class="post-metadata">

**Author:** ![NinjaEule](https://dietpi.com/forum/user_avatar/dietpi.com/ninjaeule/32/8607_2.png) [@NinjaEule](https://dietpi.com/forum/u/NinjaEule)\
**Post date:** [17 December 2025 16:35 UTC](https://dietpi.com/forum/t/unable-to-clone-os-to-nvme/24782/13 "2025-12-17T16:35:25Z")

</div>

I still get the same error:

```auto
root@DietPi:~# rm -R Adafruit-Pi-ExternalRoot-Helper
root@DietPi:~# git clone https://github.com/benjamin-nose/Adafruit-Pi-ExternalRoot-Helper.git 
Cloning into 'Adafruit-P1-ExternalRoot-Helper
remote: Enumerating objects: 66, done.
remote: Counting objects: 100% (9/9), done.
remote: Compressing objects: 100% (5/5), done.
remote: Total 66 (delta 4), reused 7 (delta 4), pack-reused 57 (from 1)
Receiving objects: 100% (66/66), 17.16 K1B | 1.07 MiB/s, done.
Resolving deltas: 100% (27/27), done.
root@DietPi:~# cd Adafruit-Pi-ExternalRoot-Helper
root@DietPi:~/Adafruit-Pi-ExternalRoot-Helper# sudo ./adafruit-pi-externalroot-helper -d /dev/nvme0n1
Target drive = /dev/nvme0n1
[start] will create new ext4 filesystem on /dev/nvmeen1
[start] If there is data on /dev/nvmeeni, it will be lost.
Really proceed? (y)es / (n)o y
[dependencies] Installing gdisk, rsync, and parted.
Reading package lists... 0%
Reading package lists... Done
Buliding dependency tree... Done
Reading state information... Done
gdisk is already the newest version (1.0.10-2+b1).
rsync is already the newest version (3.4.1+ds1-5).
parted is already the newest version (3.6-5).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
[fs create] Creating/dev/nvme0n11
[fs create] Creating ext4 filesystem on /dev/nvme0n11
mke2fs 1.47.2 (1-Jan-2025)
The file /dev/nvmme0n11 does not exist and no size was specified.
root@DietPi:~/Adafruit-PI-ExternalRoot-Helper#

```

I even made sure that the old installation was deleted by running

```auto
rm -R Adafruit-Pi-ExternalRoot-Helper
cd Adafruit-Pi-ExternalRoot-Helper
git clone https://github.com/benjamin-nose/Adafruit-Pi-ExternalRoot-Helper.git
cd Adafruit-Pi-ExternalRoot-Helper
sudo ./adafruit-pi-externalroot-helper -d /dev/nvme0n1

```

and got this response from the first cd command:

`-bash: cd: Adafruit-Pi-ExternalRoot-Helper: No such file or directory`

So the old installation must have been deleted.

Is the new fork also broken now, or am I not able to download the current version for whatever reason?

---

<div class="post-metadata">

**Author:** ![Jappe](https://dietpi.com/forum/user_avatar/dietpi.com/jappe/32/1788_2.png) [@Jappe](https://dietpi.com/forum/u/Jappe)\
**Post date:** [17 December 2025 20:44 UTC](https://dietpi.com/forum/t/unable-to-clone-os-to-nvme/24782/14 "2025-12-17T20:44:49Z")

</div>

[OK I see the problem here](https://github.com/benjamin-nose/Adafruit-Pi-ExternalRoot-Helper/blob/09a77d0f6224c2f716eef386aced89d93ed77e49/adafruit-pi-externalroot-helper?plain=1#L88)

```auto
export target_partition="${target_drive}1"

```

It can not handle NVME drives since the partition scheme is different from SATA/USB devices.  
On non-NVME you have a device name like `/dev/sda` and the first partition would be `/dev/sda1`.  
But for NVME the device name is like `/dev/nvme0n1` and the first partition is `/dev/nvme0n1p1` but the script only appends a `1`, which iswrong in your case.

You could just edit that line locally for your script (it’s line 88) and change it to

```auto
export target_partition="${target_drive}p1"

```

so it would work with your NVME drive, but no longer for SATA/USB drives. SOmebody would need to add some logic to detect what type of block device the target drive is.

Here is a one-line-command to change that line for you. When you are in the directory `Adafruit-Pi-ExternalRoot-Helper` do the following

```auto
sed -i 's/${target_drive}1/${target_drive}p1/g' ./adafruit-pi-externalroot-helper

```

and then run the script again.

---

<div class="post-metadata">

**Author:** ![NinjaEule](https://dietpi.com/forum/user_avatar/dietpi.com/ninjaeule/32/8607_2.png) [@NinjaEule](https://dietpi.com/forum/u/NinjaEule)\
**Post date:** [17 December 2025 21:38 UTC](https://dietpi.com/forum/t/unable-to-clone-os-to-nvme/24782/15 "2025-12-17T21:38:15Z")

</div>

Thanks, that did work. The program ran until this line

```auto
[boot config] Configuring boot from {/dev/nvme01n1p1}

cp: cannot stat ‘/boot/cmdline.txt’: No such file or directory

```

That’s expected since in order to boot from the nvme I need to flash the SPI, right?

The line before this was

```auto
[fs copy] Copying root filesystem to /dev/nvme0n1p1 with rsync

[fs copy] This will take quite a while. Please be patient

```

from what I can see from the code, the rest is related to configuring boot as well so it shouldn’t matter to me.

---

<div class="post-metadata">

**Author:** ![Jappe](https://dietpi.com/forum/user_avatar/dietpi.com/jappe/32/1788_2.png) [@Jappe](https://dietpi.com/forum/u/Jappe)\
**Post date:** [17 December 2025 21:57 UTC](https://dietpi.com/forum/t/unable-to-clone-os-to-nvme/24782/16 "2025-12-17T21:57:16Z")

</div>

Yea, this is for RPi but you are using a Rock5, so you don’t habe this file.  
Anyways, the drive is now clone, youc ancheck with `lsblk`.

> [@NinjaEule](#):
>
> from what I can see from the code, the rest is related to configuring boot as well so it shouldn’t matter to me.

Yes, flash the SPI with u-boot and it should be fine.

---

<div class="post-metadata">

**Author:** ![mvimercati](https://dietpi.com/forum/user_avatar/dietpi.com/mvimercati/32/8619_2.png) [@mvimercati](https://dietpi.com/forum/u/mvimercati)\
**Post date:** [29 December 2025 13:37 UTC](https://dietpi.com/forum/t/unable-to-clone-os-to-nvme/24782/17 "2025-12-29T13:37:40Z")

</div>

I did a simple guide to install dietpi on Rock 5T, maybe may be usefull for some hints!

> **[GitHub - mvimercati/rock-5t-dietpi-boot-nvme: Install & boot Dietpi from nvme on Radxa Rock 5T](https://github.com/mvimercati/rock-5t-dietpi-boot-nvme)**
>
> Install & boot Dietpi from nvme on Radxa Rock 5T

Actually flashing the spi with the diet pi u-boot (through the dietpi-config) did not work for me, the board was not booting properly. I discovered looking at debug console on UART interface

---

<div class="post-metadata">

**Author:** ![system](https://dietpi.com/forum/uploads/default/original/1X/7e1021de2213860bce185915ce2c1786e56490ec.png) [@system](https://dietpi.com/forum/u/system)\
**Post date:** [29 March 2026 13:38 UTC](https://dietpi.com/forum/t/unable-to-clone-os-to-nvme/24782/18 "2026-03-29T13:38:12Z")

</div>

Closed on 29 March 2026 13:38 UTC

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
