Flash NVMe drive reusing system.img created


I am flashing an external SSD memory using ./tools/kernel_flash/l4t_initrd_flash.sh

After running this script 2 files are created:

-rwxr-xr-x 1 root root 4,5G may  3 17:26 ./build/Linux_for_Tegra/bootloader/system.img*
-rwxr-xr-x 1 root root 900G may  3 17:27 ./build/Linux_for_Tegra/bootloader/system.img.raw*

How I can flash a new SSD reusing the system.img file?

The flash.sh script has an option -r. this option skips building system.img; reuse the existing one, but I have not seen a similar option in l4t_initrd_flash.sh

Basically, I am searching for a method to create a file with rootfs image information and use this file to flash other systems


you should refer to Workflow 2 in Linux_for_Tegra/tools/kernel_flash/README_initrd_flash.txt
The process of creating system images and flashing devices can be separated.
It’s basically --flash-only.

Hi @DaveYYY ,

Thanks for the information.

I have seen if I run the commands:

$ sudo ./tools/kernel_flash/l4t_initrd_flash.sh --no-flash <board-name> <rootdev>

$ sudo ./tools/kernel_flash/l4t_initrd_flash.sh --flash-only <board-name> <rootdev>

I am able to flash the SSD, but I am not sure what are the files required to only run the second command.

For example, I have kept only this files and directory: (the other files generated were removed)


When I run the command using --flash-only option, it reports this error:

*                                            *
*  Step 1: Build the flashing environment    *
*                                            *
Create flash environment 0
cat: /home/mleiva/Linux_for_Tegra/bootloader/flashcmd.txt: No such file or directory
~/Linux_for_Tegra/bootloader ~/devdir/Linux_for_Tegra
cp: cannot stat './*.rec': No such file or directory
cp: cannot stat './recovery.img': No such file or directory
cp: cannot stat './*.dtb': No such file or directory
Cleaning up...

it seems that are required several files that were generated in the previous steps.

Is not possible to save only specific files in order to save the SSD image and be able to flash a system from other computer with a copy of these files?

What files can I save to clone the SSD image in other PC? Linux_for_Tegra/tools/kernel_flash/images/ directory?

What should be the steps if want to flash the image created with --no-flash option from another computer?


on Jetson devices, SSD is only used for rootfs,
and you’d still need other files for flashing the internal QSPI memory,
so they should not be removed when you want to flash with the --flash-only option.


What directory or files should I save if I want to make sure that I am cloning the SSD data?

My idea is to run the command with --no-flash option and then replace the files or directories needed to replace the content of the SSD, then flash the system.

I think it is, Linux_for_Tegra/tools/kernel_flash/images/ directory, is this correct?



so your use case is that, you want to keep the generated system image, and flash it on another host PC, right? You’d still need other files in the BSP for the flashing process to work, so the workflow should be:

  • Generate system images with --no-flash on host PC A
  • Download and extract the BSP on another host PC B (Ideally, the package for rootfs is not needed here)
  • Copy system images to host PC B (Linux_for_Tegra/bootloader/system.img)
  • Flash on host PC B with --flash-only

Hi DaveYYY

I am not sure if the file Linux_for_Tegra/bootloader/system.img is the file that I should save to be able to flash this the file system in other PC

I am creating and custom file system in Host PC A, I generated system image with --no-flash and save the file Linux_for_Tegra/bootloader/system.img

In Host PC B I Apply these steps:

  1. Download and extract the BSP on another host PC B y replace
  2. Generate system images with --no-flash
  3. Replace the file Linux_for_Tegra/bootloader/system.img with the files generated in host A
  4. Flash on host PC B with --flash-only

But when I see the filesystem it doesn’t have the expected custom file system.

But I repeated all the steps but instead of saving the Linux_for_Tegra/bootloader/system.img I save the content of the directory Linux_for_Tegra/tools/kernel_flash/images/ and in the step 3 I replace this directory.

Using this directory I see the file system is the one generated in host A, (my custom file system)

The tool seems to be working if I replace the content of the directory Linux_for_Tegra/tools/kernel_flash/images/

Does it make sense for you?



looks like you are right, and sorry for causing any confuse here.
I think system.img is for flash.sh, and yes, you’d need to use tools/kernel_flash/images/ for initrd_flash.

Hi @DaveYYY

Thanks for all your help.


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