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 but since this is written for the Radxa OS it doesnât work
So I found this question 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
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
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
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)
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 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-
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 was unnecessary. After using sudo ./adafruit-pi-externalroot-helper -d /dev/nvme0n1 I got the response
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
[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.
I tried running the command git clone ``git@github.com``:adafruit/Adafruit-Pi-ExternalRoot-Helper.git before, but I got this response:
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.
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
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
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
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
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?
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
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
sed -i 's/${target_drive}1/${target_drive}p1/g' ./adafruit-pi-externalroot-helper
I did a simple guide to install dietpi on Rock 5T, maybe may be usefull for some hints!
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